Sha256: af576097c716a8c6d465ac61ee2ff48599351d133031e39919c205ad6fdcb692

Contents?: true

Size: 506 Bytes

Versions: 47

Compression:

Stored size: 506 Bytes

Contents

class 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

47 entries across 47 versions & 2 rubygems

Version Path
jets-4.0.12 lib/jets/commands/clean/base.rb
jets-4.0.11 lib/jets/commands/clean/base.rb
jets-4.0.10 lib/jets/commands/clean/base.rb
jets-4.0.9 lib/jets/commands/clean/base.rb
jets-4.0.8 lib/jets/commands/clean/base.rb
jets-4.0.7 lib/jets/commands/clean/base.rb
jets-4.0.6 lib/jets/commands/clean/base.rb
jets-4.0.5 lib/jets/commands/clean/base.rb
jets-4.0.4 lib/jets/commands/clean/base.rb
jets-4.0.3 lib/jets/commands/clean/base.rb
jets-4.0.2 lib/jets/commands/clean/base.rb
jets-4.0.1 lib/jets/commands/clean/base.rb
jets-4.0.0 lib/jets/commands/clean/base.rb
jets-3.2.2 lib/jets/commands/clean/base.rb
jets-3.2.1 lib/jets/commands/clean/base.rb
jets.benforeva-3.0.17.pre.mount.pre.fix lib/jets/commands/clean/base.rb
jets-3.2.0 lib/jets/commands/clean/base.rb
jets-3.1.5 lib/jets/commands/clean/base.rb
jets-3.1.4 lib/jets/commands/clean/base.rb
jets-3.1.3 lib/jets/commands/clean/base.rb