Method: Kennel::Utils.ask

Defined in:
lib/kennel/utils.rb

.ask(question) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/kennel/utils.rb', line 16

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