binding_of_caller 0.6.0 → 0.6.2
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.
- data/Rakefile +3 -2
- data/ext/binding_of_caller/binding_of_caller.c +7 -0
- data/ext/binding_of_caller/extconf.rb +2 -3
- data/lib/binding_of_caller/version.rb +1 -1
- data/test/test.rb +0 -3
- metadata +9 -9
data/Rakefile
CHANGED
|
@@ -15,16 +15,17 @@ CLEAN.include("ext/**/*.#{dlext}", "ext/**/*.log", "ext/**/*.o",
|
|
|
15
15
|
|
|
16
16
|
def apply_spec_defaults(s)
|
|
17
17
|
s.name = PROJECT_NAME
|
|
18
|
-
s.summary = "Retrieve the binding of a method's caller. Can also retrieve bindings even further up the stack. Currently only works for MRI 1.9.2
|
|
18
|
+
s.summary = "Retrieve the binding of a method's caller. Can also retrieve bindings even further up the stack. Currently only works for MRI 1.9.2+"
|
|
19
19
|
s.version = BindingOfCaller::VERSION
|
|
20
20
|
s.date = Time.now.strftime '%Y-%m-%d'
|
|
21
21
|
s.author = "John Mair (banisterfiend)"
|
|
22
22
|
s.email = 'jrmair@gmail.com'
|
|
23
23
|
s.description = s.summary
|
|
24
24
|
s.require_path = 'lib'
|
|
25
|
-
s.add_development_dependency("bacon","~>1.1
|
|
25
|
+
s.add_development_dependency("bacon","~>1.1")
|
|
26
26
|
s.homepage = "http://github.com/banister/binding_of_caller"
|
|
27
27
|
s.has_rdoc = 'yard'
|
|
28
|
+
s.required_ruby_version = '>= 1.9.2'
|
|
28
29
|
s.files = `git ls-files`.split("\n")
|
|
29
30
|
s.test_files = `git ls-files -- test/*`.split("\n")
|
|
30
31
|
end
|
|
@@ -53,7 +53,11 @@ binding_mark(void *ptr)
|
|
|
53
53
|
if (ptr) {
|
|
54
54
|
bind = ptr;
|
|
55
55
|
RUBY_MARK_UNLESS_NULL(bind->env);
|
|
56
|
+
|
|
57
|
+
#ifdef RUBY_192
|
|
56
58
|
RUBY_MARK_UNLESS_NULL(bind->filename);
|
|
59
|
+
#endif
|
|
60
|
+
|
|
57
61
|
}
|
|
58
62
|
RUBY_MARK_LEAVE("binding");
|
|
59
63
|
}
|
|
@@ -181,6 +185,9 @@ static VALUE frame_count(VALUE self)
|
|
|
181
185
|
if (!valid_frame_p(cfp, limit_cfp))
|
|
182
186
|
cfp = find_valid_frame(cfp, limit_cfp);
|
|
183
187
|
|
|
188
|
+
if (!cfp)
|
|
189
|
+
break;
|
|
190
|
+
|
|
184
191
|
i++;
|
|
185
192
|
}
|
|
186
193
|
|
|
@@ -5,10 +5,9 @@ $CFLAGS += " -std=c99"
|
|
|
5
5
|
|
|
6
6
|
case RUBY_VERSION
|
|
7
7
|
when /1.9.2/
|
|
8
|
-
$CFLAGS += " -I./ruby_headers/192/"
|
|
8
|
+
$CFLAGS += " -I./ruby_headers/192/ -DRUBY_192"
|
|
9
9
|
when /1.9.3/
|
|
10
|
-
|
|
11
|
-
$CFLAGS += " -I./ruby_headers/193/"
|
|
10
|
+
$CFLAGS += " -I./ruby_headers/193/ -DRUBY_193"
|
|
12
11
|
end
|
|
13
12
|
|
|
14
13
|
create_makefile('binding_of_caller')
|
data/test/test.rb
CHANGED
|
@@ -86,9 +86,6 @@ describe BindingOfCaller do
|
|
|
86
86
|
caller_bindings[2].frame_type.should == :method
|
|
87
87
|
end
|
|
88
88
|
|
|
89
|
-
it 'should raise when invoked on an ordinary binding (i.e one not generated through Binding#of_caller)' do
|
|
90
|
-
lambda { binding.frame_type }.should.raise RuntimeError
|
|
91
|
-
end
|
|
92
89
|
end
|
|
93
90
|
end
|
|
94
91
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: binding_of_caller
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.2
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,21 +9,21 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2012-02-02 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bacon
|
|
16
|
-
requirement: &
|
|
16
|
+
requirement: &70103760947940 !ruby/object:Gem::Requirement
|
|
17
17
|
none: false
|
|
18
18
|
requirements:
|
|
19
19
|
- - ~>
|
|
20
20
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: 1.1
|
|
21
|
+
version: '1.1'
|
|
22
22
|
type: :development
|
|
23
23
|
prerelease: false
|
|
24
|
-
version_requirements: *
|
|
24
|
+
version_requirements: *70103760947940
|
|
25
25
|
description: Retrieve the binding of a method's caller. Can also retrieve bindings
|
|
26
|
-
even further up the stack. Currently only works for MRI 1.9.2
|
|
26
|
+
even further up the stack. Currently only works for MRI 1.9.2+
|
|
27
27
|
email: jrmair@gmail.com
|
|
28
28
|
executables: []
|
|
29
29
|
extensions:
|
|
@@ -101,7 +101,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
101
101
|
requirements:
|
|
102
102
|
- - ! '>='
|
|
103
103
|
- !ruby/object:Gem::Version
|
|
104
|
-
version:
|
|
104
|
+
version: 1.9.2
|
|
105
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
none: false
|
|
107
107
|
requirements:
|
|
@@ -110,10 +110,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
110
110
|
version: '0'
|
|
111
111
|
requirements: []
|
|
112
112
|
rubyforge_project:
|
|
113
|
-
rubygems_version: 1.8.
|
|
113
|
+
rubygems_version: 1.8.6
|
|
114
114
|
signing_key:
|
|
115
115
|
specification_version: 3
|
|
116
116
|
summary: Retrieve the binding of a method's caller. Can also retrieve bindings even
|
|
117
|
-
further up the stack. Currently only works for MRI 1.9.2
|
|
117
|
+
further up the stack. Currently only works for MRI 1.9.2+
|
|
118
118
|
test_files:
|
|
119
119
|
- test/test.rb
|