Class: PryRescue

Inherits:
Object
  • Object
show all
Defined in:
lib/pry-rescue.rb

Class Method Summary collapse

Class Method Details

.enter_exception_context(raised) ⇒ Object

Start a Pry session in the context of the exception.

Parameters:

  • exception (Exception)

    The exception.

  • bindings (Array<Binding>)

    The call stack.



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/pry-rescue.rb', line 19

def enter_exception_context(raised)
  exception, bindings = raised.last

  prune_call_stack!(bindings)

  if defined?(PryStackExplorer)
    pry :call_stack => bindings, :hooks => pry_hooks(exception, raised)
  else
    bindings.first.pry :hooks => pry_hooks(exception, raised)
  end
end