Class: Byebug::PutLCommand
- Inherits:
-
Command
show all
- Includes:
- Columnize
- Defined in:
- lib/byebug/commands/eval.rb
Constant Summary
Constants inherited
from Command
Command::DEF_OPTIONS
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
commands, help, inherited, #initialize, load_commands, #match, method_missing, options, register_setting_get, register_setting_set, register_setting_var, settings, settings_map
Class Method Details
.description ⇒ Object
128
129
130
131
132
|
# File 'lib/byebug/commands/eval.rb', line 128
def description
%{
putl expression\tevaluate expression, an array, and columnize its value
}
end
|
.names ⇒ Object
124
125
126
|
# File 'lib/byebug/commands/eval.rb', line 124
def names
%w(putl)
end
|
Instance Method Details
#execute ⇒ Object
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
# File 'lib/byebug/commands/eval.rb', line 107
def execute
out = StringIO.new
run_with_binding do |b|
vals = debug_eval(@match.post_match, b)
if vals.is_a?(Array)
vals = vals.map{|item| item.to_s}
print "#{columnize(vals, Command.settings[:width])}\n"
else
PP.pp(vals, out)
print out.string
end
end
rescue
out.puts $!.message
end
|
#regexp ⇒ Object
103
104
105
|
# File 'lib/byebug/commands/eval.rb', line 103
def regexp
/^\s*putl\s+/
end
|