[Rubygems-developers] [PATCH] Two changes to the gem list command

Bjørn Arild Mæland bjorn.maeland at gmail.com
Fri Aug 1 17:00:06 EDT 2008


I've made a couple of very small patches that deals with the list command.

The first patch [1] causes the list command to exit 1 if "gem list
<pattern>" has no results. This should be transparent to most users, but
useful for i.e shell scripts. It also saves a couple of cycles since it
exits early from the output_query_result method if spec_tuples is empty.

The second patch [2] changes the behaviour of the --installed switch.
Before, the argument was treated like a pattern, so "gem list -i r" returns
true if you have the rails gem installed, but no gem named just "r". My
change causes this command to only check for exact matches. The rationale is
that since the output is just true/false, one could be fooled into believing
that a gem was installed. This is especially true for automated tasks, like
shell scripts. Some people _might_ depend on this behaviour (I can't really
imagine why, though), thats why I put it in a seperate patch.


Bjørn Arild Mæland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rubygems-developers/attachments/20080801/fec002c5/attachment.html>

More information about the Rubygems-developers mailing list