Sha256: d2e66acef0e367fce06c6354295b06af20e6d1f48631adb8fd7ddac705bdadb6

Contents?: true

Size: 573 Bytes

Versions: 1

Compression:

Stored size: 573 Bytes

Contents

module Percheron
  module Commands
    class Purge < Abstract

      default_parameters!
      option('--yes', :flag, 'Yes, purge image / unit', default: false)
      option('--force', :flag, 'Force image / unit removal', default: false)

      def execute
        super
        runit { stack.purge!(unit_names: unit_names, force: force?) if yes? || confirm? }
      end

      private

        def confirm?
          ask('Are you sure you want to purge? (y|n) ') do |q|
            q.validate = /y(es)?|n(o)?/i
          end.match(/y(es)?/i)
        end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
percheron-0.8.1 lib/percheron/commands/purge.rb