Class: Dramaturg::CtrlCHandler::SkipOrExit
- Inherits:
-
Object
- Object
- Dramaturg::CtrlCHandler::SkipOrExit
- Defined in:
- lib/dramaturg/ctrl_c_handler/skip_or_exit.rb
Class Method Summary collapse
Class Method Details
.call(prompter, cmd) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# 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 |