Class: Debugger::VarLocalCommand
- Defined in:
- lib/ruby-debug-ide/commands/variables.rb
Overview
:nodoc:
Constant Summary
Constants inherited from Command
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Command
commands, #find, inherited, #initialize, load_commands, #match, method_missing, options
Constructor Details
This class inherits a constructor from Debugger::Command
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Debugger::Command
Class Method Details
.help(cmd) ⇒ Object
142 143 144 145 146 |
# File 'lib/ruby-debug-ide/commands/variables.rb', line 142 def help(cmd) %{ v[ar] l[ocal]\t\t\tshow local variables } end |
.help_command ⇒ Object
138 139 140 |
# File 'lib/ruby-debug-ide/commands/variables.rb', line 138 def help_command 'var' end |
Instance Method Details
#execute ⇒ Object
123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/ruby-debug-ide/commands/variables.rb', line 123 def execute locals = @state.context.frame_locals(@state.frame_pos) _self = @state.context.frame_self(@state.frame_pos) begin locals['self'] = _self unless _self.to_s == "main" rescue => ex locals['self'] = "<Cannot evaluate self>" $stderr << "Cannot evaluate self\n#{ex.class.name}: #{ex.}\n #{ex.backtrace.join("\n ")}" end print_variables(locals.keys, 'local') do |var| locals[var] end end |
#regexp ⇒ Object
119 120 121 |
# File 'lib/ruby-debug-ide/commands/variables.rb', line 119 def regexp /^\s*v(?:ar)?\s+l(?:ocal)?\s*$/ end |