Class: Debugger::PSCommand
Overview
Constant Summary
Constants inherited
from Command
Command::DEF_OPTIONS
Class Method Summary
collapse
Instance Method Summary
collapse
#run_with_binding
Methods inherited from Command
commands, #find, inherited, #initialize, load_commands, #match, method_missing, options, register_setting_get, register_setting_set, register_setting_var, settings, settings_map
Class Method Details
.help(cmd) ⇒ Object
169
170
171
172
173
|
# File 'lib/ruby-debug/commands/eval.rb', line 169
def help(cmd)
%{
ps expression\tevaluate expression, an array, sort, and columnize its value
}
end
|
.help_command ⇒ Object
165
166
167
|
# File 'lib/ruby-debug/commands/eval.rb', line 165
def help_command
'ps'
end
|
Instance Method Details
#execute ⇒ Object
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
# File 'lib/ruby-debug/commands/eval.rb', line 148
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.sort!, self.class.settings[:width])}\n"
else
PP.pp(vals, out)
print out.string
end
end
rescue
out.puts $!.message
end
|
#regexp ⇒ Object
144
145
146
|
# File 'lib/ruby-debug/commands/eval.rb', line 144
def regexp
/^\s*ps\s+/
end
|