Sha256: 6e38d2b67a29739331de5b5c98e6905cad4af7880b70e99057f019c68dcaacf5

Contents?: true

Size: 421 Bytes

Versions: 9

Compression:

Stored size: 421 Bytes

Contents

module TerraspaceBundler::Util
  module Sure
    def sure?(message="Are you sure?", desc=nil)
      if @options[:yes]
        sure = 'y'
      else
        out = if desc
          "\n#{desc}\n#{message} (y/N) "
        else
          "#{message} (y/N) "
        end
        print out
        sure = $stdin.gets
      end

      unless sure =~ /^y/
        puts "Whew! Exiting."
        exit 0
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
terraspace-bundler-0.5.0 lib/terraspace_bundler/util/sure.rb
terraspace-bundler-0.4.4 lib/terraspace_bundler/util/sure.rb
terraspace-bundler-0.4.3 lib/terraspace_bundler/util/sure.rb
terraspace-bundler-0.4.2 lib/terraspace_bundler/util/sure.rb
terraspace-bundler-0.4.1 lib/terraspace_bundler/util/sure.rb
terraspace-bundler-0.4.0 lib/terraspace_bundler/util/sure.rb
terraspace-bundler-0.3.4 lib/terraspace_bundler/util/sure.rb
terraspace-bundler-0.3.3 lib/terraspace_bundler/util/sure.rb
terraspace-bundler-0.3.2 lib/terraspace_bundler/util/sure.rb