[Rubygems-developers] New patch for 'gem contents' bug

Tom Pollard tomp at earthlink.net
Sat Dec 9 00:01:02 EST 2006


I've attached a patch file (a context diff) for gem_commands.rb,
made against the current source file in svn.  The changes are all
in the ContentsCommand class.  This fixes three bugs:

1) 'gem contents' wouldn't work unless you explicitly specified a
    specification directory,
2) the '--version' option didn't work at all, because the version
    number you specified was treated as a gem name, and
3) when multiple versions of a gem were installed, the earliest was
    selected by default, rather than the most current. (Now the most
    recent is selected.)

The fixes for (2) and (3) were each a one-word change on a single line.
The code for the ContentsCommand#execute function could also be
simplified a little, because there's always a list of specification
directories now.

My guess is that the '--version' bug arose because someone didn't want
to use the VersionOption mixin in this class.  I think that's probably
because the descriptive text used in the option definition in  
("Specify version of gem to #{taskname}") assumes the command name is a
transitive verb, like 'install', or 'list'.  If the string were changed
to something like "Specify version of gem for #{taskname}"), it might be
appropriate for a command like 'contents', too, even if it doesn't sound
as good for 'install'.  Maybe you could simplify it further, to just
"Specify version of gem"?  In an any case, it would be nice if the
VersionOption mixin could be used here.



On Dec 8, 2006, at 2:04 PM, Eric Hodel wrote:
>> I don't see any way to upload a new patch file to an existing
>> case in rubyforge.  What's the right thing to do here?
> If you can't submit it to rubyforge, post it here.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gem_commands.rb.patch
Type: application/octet-stream
Size: 1915 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/rubygems-developers/attachments/20061209/7cc31f5f/attachment.obj 
-------------- next part --------------

More information about the Rubygems-developers mailing list