james_b
4/21/2005 6:52:00 PM
Chad Fowler wrote:
> On 4/21/05, Lionel Thiry <lthiryidontwantspam@skynetnospam.be> wrote:
>
>>Hello!
>>
>
>
> Hi!
>
>
>>I'd like to know if there is any gentle way to uninstall all gems excepted the
>>latest versions and their depencency.
>>
>>Thanks in advance
>>
>
>
> $ gem cleanup
>
> You'll need a fairly recent version of RubyGems. This was added
> within the past couple of months.
>
Ah. Nice. SO I go and try it out, and mistype the command.
Yet it runs:
c:\>gem cl;eanup
Cleaning up installed gems...
Clean Up Complete
I see that one can abbreviate this, and I guess the trailing characters
were enough to stop it from actually running, because I then tried this:
c:\>gem cl
Cleaning up installed gems...
Attempting uninstall on rails-0.11.1
Attempting to uninstall gem 'rails'
Successfully uninstalled rails version 0.11.1
Attempting uninstall on mechanize-0.1.0
Attempting to uninstall gem 'mechanize'
Successfully uninstalled mechanize version 0.1.0
Attempting uninstall on nitro-0.14.0
Attempting to uninstall gem 'nitro'
Successfully uninstalled nitro version 0.14.0
Attempting uninstall on madeleine-0.6.1
Attempting to uninstall gem 'madeleine'
Successfully uninstalled madeleine version 0.6.1
Attempting uninstall on htmltools-1.0.8
Attempting to uninstall gem 'htmltools'
...
Wondering if 'cl' was a formal abbreviation for 'cleanup', I ran
C:\Temp>gem help cl
Usage: gem cleanup [options]
Options:
-d, --dryrun
...
But this works, too:
C:\Temp>gem help cle
Usage: gem cleanup [options]
Options:
-d, --dryrun
...
Does this willingness to interpret partial commands pose a risk if the
command is destructive? It is unlikely I would accidentally type "gem
cleanup", but "gem cl" seems plausible.
Might it be better to require complete command names on destructive
operations?
James