Class: Gem::UninstallCommand
- Includes:
- CommandAids, VersionOption
- Defined in:
- lib/rubygems/gem_commands.rb
Instance Attribute Summary
Attributes inherited from Command
#command, #defaults, #options, #program_name, #summary
Instance Method Summary collapse
- #arguments ⇒ Object
- #defaults_str ⇒ Object
- #execute ⇒ Object
-
#initialize ⇒ UninstallCommand
constructor
A new instance of UninstallCommand.
- #usage ⇒ Object
Methods included from CommandAids
#begins?, #get_all_gem_names, #get_one_gem_name, #get_one_optional_argument
Methods included from VersionOption
Methods inherited from Command
add_common_option, #add_option, add_specific_extra_args, common_options, extra_args, extra_args=, #handles?, #invoke, #merge_options, #remove_option, #show_help, specific_extra_args, specific_extra_args_hash, #when_invoked
Methods included from DefaultUserInteraction
#ui, ui, #ui=, ui=, #use_ui, use_ui
Constructor Details
#initialize ⇒ UninstallCommand
Returns a new instance of UninstallCommand.
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 |
# File 'lib/rubygems/gem_commands.rb', line 419 def initialize super('uninstall', 'Uninstall gems from the local repository', { :version => "> 0" }) add_option('-a', '--[no-]all', 'Uninstall all matching versions' ) do |value, | [:all] = value end add_option('-i', '--[no-]ignore-dependencies', 'Ignore dependency requirements while', 'uninstalling') do |value, | [:ignore] = value end add_option('-x', '--[no-]executables', 'Uninstall applicable executables without', 'confirmation') do |value, | [:executables] = value end add_version_option('uninstall') end |
Instance Method Details
#arguments ⇒ Object
452 453 454 |
# File 'lib/rubygems/gem_commands.rb', line 452 def arguments "GEMNAME name of gem to uninstall" end |
#defaults_str ⇒ Object
444 445 446 |
# File 'lib/rubygems/gem_commands.rb', line 444 def defaults_str "--version '> 0' --no-force" end |
#execute ⇒ Object
456 457 458 459 460 |
# File 'lib/rubygems/gem_commands.rb', line 456 def execute get_all_gem_names.each do |gem_name| Gem::Uninstaller.new(gem_name, ).uninstall end end |
#usage ⇒ Object
448 449 450 |
# File 'lib/rubygems/gem_commands.rb', line 448 def usage "#{program_name} GEMNAME [GEMNAME ...]" end |