Sha256: cb4d7949c9b3e74ffea766962f8a14f3cfb0fded482e7191815fbc76c2cdd414

Contents?: true

Size: 721 Bytes

Versions: 53

Compression:

Stored size: 721 Bytes

Contents

require 'rubygems/uninstaller'

module Kontena
  module PluginManager
    class Uninstaller
      include PluginManager::Common

      attr_reader :plugin_name

      def initialize(plugin_name)
        @plugin_name = plugin_name
      end

      def command(spec)
        @command ||= Gem::Uninstaller.new(
          spec.name,
          all: true,
          executables: true,
          force: true,
          install_dir: spec.base_dir
        )
      end

      # Uninstall a plugin
      # @param plugin_name [String]
      def uninstall
        installed = installed(plugin_name)
        raise "Plugin #{plugin_name} not installed" unless installed

        command(installed).uninstall
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 2 rubygems

Version Path
krates-1.7.11 lib/kontena/plugin_manager/uninstaller.rb
krates-1.7.10 lib/kontena/plugin_manager/uninstaller.rb
krates-1.7.9 lib/kontena/plugin_manager/uninstaller.rb
krates-1.7.8 lib/kontena/plugin_manager/uninstaller.rb
krates-1.7.7 lib/kontena/plugin_manager/uninstaller.rb
krates-1.7.6 lib/kontena/plugin_manager/uninstaller.rb
krates-1.7.5 lib/kontena/plugin_manager/uninstaller.rb
krates-1.7.4 lib/kontena/plugin_manager/uninstaller.rb
krates-1.7.3 lib/kontena/plugin_manager/uninstaller.rb
krates-1.7.2 lib/kontena/plugin_manager/uninstaller.rb
krates-1.7.1 lib/kontena/plugin_manager/uninstaller.rb
krates-1.7.0 lib/kontena/plugin_manager/uninstaller.rb
krates-1.6.9 lib/kontena/plugin_manager/uninstaller.rb
krates-1.6.8 lib/kontena/plugin_manager/uninstaller.rb
krates-1.6.7 lib/kontena/plugin_manager/uninstaller.rb
krates-1.6.6 lib/kontena/plugin_manager/uninstaller.rb
krates-1.6.5 lib/kontena/plugin_manager/uninstaller.rb
krates-1.6.4 lib/kontena/plugin_manager/uninstaller.rb
krates-1.6.3 lib/kontena/plugin_manager/uninstaller.rb
krates-1.6.2 lib/kontena/plugin_manager/uninstaller.rb