Class: Byebug::ShowCommand
Overview
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
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/byebug/commands/show.rb', line 27
def description
<<-EOD.gsub(/^ {8}/, '')
show <setting> <value>
Generic command for showing byebug settings. You can change them with
the "set" command.
EOD
end
|
.help(subcmds = []) ⇒ Object
38
39
40
|
# File 'lib/byebug/commands/show.rb', line 38
def help(subcmds = [])
Setting.help('show', subcmds.first)
end
|
.names ⇒ Object
23
24
25
|
# File 'lib/byebug/commands/show.rb', line 23
def names
%w(show)
end
|
Instance Method Details
#execute ⇒ Object
12
13
14
15
16
17
18
19
20
|
# File 'lib/byebug/commands/show.rb', line 12
def execute
key = @match[:setting]
return puts(self.class.help) if key.nil?
full_key = Setting.find(key)
return errmsg("Unknown setting :#{key}") unless full_key
puts Setting.settings[full_key.to_sym].to_s
end
|
#regexp ⇒ Object
8
9
10
|
# File 'lib/byebug/commands/show.rb', line 8
def regexp
/^\s* show (?:\s+(?<setting>\w+))? \s*$/x
end
|