1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Pass a real binding to :when_started hook

This commit is contained in:
Ryan Fitzgerald 2012-12-18 00:07:06 -08:00
parent 47ad5fd53f
commit f02ba7615b

View file

@ -145,10 +145,13 @@ class Pry
pry_instance.backtrace = caller
# if Pry was started via binding.pry, elide that from the backtrace.
pry_instance.backtrace.shift if pry_instance.backtrace.first =~ /pry.*core_extensions.*pry/
if pry_instance.backtrace.first =~ /pry.*core_extensions.*pry/
pry_instance.backtrace.shift
end
# yield the binding_stack to the hook for modification
pry_instance.exec_hook(:when_started, target, options, pry_instance)
pry_instance.exec_hook(:when_started,
Pry.binding_for(target), options, pry_instance)
# Clear the line before starting Pry. This fixes the issue discussed here:
# https://github.com/pry/pry/issues/566