Skip to content

Commit

Permalink
Pass a real binding to :when_started hook
Browse files Browse the repository at this point in the history
  • Loading branch information
rf- committed Dec 18, 2012
1 parent 47ad5fd commit f02ba76
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/pry/pry_class.rb
Expand Up @@ -145,10 +145,13 @@ def self.start(target=nil, options={})
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
Expand Down

0 comments on commit f02ba76

Please sign in to comment.