How to compare versions in Ruby? Ask Question

How to compare versions in Ruby? Ask Question

How to write a piece of code to compare some versions strings and get the newest?

For example strings like: '0.1', '0.2.1', '0.44'.

ベストアンサー1

Gem::Version.new('0.4.1') > Gem::Version.new('0.10.1')

おすすめ記事