Created
June 20, 2014 07:25
-
-
Save tkfm-yamaguchi/1a13c185ad7503f1ef26 to your computer and use it in GitHub Desktop.
math like version number comparison in ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ irb | |
irb(main):001:0> stable = Gem::Version.new("1.6.2") | |
=> #<Gem::Version "1.6.2"> | |
irb(main):002:0> pre = Gem::Version.new("2.0.0.pre") | |
=> #<Gem::Version "2.0.0.pre"> | |
irb(main):003:0> pub = Gem::Version.new("2.0.0") | |
=> #<Gem::Version "2.0.0"> | |
irb(main):004:0> stable < pre | |
=> true | |
irb(main):005:0> pre < pub | |
=> true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment