Class: Kontena::PluginManager::Cleaner
- Inherits:
-
Object
- Object
- Kontena::PluginManager::Cleaner
- Includes:
- Common
- Defined in:
- lib/kontena/plugin_manager/cleaner.rb
Constant Summary
Constants included from Common
Kontena::PluginManager::Common::KRATES_PLUGIN
Instance Attribute Summary collapse
-
#plugin_name ⇒ Object
readonly
Returns the value of attribute plugin_name.
Instance Method Summary collapse
-
#cleanup ⇒ Object
Runs gem cleanup, removes remains from previous versions.
- #command ⇒ Object
-
#initialize(plugin_name) ⇒ Cleaner
constructor
A new instance of Cleaner.
Methods included from Common
dummy_ui, gem_versions, install_dir, installed, installed?, plugin_debug?, plugins, prefix, rubygems_client, search_plugins, use_dummy_ui
Constructor Details
#initialize(plugin_name) ⇒ Cleaner
Returns a new instance of Cleaner.
11 12 13 |
# File 'lib/kontena/plugin_manager/cleaner.rb', line 11 def initialize(plugin_name) @plugin_name = plugin_name end |
Instance Attribute Details
#plugin_name ⇒ Object (readonly)
Returns the value of attribute plugin_name.
9 10 11 |
# File 'lib/kontena/plugin_manager/cleaner.rb', line 9 def plugin_name @plugin_name end |
Instance Method Details
#cleanup ⇒ Object
Runs gem cleanup, removes remains from previous versions
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/kontena/plugin_manager/cleaner.rb', line 21 def cleanup = [] += ['-q', '--no-verbose'] unless Kontena.debug? command. command.execute true rescue Gem::SystemExitException => e raise unless e.exit_code.zero? true end |
#command ⇒ Object
15 16 17 |
# File 'lib/kontena/plugin_manager/cleaner.rb', line 15 def command @command ||= Gem::Commands::CleanupCommand.new end |