Sha256: 25712d974d0768d368ce94d0399f39f98e9a339c693e2c12b39d19e72cefcf4a

Contents?: true

Size: 555 Bytes

Versions: 1

Compression:

Stored size: 555 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? (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.0 lib/percheron/commands/purge.rb