Skip to content

Commit

Permalink
More reliable version number sort.
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebrock committed Feb 12, 2010
1 parent f16428c commit fedd945
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rubygems/commands/inabox_command.rb
Expand Up @@ -39,7 +39,8 @@ def find_gem
path, directory = File.split(Dir.pwd)
possible_gems = Dir.glob("pkg/#{directory}-*.gem")
raise Gem::CommandLineError, "Couldn't find a gem in pkg, please specify a gem name on the command line (e.g. gem inabox GEMNAME)" unless possible_gems.any?
possible_gems.sort.last
name_regexp = Regexp.new("^pkg/#{directory}-")
possible_gems.sort{ |a,b| Gem::Version.new(a.sub(name_regexp,'')) <=> Gem::Version.new(b.sub(name_regexp,'')) }.last
end

def send_gem
Expand Down

0 comments on commit fedd945

Please sign in to comment.