Class: Byebug::ShowCommand
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
commands, find, format_subcmd, format_subcmds, inherited, #initialize, load_commands, #match
Class Method Details
.description ⇒ Object
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/byebug/commands/show.rb', line 26
def description
<<-EOD.gsub(/^ /, '')
show <setting> <value>
Generic command for showing byebug settings. You can change them with
the "set" command.
EOD
end
|
.help(setting = nil) ⇒ Object
37
38
39
40
41
|
# File 'lib/byebug/commands/show.rb', line 37
def help(setting = nil)
return "show #{setting.to_sym} <value>\n\n#{setting.help}" if setting
description + Setting.format()
end
|
.names ⇒ Object
22
23
24
|
# File 'lib/byebug/commands/show.rb', line 22
def names
%w(show)
end
|
Instance Method Details
#execute ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/byebug/commands/show.rb', line 9
def execute
key = @match[:setting]
return print ShowCommand.help if key.nil?
full_key = Setting.find(key)
if full_key
print Setting.settings[full_key.to_sym].to_s
else
print "Unknown setting :#{key}\n"
end
end
|
#regexp ⇒ Object
5
6
7
|
# File 'lib/byebug/commands/show.rb', line 5
def regexp
/^\s* show (?:\s+(?<setting>\w+))? \s*$/x
end
|