[Rubygems-developers] Suggestions regarding new CLI

Chad Fowler chad at chadfowler.com
Fri Jun 25 13:10:09 EDT 2004

On 25/6/2004, at 8:24 AM, Jim Weirich wrote:

> Jim Weirich wrote:
>> Its hard to say.  If you run all the tests individually, they will 
>> all pass.  Its only when two of the tests are run together in the 
>> same session do you get the failing test.  That implies some 
>> interaction between the tests, which is not good.  My feeling was 
>> that it has something to do with the singleton nature of the 
>> CommandManager, which is why I would like to break the class into 
>> something a bit smaller and work with it.  Perhaps I should focus on 
>> the singleton aspect first.
> A very productive evening.  The failing unit test was caused by 
> interference between two tests working on the singleton instance of 
> the command manager.
> I changed the command manager to install all the commands into every 
> instance, not just the one referenced by the instance command.  That 
> allowed the tests to be written using CommandManager.new (rather than 
> CommandManager.instance).  No more interference and all the tests are 
> passing again.
> After that I really went to town and cleaned up the CommandManager.  
> The  gem commands are now all together in a separate file 
> (gem_commands.rb).  Its easy to add new commands.  I added the 
> rubygems-info command back into the mix.  Added a version command.  
> And added "list" as an alias for "query".
> Commands may now be abbreviated (as long as they are unique).
>    gem i    --> gem install
>    gem u    --> error: ambiguous command (uninstall, update)
> Gem install now takes the gem name as an argument instead of an 
> option.  E.g.
>    gem install rake
> rather than
>    gem install --name rake
> Oh, and "gem2" is gone.  I promoted it to be the standard "gem" script 
> now.  Let me know if anyone has problems.
> Still to do:
> * Do the argument thing on other commands.
> * Clean up the help messages.

Man, you're moving so fast (and well!) that I can't keep up with my 
infrequent net access!  I may just resign myself to watch things get 
better for the next week while we finish our vacation. :)  This stuff 
is fantastic.


More information about the Rubygems-developers mailing list