Sha256: 38752aa3628dc1da0195dd91ac479f0193957db4120fb1cb26ff9a3f8685dac4

Contents?: true

Size: 472 Bytes

Versions: 9

Compression:

Stored size: 472 Bytes

Contents

require 'binding_of_callers'
require 'pry'

class Binding
  def pry(object=nil, hash={})
    bs = of_callers!.tap &:shift
    bs_indexed = bs.each_with_object({}){|b, h| h[h.keys.count] = b}
    Pry.hooks.add_hook :when_started, "original_binding_stack_#{object_id}" do |target, options, pry_self|
      pry_self.inject_local :_bs_, bs, pry_self.current_binding
      pry_self.inject_local :_bsi_, bs_indexed, pry_self.current_binding
    end
    Pry.start self
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
binding_of_callers-0.2.3 lib/binding_of_callers/pry.rb
binding_of_callers-0.2.2 lib/binding_of_callers/pry.rb
binding_of_callers-0.2.1 lib/binding_of_callers/pry.rb
binding_of_callers-0.2.0 lib/binding_of_callers/pry.rb
binding_of_callers-0.1.8 lib/binding_of_callers/pry.rb
binding_of_callers-0.1.7 lib/binding_of_callers/pry.rb
binding_of_callers-0.1.6 lib/binding_of_callers/pry.rb
binding_of_callers-0.1.5 lib/binding_of_callers/pry.rb
binding_of_callers-0.1.4 lib/binding_of_callers/pry.rb