From: jiil.hyoun Date: Fri, 19 Oct 2012 05:58:47 +0000 (+0900) Subject: [Title] fix version class comparable X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3ca4beefe990a7e7dfc494a399bd3e62d1589b8;p=sdk%2Ftools%2Fsdk-build.git [Title] fix version class comparable [Type] Bugfix [Module] Toolchain / [Priority] Minor [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] Change-Id: Icd6b2cc8ced65ba3e727f94218fa81f0036177a1 --- diff --git a/src/common/Version.rb b/src/common/Version.rb index b8a1058..7d7921d 100644 --- a/src/common/Version.rb +++ b/src/common/Version.rb @@ -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