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



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

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

.help_commandObject



52
53
54
# File 'lib/ruby-debug/commands/eval.rb', line 52

def help_command
  'pp'
end

Instance Method Details

#executeObject



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

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

#regexpObject



41
42
43
# File 'lib/ruby-debug/commands/eval.rb', line 41

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