Class: Byebug::QuitCommand
Overview
Implements byebug “quit” command
Constant Summary
Constants inherited
from Command
Command::DEF_OPTIONS
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
commands, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match, method_missing, options, register_setting_get, register_setting_set, register_setting_var, settings, settings_map
Class Method Details
.description ⇒ Object
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/byebug/commands/quit.rb', line 27
def description
%{
q[uit][ !| unconditionally]\texit from byebug.
exit[!]\talias to quit
Normally we prompt before exiting. However if the parameter
"unconditionally" is given or command is suffixed with !, we exit
without asking further questions.
}
end
|
.names ⇒ Object
23
24
25
|
# File 'lib/byebug/commands/quit.rb', line 23
def names
%w(quit exit)
end
|
Instance Method Details
#execute ⇒ Object
15
16
17
18
19
20
|
# File 'lib/byebug/commands/quit.rb', line 15
def execute
if @match[1] or confirm("Really quit? (y/n) ")
@state.interface.finalize
exit! end
end
|
#regexp ⇒ Object
7
8
9
10
11
12
13
|
# File 'lib/byebug/commands/quit.rb', line 7
def regexp
/ ^\s*
(?:q(?:uit)?|exit) \s*
(!|\s+unconditionally)? \s*
$
/ix
end
|