[Title] fix version class comparable
authorjiil.hyoun <jiil.hyoun@samsung.com>
Fri, 19 Oct 2012 05:58:47 +0000 (14:58 +0900)
committerjiil.hyoun <jiil.hyoun@samsung.com>
Fri, 19 Oct 2012 05:58:47 +0000 (14:58 +0900)
[Type] Bugfix
[Module] Toolchain /
[Priority] Minor
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

Change-Id: Icd6b2cc8ced65ba3e727f94218fa81f0036177a1

src/common/Version.rb

index b8a10588c4f7f7b456dc038a1833d1021d378298..7d7921d59e38241cb394853057974ecd0eeee820 100644 (file)
@@ -28,30 +28,11 @@ Contributors:
 
 
 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