Class: Gem::Commands::PruneCommand
- Inherits:
-
Gem::Command
- Object
- Gem::Command
- Gem::Commands::PruneCommand
- Includes:
- Prune::Util
- Defined in:
- lib/gem/commands/prune_command.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize ⇒ PruneCommand
constructor
A new instance of PruneCommand.
Methods included from Prune::Util
#gems_to_keep, #load_configuration, #save_configuration, #settings_filename
Constructor Details
#initialize ⇒ PruneCommand
Returns a new instance of PruneCommand.
12 13 14 |
# File 'lib/gem/commands/prune_command.rb', line 12 def initialize super 'prune', 'Identify and remove old gems' end |
Instance Method Details
#execute ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/gem/commands/prune_command.rb', line 16 def execute load_configuration mark_kept_versions versions_to_prune.each do |version| ui = Gem::Uninstaller.new(version.name, :version => version.version, :ignore => true, :executables => true) ui.uninstall end save_configuration end |