[Rubygems-developers] [gemtacular] - a question

Jim Weirich jim at weirichhouse.org
Fri Jan 19 00:05:55 EST 2007


Jim Freeze wrote:
 > Nice site. BTW, I just noticed that it lists as my latest gem
 > commandline-0.7.9, when it is actually commandline-0.7.10.
 > In this case, it is a bit misleading on what the latest version is.

Yes, it looks like it is doing a simple textual sort of the versions.  I 
would recommend using the RubyGems Version object and sorting those.

$ irb --simple-prompt
 >> require 'rubygems'
=> false
 >> [Gem::Version.new("1.10"), Gem::Version.new("1.9")].sort.map { |t| 
t.version }
=> ["1.9", "1.10"]


-- Jim Weirich


More information about the Rubygems-developers mailing list