Sha256: f391241bc9eff5c112313521e6c73f591484576a34aa77c20d759dfdced84124

Contents?: true

Size: 762 Bytes

Versions: 42

Compression:

Stored size: 762 Bytes

Contents

require 'kontena/plugin_manager/common'
require 'rubygems/commands/cleanup_command'

module Kontena
  module PluginManager
    class Cleaner
      include Common

      attr_reader :plugin_name

      def initialize(plugin_name)
        @plugin_name = plugin_name
      end

      def command
        @command ||= Gem::Commands::CleanupCommand.new
      end

      # Runs gem cleanup, removes remains from previous versions
      # @param plugin_name [String]
      def cleanup
        options = []
        options += ['-q', '--no-verbose'] unless Kontena.debug?
        command.handle_options options
        command.execute
        true
      rescue Gem::SystemExitException => e
        raise unless e.exit_code.zero?
        true
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 2 rubygems

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