Class: Byebug::AddDisplayCommand
- Inherits:
-
Command
- Object
- Command
- Byebug::AddDisplayCommand
show all
- Defined in:
- lib/byebug/commands/display.rb
Overview
Implements the functionality of adding custom expressions to be displayed every time the debugger stops.
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match
Class Method Details
.description ⇒ Object
45
46
47
48
49
|
# File 'lib/byebug/commands/display.rb', line 45
def description
%(disp[lay] <expression>
Add <expression> into display expression list.)
end
|
.names ⇒ Object
41
42
43
|
# File 'lib/byebug/commands/display.rb', line 41
def names
%w(display)
end
|
Instance Method Details
#execute ⇒ Object
34
35
36
37
38
|
# File 'lib/byebug/commands/display.rb', line 34
def execute
exp = @match[1]
@state.display.push [true, exp]
puts "#{@state.display.size}: #{display_expression(exp)}"
end
|
#regexp ⇒ Object
30
31
32
|
# File 'lib/byebug/commands/display.rb', line 30
def regexp
/^\s* disp(?:lay)? \s+ (.+) \s*$/x
end
|