Class: EmptyCommand
- Inherits:
-
Gem::Command
- Object
- Gem::Command
- EmptyCommand
- Defined in:
- lib/gem-empty/command.rb
Instance Method Summary collapse
-
#arguments ⇒ Object
:nodoc:.
-
#defaults_str ⇒ Object
:nodoc:.
-
#description ⇒ Object
:nodoc:.
- #execute(options = {}) ⇒ Object
-
#initialize ⇒ EmptyCommand
constructor
A new instance of EmptyCommand.
-
#usage ⇒ Object
:nodoc:.
Constructor Details
#initialize ⇒ EmptyCommand
Returns a new instance of EmptyCommand.
7 8 9 |
# File 'lib/gem-empty/command.rb', line 7 def initialize super 'empty', 'Remove all gems from current GEM_HOME.' end |
Instance Method Details
#arguments ⇒ Object
:nodoc:
11 12 13 |
# File 'lib/gem-empty/command.rb', line 11 def arguments # :nodoc: "empty remove all gems from current GEM_HOME." end |
#defaults_str ⇒ Object
:nodoc:
19 20 21 |
# File 'lib/gem-empty/command.rb', line 19 def defaults_str # :nodoc: "" end |
#description ⇒ Object
:nodoc:
23 24 25 26 27 |
# File 'lib/gem-empty/command.rb', line 23 def description # :nodoc: <<-DOC Remove all gems from current 'GEM_HOME'. DOC end |
#execute(options = {}) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/gem-empty/command.rb', line 29 def execute( = {}) = {:force => true, :executables => true }.merge() uninstaller = Gem::Uninstaller.new(nil, ) uninstaller.remove_all(gem_dir_specs) rescue Gem::DependencyRemovalException, Gem::InstallError, Gem::GemNotInHomeException, Gem::FilePermissionError => e alert_error "#{e.class}: #{e.}" end |
#usage ⇒ Object
:nodoc:
15 16 17 |
# File 'lib/gem-empty/command.rb', line 15 def usage # :nodoc: "#{program_name}" end |