[Rubygems-developers] query_command.rb question and patch

Jos Backus jos at catnook.com
Fri Apr 4 00:23:34 EDT 2008


Puppet (http://reductivelabs.com/trac/puppet) uses the `gem list' command as
part of its gem package provider. I'm thinking about fixing the provider to
use the RubyGems API instead of the command line tool as the command line tool
produces output that isn't strictly related to the local or remote gem list,
and incurs extra output parsing.

E.g for the local gem list case query_command.rb uses
Gem.source_index.search(name) to get a list of local gems. When calling it I
still see output related to updating the gem index. I'd like to avoid this
extra output; is that possible?

Also: the attached patch against 1.1.0 refactors output_query_results into two
methods, one that produces the list of gems with their versions and another
that outputs this list in the same format output_query_results does today.
This makes it easier to programmatically access the list of local and remote

In case I'm reinventing the wheel, please tell me so.

Jos Backus
jos at catnook.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: query_command.rb.diff
Type: text/x-diff
Size: 1499 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/rubygems-developers/attachments/20080403/693d929b/attachment.bin 

More information about the Rubygems-developers mailing list