Class: Byebug::PPCommand
Constant Summary
Constants inherited
from Command
Command::DEF_OPTIONS
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
command_exists?, commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match, method_missing, options, register_setting_get, register_setting_set, register_setting_var, settings, settings_map, terminal_width
Class Method Details
.description ⇒ Object
93
94
95
|
# File 'lib/byebug/commands/eval.rb', line 93
def description
%{pp expression\tevaluate expression and pretty-print its value}
end
|
.names ⇒ Object
89
90
91
|
# File 'lib/byebug/commands/eval.rb', line 89
def names
%w(pp)
end
|
Instance Method Details
#execute ⇒ Object
78
79
80
81
82
83
84
85
86
|
# File 'lib/byebug/commands/eval.rb', line 78
def execute
out = StringIO.new
run_with_binding do |b|
PP.pp(debug_eval(@match.post_match, b), out)
end
print out.string
rescue
out.puts $!.message
end
|
#regexp ⇒ Object
74
75
76
|
# File 'lib/byebug/commands/eval.rb', line 74
def regexp
/^\s*pp\s+/
end
|