binding_of_callers 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/binding_of_callers/pry.rb +2 -0
- data/lib/binding_of_callers/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ac927a186f7137b889568cf1edf23678866ff40
|
4
|
+
data.tar.gz: 5840fca0851464c7b7f7e682cadc6b45b9e3bb20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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-
|
11
|
+
date: 2017-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|