Class: Byebug::ShowCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/byebug/commands/show.rb

Overview

Show byebug settings.

Instance Attribute Summary

Attributes inherited from Command

#processor

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

#arguments, columnize, #context, #frame, #initialize, match, to_s

Methods included from Helpers::StringHelper

#camelize, #deindent, #prettify

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



17
18
19
20
21
22
23
24
25
# File 'lib/byebug/commands/show.rb', line 17

def self.description
  <<-DESCRIPTION
    show <setting> <value>

    #{short_description}

    You can change them with the "set" command.
  DESCRIPTION
end

.helpObject



31
32
33
# File 'lib/byebug/commands/show.rb', line 31

def self.help
  super + Setting.help_all
end

.regexpObject



13
14
15
# File 'lib/byebug/commands/show.rb', line 13

def self.regexp
  /^\s* show (?:\s+(?<setting>\w+))? \s*$/x
end

.short_descriptionObject



27
28
29
# File 'lib/byebug/commands/show.rb', line 27

def self.short_description
  "Shows byebug settings"
end

Instance Method Details

#executeObject



35
36
37
38
39
40
41
42
43
# File 'lib/byebug/commands/show.rb', line 35

def execute
  key = @match[:setting]
  return puts(help) unless key

  setting = Setting.find(key)
  return errmsg(pr("show.errors.unknown_setting", key: key)) unless setting

  puts Setting.settings[setting.to_sym]
end