[Rubygems-developers] improved find_all_gem_commands.rb

Stephen Bannasch stephen.bannasch at deanbrook.org
Tue Apr 8 00:04:50 EDT 2008


Now works on MacOS, Linux, and Windows -- finds all occurrences of 
any specific gem command for all paths in PATH.

improved, see: http://pastie.org/176659

Could perhaps be combined with other info from Gem.platforms, etc. to 
provide more intelligent multi-VM local Gem repository management.

Examples:

MacOS 10.5.2

   find_all_gem_commands
   => [{"ruby"=>"/usr/bin/gem"}, 
{"jruby"=>"/Users/stephen/dev/jruby_trunk/jruby/bin/gem"}]

   find_all_gem_commands('rails')
   => [{"ruby"=>"/usr/bin/rails"}, 
{"jruby"=>"/Users/stephen/dev/jruby_trunk/jruby/bin/rails"}]

Windows:

   find_all_gem_commands
   => [{"ruby.exe"=>"D:\\re\\ruby\\bin/gem"}, 
{"ruby.exe"=>"D:\\cygwin\\bin/gem"}, 
{"jruby"=>"D:\\work\\jruby-dev\\jruby\\bin/gem"}]



More information about the Rubygems-developers mailing list