Avatar Edgar González

  • Random
  • Archive
  • RSS

How compare versions strings in ruby

There is a lot of way to compare versions strings in ruby, for instance you turn each version string in to an array of integers and then use the array comparison operator. But I prefer this one:

Gem::Version.new('0.3.2') < Gem::Version.new('0.10.1')

    • #ruby
    • #comparison
    • #version
  • 9 months ago
  • 13
  • Comments
  • Permalink
  • Share
    Tweet

13 Notes/ Hide

  1. edgar posted this

Recent comments

Blog comments powered by Disqus
← Previous • Next →

Portrait/Logo

About

When I'm not spending time with Jessica and my kids, I build web applications. Rails developer, believer of Agile Development and Lean startups. NoSQL enthusiast.
CTO and Lord of the API at Piictu

Me, Elsewhere

  • @edgar on Twitter
  • Facebook Profile
  • edgargonzaleznetve on Youtube
  • egg on Flickr
  • edgar on Foursquare
  • My Skype Info
  • Linkedin Profile
  • edgar on github

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr