Class: Kontena::PluginManager::Uninstaller
- Inherits:
-
Object
- Object
- Kontena::PluginManager::Uninstaller
- Includes:
- Common
- Defined in:
- lib/kontena/plugin_manager/uninstaller.rb
Constant Summary
Constants included from Common
Instance Attribute Summary collapse
-
#plugin_name ⇒ Object
readonly
Returns the value of attribute plugin_name.
Instance Method Summary collapse
- #command(spec) ⇒ Object
-
#initialize(plugin_name) ⇒ Uninstaller
constructor
A new instance of Uninstaller.
-
#uninstall ⇒ Object
Uninstall a plugin.
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) ⇒ Uninstaller
Returns a new instance of Uninstaller.
10 11 12 |
# File 'lib/kontena/plugin_manager/uninstaller.rb', line 10 def initialize(plugin_name) @plugin_name = plugin_name end |
Instance Attribute Details
#plugin_name ⇒ Object (readonly)
Returns the value of attribute plugin_name.
8 9 10 |
# File 'lib/kontena/plugin_manager/uninstaller.rb', line 8 def plugin_name @plugin_name end |
Instance Method Details
#command(spec) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/kontena/plugin_manager/uninstaller.rb', line 14 def command(spec) @command ||= Gem::Uninstaller.new( spec.name, all: true, executables: true, force: true, install_dir: spec.base_dir ) end |
#uninstall ⇒ Object
Uninstall a plugin
26 27 28 29 30 31 |
# File 'lib/kontena/plugin_manager/uninstaller.rb', line 26 def uninstall installed = installed(plugin_name) raise "Plugin #{plugin_name} not installed" unless installed command(installed).uninstall end |