[Type] Bugfix
[Module] Toolchain /
[Priority] Minor
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]
Change-Id: Icd6b2cc8ced65ba3e727f94218fa81f0036177a1
class Version < Array
+ include Comparable
def initialize s
super(s.split('.').map { |e| e.to_i })
end
- def < x
- (self <=> x) < 0
- end
- def <= x
- (self <=> x) <= 0
- end
- def > x
- (self <=> x) > 0
- end
- def >= x
- (self <=> x) >= 0
- end
- def == x
- (self <=> x) == 0
- end
- def != x
- (self <=> x) != 0
- end
def compare x
- if self < x then return -1
- elsif self == x then return 0
- else return 1 end
+ self <=> x
end
end