Module: Screeninator::Helper
- Included in:
- Cli, ConfigWriter
- Defined in:
- lib/screeninator/helper.rb
Constant Summary collapse
- HELP_TEXT =
help.join("\n")
Instance Method Summary collapse
Instance Method Details
#confirm!(msg) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/screeninator/helper.rb', line 21 def confirm!(msg) puts msg if %w(yes Yes YES y).include?(STDIN.gets.chop) yield else exit! "Aborting." end end |
#exit!(msg) ⇒ Object
16 17 18 19 |
# File 'lib/screeninator/helper.rb', line 16 def exit!(msg) puts msg Kernel.exit(1) end |