Class: Debugger::PPCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/ruby-debug/commands/eval.rb

Overview

:nodoc:

Constant Summary

Constants inherited from Command

Command::DEF_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, inherited, #initialize, load_commands, #match, method_missing, options

Constructor Details

This class inherits a constructor from Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



59
60
61
62
63
# File 'lib/ruby-debug/commands/eval.rb', line 59

def help(cmd)
  %{
    pp expression\tevaluate expression and print its value
  }
end

.help_commandObject



55
56
57
# File 'lib/ruby-debug/commands/eval.rb', line 55

def help_command
  'pp'
end

Instance Method Details

#executeObject



48
49
50
51
52
# File 'lib/ruby-debug/commands/eval.rb', line 48

def execute
  out = StringIO.new
  PP.pp(debug_eval(@match.post_match), out) rescue out.puts $!.message
  print out.string
end

#regexpObject



44
45
46
# File 'lib/ruby-debug/commands/eval.rb', line 44

def regexp
  /^\s*pp\s+/
end