Class: Byebug::ShowCommand
- Defined in:
- lib/byebug/commands/show.rb
Overview
Show byebug settings.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Command
commands, find, format_subcmd, format_subcmds, inherited, #initialize, #match
Methods included from StringFunctions
Methods included from FileFunctions
#get_line, #get_lines, #n_lines, #normalize
Methods included from ParseFunctions
#get_int, #parse_steps, #syntax_valid?
Constructor Details
This class inherits a constructor from Byebug::Command
Class Method Details
.description ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/byebug/commands/show.rb', line 29 def description prettify <<-EOD show <setting> <value> Generic command for showing byebug settings. You can change them with the "set" command. EOD end |
.help(subcmd = nil) ⇒ Object
38 39 40 |
# File 'lib/byebug/commands/show.rb', line 38 def help(subcmd = nil) Setting.help('show', subcmd) end |
.names ⇒ Object
25 26 27 |
# File 'lib/byebug/commands/show.rb', line 25 def names %w(show) end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/byebug/commands/show.rb', line 14 def execute key = @match[:setting] return puts(self.class.help) if key.nil? setting = Setting.find(key) return errmsg(pr('show.errors.unknown_setting', key: key)) unless setting puts Setting.settings[setting.to_sym] end |
#regexp ⇒ Object
10 11 12 |
# File 'lib/byebug/commands/show.rb', line 10 def regexp /^\s* show (?:\s+(?<setting>\w+))? \s*$/x end |