Sha256: facc94f0bc882c0a7ee6d8ce45d398688d510e7f67d84968a3eb9b0c264b4b91

Contents?: true

Size: 507 Bytes

Versions: 15

Compression:

Stored size: 507 Bytes

Contents

module Jets::Commands::Clean
  class Base
    def initialize(options={})
      @options = options
    end

  private
    def say(message)
      prefix = 'NOOP ' if @options[:noop]
      puts "#{prefix}#{message}" unless @options[:mute]
    end

    def are_you_sure?(message)
      return true if @options[:yes]

      puts "Are you sure that you want to #{message}? (y/N)"
      yes = $stdin.gets.strip
      unless yes =~ /^y/
        puts "Phew that was close!"
        exit 0
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
jets-5.0.13 lib/jets/commands/clean/base.rb
jets-5.0.12 lib/jets/commands/clean/base.rb
jets-5.0.11 lib/jets/commands/clean/base.rb
jets-5.0.10 lib/jets/commands/clean/base.rb
jets-5.0.9 lib/jets/commands/clean/base.rb
jets-5.0.8 lib/jets/commands/clean/base.rb
jets-5.0.7 lib/jets/commands/clean/base.rb
jets-5.0.6 lib/jets/commands/clean/base.rb
jets-5.0.5 lib/jets/commands/clean/base.rb
jets-5.0.4 lib/jets/commands/clean/base.rb
jets-5.0.3 lib/jets/commands/clean/base.rb
jets-5.0.2 lib/jets/commands/clean/base.rb
jets-5.0.1 lib/jets/commands/clean/base.rb
jets-5.0.0 lib/jets/commands/clean/base.rb
jets-5.0.0.beta1 lib/jets/commands/clean/base.rb