binding_of_callers 0.1.8 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/Gemfile +1 -0
- data/binding_of_callers.gemspec +2 -2
- data/lib/binding_of_callers/version.rb +1 -1
- data/lib/binding_of_callers.rb +14 -8
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a6590a18ce85e8b2bd69972061c5a2c6f23b93344c686ca068200baf82a2fd66
|
4
|
+
data.tar.gz: ff0006a64f76f70a4c40852ebe3850346f60812480b1770591401cb16bbc37f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4049585d6346140bc97623da6adff7bfb8b6c37725788b7abd578cd6244a5e5d56a53de9b7a269aefdebfd2f3bbaec77b3294a3efcbbb33f4c30121b0bc2109c
|
7
|
+
data.tar.gz: fa6bc3f4b2bdc389a73d122542b2ebe5b9541039cbea24bd89e0e2526a8b488b258f08e85968ec669ff3afe92d7c01e8fa17bb59f8575f7a9caa624148c2f2a5
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/binding_of_callers.gemspec
CHANGED
@@ -20,10 +20,10 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.add_development_dependency "bundler", "~>
|
23
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
24
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
25
25
|
spec.add_development_dependency "minitest", "~> 5.0"
|
26
26
|
|
27
|
-
spec.add_dependency "binding_of_caller", "~> 0
|
27
|
+
spec.add_dependency "binding_of_caller", "~> 1.0"
|
28
28
|
spec.add_dependency "pry", ">= 0.10.0"
|
29
29
|
end
|
data/lib/binding_of_callers.rb
CHANGED
@@ -4,28 +4,34 @@ require 'binding_of_caller'
|
|
4
4
|
|
5
5
|
class Binding
|
6
6
|
|
7
|
-
def of_callers
|
8
|
-
enhance do |bi|
|
7
|
+
def of_callers(fc = frame_count)
|
8
|
+
enhance(fc) do |bi|
|
9
9
|
BindingOfCallers::Revealed.new bi
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
def of_callers!
|
14
|
-
enhance do |bi|
|
13
|
+
def of_callers!(fc = frame_count)
|
14
|
+
enhance(fc) do |bi|
|
15
15
|
bi.extend BindingOfCallers::Reveal
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
def partial_callers(limit)
|
20
|
+
_callers = callers
|
21
|
+
limit = _callers.size + limit if limit < 0
|
22
|
+
_callers[1, limit].map!{ |c| BindingOfCallers::Revealed.new(c) }
|
23
|
+
end
|
24
|
+
|
19
25
|
private
|
20
26
|
|
21
|
-
def enhance &enhance
|
22
|
-
collected.map(&enhance)
|
27
|
+
def enhance(fc, &enhance)
|
28
|
+
collected(fc).map(&enhance)
|
23
29
|
end
|
24
30
|
|
25
|
-
def collected
|
31
|
+
def collected(fc)
|
26
32
|
n = 3
|
27
33
|
bis = []
|
28
|
-
while n <
|
34
|
+
while n < fc
|
29
35
|
bis << of_caller(n)
|
30
36
|
n = n.succ
|
31
37
|
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.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ken
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0
|
61
|
+
version: '1.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0
|
68
|
+
version: '1.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: pry
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -121,8 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
|
-
|
125
|
-
rubygems_version: 2.6.8
|
124
|
+
rubygems_version: 3.1.6
|
126
125
|
signing_key:
|
127
126
|
specification_version: 4
|
128
127
|
summary: a wrapper of binding_of_caller, for easy use
|