Comparing version strings in Ruby
Comparing version strings can be troublesome. You need to extract each digit and compare them against each other. Or simply make use of Gem::Version
:
Gem::Version.new('0.10.2') > Gem::Version.new('0.8.5') # => true
Written by Michel Billard
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#