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-2.3.19 lib/jets/commands/clean/base.rb
jets-2.3.18 lib/jets/commands/clean/base.rb
jets-2.3.17 lib/jets/commands/clean/base.rb
jets-2.3.16 lib/jets/commands/clean/base.rb
jets-2.3.15 lib/jets/commands/clean/base.rb
jets-2.3.14 lib/jets/commands/clean/base.rb
jets-2.3.13 lib/jets/commands/clean/base.rb
jets-2.3.12 lib/jets/commands/clean/base.rb
jets-2.3.11 lib/jets/commands/clean/base.rb
jets-2.3.10 lib/jets/commands/clean/base.rb
jets-2.3.9 lib/jets/commands/clean/base.rb
jets-2.3.8 lib/jets/commands/clean/base.rb
jets-2.3.7 lib/jets/commands/clean/base.rb
jets-2.3.6 lib/jets/commands/clean/base.rb
jets-2.3.5 lib/jets/commands/clean/base.rb
jets-2.3.4 lib/jets/commands/clean/base.rb
jets-2.3.3 lib/jets/commands/clean/base.rb
jets-2.3.2 lib/jets/commands/clean/base.rb
jets-2.3.1 lib/jets/commands/clean/base.rb
jets-2.3.0 lib/jets/commands/clean/base.rb