Class: Byebug::QuitCommand
- Defined in:
- lib/byebug/commands/quit.rb
Overview
Exit from byebug.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Command
commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, #match
Methods included from StringFunctions
Methods included from FileFunctions
#get_line, #get_lines, #n_lines, #normalize
Methods included from ParseFunctions
#get_int, #parse_steps, #syntax_valid?
Constructor Details
This class inherits a constructor from Byebug::Command
Class Method Details
.description ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/byebug/commands/quit.rb', line 27 def description prettify " q[uit] [!|unconditionally] Exits from byebug.\n\n Normally we prompt before exiting. However if the parameter\n \"unconditionally\" is given or command is suffixed with !, we exit\n without asking further questions.\n EOD\nend\n" |
.names ⇒ Object
23 24 25 |
# File 'lib/byebug/commands/quit.rb', line 23 def names %w(quit) end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/byebug/commands/quit.rb', line 14 def execute return unless @match[1] || confirm(pr('quit.confirmations.really')) @state.interface.autosave @state.interface.close exit! # exit -> exit!: No graceful way to stop... end |
#regexp ⇒ Object
10 11 12 |
# File 'lib/byebug/commands/quit.rb', line 10 def regexp /^\s* q(?:uit)? \s* (?:(!|\s+unconditionally))? \s*$/x end |