binding_of_callers 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50592668cad4ca1e8716b00e2c3c08e0f50029d0
4
- data.tar.gz: d655875798fdb8572d3a7cbf266950dc6e7a37c9
3
+ metadata.gz: 4ac927a186f7137b889568cf1edf23678866ff40
4
+ data.tar.gz: 5840fca0851464c7b7f7e682cadc6b45b9e3bb20
5
5
  SHA512:
6
- metadata.gz: '038b883b9922432f5c1db10d14dfba025c075f32636c879bdf1709c712e5736690358d7b620c5a2a04afe04de2b2ab2917ffbacbfcdfb5a963196a4d08ecc4fa'
7
- data.tar.gz: '09182e5dc90a063ba1140e24287e33d9b7811f8869bbb9644e6c41b9545abd7e143927a8525d31e18f5243abd3d736c3fd182b1d94e0f3ec561c405948da11e6'
6
+ metadata.gz: 94c9c2bcc9f62bee6252eaea78c6284d3f9394bff76879b6479c8946d56278881f431eda45b7550786a22ee0dceb1b08f5a6925f7ae19c7d5dab1d9a4b20aab6
7
+ data.tar.gz: 84cf399c7039e517c02055086bf4f607719ed6843165d5da14d85946609f5ad4c09892dd0e4359f5c899e5c65908a6ed50e1a4daf1fe3c7370f98b980cf3f980
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # BindingOfCallers
2
2
 
3
- Something like [binding_of_caller](https://github.com/banister/binding_of_caller "binding_of_caller"), but collect all binding of callers at once
3
+ Something like [binding_of_caller](https://github.com/banister/binding_of_caller "binding_of_caller"), but collect all binding of callers at once, and provide convenient methods to inject variable or code in bindings
4
4
 
5
5
  ## Installation
6
6
 
@@ -64,7 +64,7 @@ Test.new.a
64
64
  # ["bye", "world"]
65
65
  ```
66
66
 
67
- ### Work with pry, get binding of callers from `_bs_`
67
+ ### Work with pry, get binding of callers from `_bs_` or `_bsi_`(with index)
68
68
 
69
69
  ```ruby
70
70
  require 'binding_of_callers/pry'
@@ -4,8 +4,10 @@ require 'pry'
4
4
  class Binding
5
5
  def pry(object=nil, hash={})
6
6
  bs = of_callers!.tap &:shift
7
+ bs_indexed = bs.each_with_object({}){|b, h| h[h.keys.count] = b}
7
8
  Pry.hooks.add_hook :when_started, "original_binding_stack_#{object_id}" do |target, options, pry_self|
8
9
  pry_self.inject_local :_bs_, bs, pry_self.current_binding
10
+ pry_self.inject_local :_bsi_, bs_indexed, pry_self.current_binding
9
11
  end
10
12
  Pry.start self
11
13
  end
@@ -1,3 +1,3 @@
1
1
  module BindingOfCallers
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: binding_of_callers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ken
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-05 00:00:00.000000000 Z
11
+ date: 2017-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler