Class: Byebug::QuitCommand
Overview
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match
Class Method Details
.description ⇒ Object
24
25
26
27
28
29
30
|
# File 'lib/byebug/commands/quit.rb', line 24
def description
%(q[uit]|exit [!|unconditionally] Exits from byebug.
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
20
21
22
|
# File 'lib/byebug/commands/quit.rb', line 20
def names
%w(quit exit)
end
|
Instance Method Details
#execute ⇒ Object
12
13
14
15
16
17
|
# File 'lib/byebug/commands/quit.rb', line 12
def execute
return unless @match[1] || confirm('Really quit? (y/n) ')
@state.interface.close
exit! end
|
#regexp ⇒ Object
8
9
10
|
# File 'lib/byebug/commands/quit.rb', line 8
def regexp
/^\s* (?:q(?:uit)?|exit) \s* (!|\s+unconditionally)? \s*$/x
end
|