class Dramaturg::CtrlCHandler::SkipOrExit

Public Class Methods

call(prompter, cmd) click to toggle source
# File lib/dramaturg/ctrl_c_handler/skip_or_exit.rb, line 4
def self.call(prompter, cmd)
  puts "\n^C again to exit; Any other key to skip '#{cmd.name}'"

  require 'mad_clibs/util/iohelper'
  key = IOHelper.read_key(false)

  if key == 'ctrl-c'
    puts "Okay, bye!"
    exit!
  else
    prompter.abort!
  end
end