Sha256: 59b571ea3f40aed89b03252d705d77883f4d8093ce7285ead12cfe395a330c33

Contents?: true

Size: 507 Bytes

Versions: 191

Compression:

Stored size: 507 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[:sure]

      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

191 entries across 191 versions & 3 rubygems

Version Path
jets-1.9.13 lib/jets/commands/clean/base.rb
jets-1.9.12 lib/jets/commands/clean/base.rb
jets-1.9.11 lib/jets/commands/clean/base.rb
jets-1.9.10 lib/jets/commands/clean/base.rb
jets-1.9.9 lib/jets/commands/clean/base.rb
jets-1.9.8 lib/jets/commands/clean/base.rb
jets-1.9.7 lib/jets/commands/clean/base.rb
jets-1.9.6 lib/jets/commands/clean/base.rb
jets-1.9.5 lib/jets/commands/clean/base.rb
jets-1.9.4 lib/jets/commands/clean/base.rb
jets-1.9.3 lib/jets/commands/clean/base.rb
jets-1.9.2 lib/jets/commands/clean/base.rb
jets-1.9.1 lib/jets/commands/clean/base.rb
jets-1.9.0 lib/jets/commands/clean/base.rb
jets-1.8.14 lib/jets/commands/clean/base.rb
jets-1.8.13 lib/jets/commands/clean/base.rb
jets-1.8.12 lib/jets/commands/clean/base.rb
jets-1.8.11 lib/jets/commands/clean/base.rb
jets-1.8.10 lib/jets/commands/clean/base.rb
jets-1.8.9 lib/jets/commands/clean/base.rb