Class: Byebug::DisplayCommand
- Includes:
- Helpers::EvalHelper
- Defined in:
- lib/byebug/commands/display.rb
Overview
Custom expressions to be displayed every time the debugger stops.
Instance Attribute Summary
Attributes inherited from Command
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Helpers::EvalHelper
#error_eval, #multiple_thread_eval, #separate_thread_eval, #silent_eval, #warning_eval
Methods inherited from Command
#arguments, columnize, #context, #frame, help, #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
.description ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/byebug/commands/display.rb', line 20 def self.description " disp[lay][ <expression>]\n\n \#{short_description}\n\n If <expression> specified, adds <expression> into display expression\n list. Otherwise, it lists all expressions.\n DESCRIPTION\nend\n" |
.regexp ⇒ Object
16 17 18 |
# File 'lib/byebug/commands/display.rb', line 16 def self.regexp /^\s* disp(?:lay)? (?:\s+ (.+))? \s*$/x end |
.short_description ⇒ Object
31 32 33 |
# File 'lib/byebug/commands/display.rb', line 31 def self.short_description "Evaluates expressions every time the debugger stops" end |
Instance Method Details
#execute ⇒ Object
35 36 37 38 39 40 |
# File 'lib/byebug/commands/display.rb', line 35 def execute return print_display_expressions unless @match && @match[1] Byebug.displays.push [true, @match[1]] display_expression(@match[1]) end |