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-3.0.6 lib/jets/commands/clean/base.rb
jets-3.0.5 lib/jets/commands/clean/base.rb
jets-3.0.4 lib/jets/commands/clean/base.rb
jets-3.0.3 lib/jets/commands/clean/base.rb
jets-3.0.2 lib/jets/commands/clean/base.rb
jets-3.0.1 lib/jets/commands/clean/base.rb
jets-3.0.0 lib/jets/commands/clean/base.rb