Method: Kennel::Console.ask?

Defined in:
lib/kennel/console.rb

.ask?(question) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
21
22
23
24
25
26
# File 'lib/kennel/console.rb', line 18

def ask?(question)
  Kennel.err.printf color(:red, "#{question} -  press 'y' to continue: ", force: true)
  begin
    STDIN.gets.chomp == "y"
  rescue Interrupt # do not show a backtrace if user decides to Ctrl+C here
    Kennel.err.print "\n"
    exit 1
  end
end