Class: IRB::ExtendCommand::TraceException

Inherits:
TraceCommand
  • Object
show all
Defined in:
lib/tracer/irb.rb

Instance Method Summary collapse

Methods inherited from TraceCommand

transform_args

Instance Method Details

#execute(*args) ⇒ Object



108
109
110
111
112
113
114
115
116
117
118
# File 'lib/tracer/irb.rb', line 108

def execute(*args)
  expression = args.first

  unless expression
    puts "Please provide the expression to trace. Usage: `trace_exception <expression>`"
    return
  end

  b = irb_context.workspace.binding
  Tracer.trace_exception { eval(expression, b) }
end