Class: Byebug::QuitCommand
Overview
Instance Attribute Summary
Attributes inherited from Command
#processor
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
#arguments, columnize, #context, #frame, help, #initialize, match, to_s
#camelize, #prettify
Class Method Details
.description ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/byebug/commands/quit.rb', line 15
def self.description
<<-EOD
q[uit] [!|unconditionally]
#{short_description}
Normally we prompt before exiting. However if the parameter
"unconditionally" is given or command is suffixed with !, we exit
without asking further questions.
EOD
end
|
.regexp ⇒ Object
11
12
13
|
# File 'lib/byebug/commands/quit.rb', line 11
def self.regexp
/^\s* q(?:uit)? \s* (?:(!|\s+unconditionally))? \s*$/x
end
|
.short_description ⇒ Object
27
28
29
|
# File 'lib/byebug/commands/quit.rb', line 27
def self.short_description
'Exits byebug'
end
|
Instance Method Details
#execute ⇒ Object
31
32
33
34
35
36
37
38
|
# File 'lib/byebug/commands/quit.rb', line 31
def execute
return unless @match[1] || confirm(pr('quit.confirmations.really'))
processor.interface.autosave
processor.interface.close
Process.exit!
end
|