binding_of_caller 0.7.2 → 0.7.3.pre1
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/.gemtest +0 -0
- data/.gitignore +0 -0
- data/.travis.yml +8 -0
- data/.yardopts +0 -0
- data/HISTORY +35 -0
- data/LICENSE +0 -0
- data/README.md +6 -3
- data/Rakefile +1 -1
- data/binding_of_caller.gemspec +8 -6
- data/examples/benchmark.rb +63 -0
- data/ext/binding_of_caller/extconf.rb +5 -10
- data/lib/binding_of_caller.rb +2 -0
- data/lib/binding_of_caller/jruby_interpreted.rb +64 -0
- data/lib/binding_of_caller/rubinius.rb +21 -28
- data/lib/binding_of_caller/version.rb +1 -1
- data/test/test_binding_of_caller.rb +0 -0
- metadata +18 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a17f0ae87a78728422870616ded5e86b588dd3d0
|
4
|
+
data.tar.gz: f6ca5bc763c572972d999997d03c55c836c0d2e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9f7b1fbf6fc53920a35e66b76c1e324be60997a51c76b3d8029bc51675748776ef572bef36a56d746ee2916402695db1856ef7d6f609ba5c73e05b0780103cf
|
7
|
+
data.tar.gz: 1c6485ebd4c0953f31129368086e25c70c42bc659113610bd8adaf4ed6f4e27fe10d330f42376f0276646b1fc93e321938607d6df0fb85690cee43bce8058abe
|
data/.gemtest
CHANGED
File without changes
|
data/.gitignore
CHANGED
File without changes
|
data/.travis.yml
CHANGED
@@ -2,6 +2,7 @@ rvm:
|
|
2
2
|
- 1.9.2
|
3
3
|
- 1.9.3
|
4
4
|
- 2.0.0
|
5
|
+
- 2.1.0
|
5
6
|
- rbx-19mode
|
6
7
|
|
7
8
|
notifications:
|
@@ -13,6 +14,13 @@ branches:
|
|
13
14
|
only:
|
14
15
|
- master
|
15
16
|
|
17
|
+
matrix:
|
18
|
+
include:
|
19
|
+
- rvm: jruby
|
20
|
+
env: JRUBY_OPTS=-X-C
|
21
|
+
allow_failures:
|
22
|
+
- rvm: jruby
|
23
|
+
|
16
24
|
#script: rake test --trace
|
17
25
|
#
|
18
26
|
#before_install:
|
data/.yardopts
CHANGED
File without changes
|
data/HISTORY
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
## 0.7.3.pre1 / 2014-08-20
|
2
|
+
|
3
|
+
This release includes compatibility fixes for different ruby versions
|
4
|
+
and some minor enhancements.
|
5
|
+
|
6
|
+
* C Extensions are only compiled on MRI 1.9.x.
|
7
|
+
|
8
|
+
For MRI >= 2 the native API is used, so this should speedup
|
9
|
+
installation.
|
10
|
+
|
11
|
+
For JRuby this will avoid crashes on gem installation.
|
12
|
+
|
13
|
+
This was alredy being checked for Rubinius.
|
14
|
+
|
15
|
+
*Amadeus Folego*
|
16
|
+
|
17
|
+
* Added experimental JRuby support for 1.7.x series.
|
18
|
+
|
19
|
+
Only the main API is implemented and `Binding#eval` is
|
20
|
+
monkey-patched as it is private on JRuby.
|
21
|
+
|
22
|
+
This requires the compiler to be run on interpreted mode,
|
23
|
+
otherwise an exception will be thrown when `of_caller` is called.
|
24
|
+
|
25
|
+
*Charles Nutter*
|
26
|
+
|
27
|
+
* Remove executability from non-executable files.
|
28
|
+
|
29
|
+
*David Celis*
|
30
|
+
|
31
|
+
* Test and notice MRI 2.1 as a working Ruby implementation.
|
32
|
+
|
33
|
+
*Lennart Fridén*
|
34
|
+
|
35
|
+
## 0.7.2 / 2013-06-07
|
data/LICENSE
CHANGED
File without changes
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ binding_of_caller
|
|
5
5
|
|
6
6
|
(C) John Mair (banisterfiend) 2012
|
7
7
|
|
8
|
-
_Retrieve the binding of a method's caller in MRI 1.9.2+, MRI 2.0 and RBX (Rubinius)_
|
8
|
+
_Retrieve the binding of a method's caller in MRI 1.9.2+, MRI 2.0, MRI 2.1 and RBX (Rubinius)_
|
9
9
|
|
10
10
|
The `binding_of_caller` gem provides the `Binding#of_caller` method.
|
11
11
|
|
@@ -15,7 +15,7 @@ call stack, not limited to just the immediate caller.
|
|
15
15
|
|
16
16
|
**Recommended for use only in debugging situations. Do not use this in production apps.**
|
17
17
|
|
18
|
-
**Only works in MRI Ruby 1.9.2, 1.9.3, 2.0 and RBX (Rubinius)**
|
18
|
+
**Only works in MRI Ruby 1.9.2, 1.9.3, 2.0, 2.1 and RBX (Rubinius)**
|
19
19
|
|
20
20
|
* Install the [gem](https://rubygems.org/gems/binding_of_caller): `gem install binding_of_caller`
|
21
21
|
* See the [source code](http://github.com/banister/binding_of_caller)
|
@@ -52,8 +52,11 @@ This project is a spinoff from the [Pry REPL project.](http://pry.github.com)
|
|
52
52
|
Features and limitations
|
53
53
|
-------------------------
|
54
54
|
|
55
|
-
* Only works with MRI 1.9.2, 1.9.3, 2.0 and RBX (Rubinius)
|
55
|
+
* Only works with MRI 1.9.2, 1.9.3, 2.0, 2.1 and RBX (Rubinius)
|
56
56
|
* Does not work in 1.8.7, but there is a well known (continuation-based) hack to get a `Binding#of_caller` there.
|
57
|
+
* There is experimental support for jruby 1.7.x, but it only works in interpreted
|
58
|
+
mode (i.e. use the option `-Djruby.compile.mode=OFF` or append
|
59
|
+
`compile.mode=OFF` to your `.jrubyrc`)
|
57
60
|
|
58
61
|
Contact
|
59
62
|
-------
|
data/Rakefile
CHANGED
data/binding_of_caller.gemspec
CHANGED
@@ -1,19 +1,21 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
# stub: binding_of_caller 0.7.3.pre1 ruby lib
|
3
|
+
# stub: ext/binding_of_caller/extconf.rb
|
2
4
|
|
3
5
|
Gem::Specification.new do |s|
|
4
6
|
s.name = "binding_of_caller"
|
5
|
-
s.version = "0.7.
|
7
|
+
s.version = "0.7.3.pre1"
|
6
8
|
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
9
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
10
|
+
s.require_paths = ["lib"]
|
8
11
|
s.authors = ["John Mair (banisterfiend)"]
|
9
|
-
s.date = "
|
12
|
+
s.date = "2014-08-20"
|
10
13
|
s.description = "Retrieve the binding of a method's caller. Can also retrieve bindings even further up the stack."
|
11
14
|
s.email = "jrmair@gmail.com"
|
12
15
|
s.extensions = ["ext/binding_of_caller/extconf.rb"]
|
13
|
-
s.files = [".gemtest", ".gitignore", ".travis.yml", ".yardopts", "Gemfile", "HISTORY", "LICENSE", "README.md", "Rakefile", "binding_of_caller.gemspec", "examples/example.rb", "ext/binding_of_caller/binding_of_caller.c", "ext/binding_of_caller/extconf.rb", "ext/binding_of_caller/ruby_headers/192/debug.h", "ext/binding_of_caller/ruby_headers/192/dln.h", "ext/binding_of_caller/ruby_headers/192/eval_intern.h", "ext/binding_of_caller/ruby_headers/192/id.h", "ext/binding_of_caller/ruby_headers/192/iseq.h", "ext/binding_of_caller/ruby_headers/192/method.h", "ext/binding_of_caller/ruby_headers/192/node.h", "ext/binding_of_caller/ruby_headers/192/regenc.h", "ext/binding_of_caller/ruby_headers/192/regint.h", "ext/binding_of_caller/ruby_headers/192/regparse.h", "ext/binding_of_caller/ruby_headers/192/rubys_gc.h", "ext/binding_of_caller/ruby_headers/192/thread_pthread.h", "ext/binding_of_caller/ruby_headers/192/thread_win32.h", "ext/binding_of_caller/ruby_headers/192/timev.h", "ext/binding_of_caller/ruby_headers/192/transcode_data.h", "ext/binding_of_caller/ruby_headers/192/version.h", "ext/binding_of_caller/ruby_headers/192/vm_core.h", "ext/binding_of_caller/ruby_headers/192/vm_exec.h", "ext/binding_of_caller/ruby_headers/192/vm_insnhelper.h", "ext/binding_of_caller/ruby_headers/192/vm_opts.h", "ext/binding_of_caller/ruby_headers/193/addr2line.h", "ext/binding_of_caller/ruby_headers/193/atomic.h", "ext/binding_of_caller/ruby_headers/193/constant.h", "ext/binding_of_caller/ruby_headers/193/debug.h", "ext/binding_of_caller/ruby_headers/193/dln.h", "ext/binding_of_caller/ruby_headers/193/encdb.h", "ext/binding_of_caller/ruby_headers/193/eval_intern.h", "ext/binding_of_caller/ruby_headers/193/id.h", "ext/binding_of_caller/ruby_headers/193/internal.h", "ext/binding_of_caller/ruby_headers/193/iseq.h", "ext/binding_of_caller/ruby_headers/193/method.h", "ext/binding_of_caller/ruby_headers/193/node.h", "ext/binding_of_caller/ruby_headers/193/parse.h", "ext/binding_of_caller/ruby_headers/193/regenc.h", "ext/binding_of_caller/ruby_headers/193/regint.h", "ext/binding_of_caller/ruby_headers/193/regparse.h", "ext/binding_of_caller/ruby_headers/193/revision.h", "ext/binding_of_caller/ruby_headers/193/rubys_gc.h", "ext/binding_of_caller/ruby_headers/193/thread_pthread.h", "ext/binding_of_caller/ruby_headers/193/thread_win32.h", "ext/binding_of_caller/ruby_headers/193/timev.h", "ext/binding_of_caller/ruby_headers/193/transcode_data.h", "ext/binding_of_caller/ruby_headers/193/transdb.h", "ext/binding_of_caller/ruby_headers/193/version.h", "ext/binding_of_caller/ruby_headers/193/vm_core.h", "ext/binding_of_caller/ruby_headers/193/vm_exec.h", "ext/binding_of_caller/ruby_headers/193/vm_insnhelper.h", "ext/binding_of_caller/ruby_headers/193/vm_opts.h", "lib/binding_of_caller.rb", "lib/binding_of_caller/mri2.rb", "lib/binding_of_caller/rubinius.rb", "lib/binding_of_caller/version.rb", "test/test_binding_of_caller.rb"]
|
16
|
+
s.files = [".gemtest", ".gitignore", ".travis.yml", ".yardopts", "Gemfile", "HISTORY", "LICENSE", "README.md", "Rakefile", "binding_of_caller.gemspec", "examples/benchmark.rb", "examples/example.rb", "ext/binding_of_caller/binding_of_caller.c", "ext/binding_of_caller/extconf.rb", "ext/binding_of_caller/ruby_headers/192/debug.h", "ext/binding_of_caller/ruby_headers/192/dln.h", "ext/binding_of_caller/ruby_headers/192/eval_intern.h", "ext/binding_of_caller/ruby_headers/192/id.h", "ext/binding_of_caller/ruby_headers/192/iseq.h", "ext/binding_of_caller/ruby_headers/192/method.h", "ext/binding_of_caller/ruby_headers/192/node.h", "ext/binding_of_caller/ruby_headers/192/regenc.h", "ext/binding_of_caller/ruby_headers/192/regint.h", "ext/binding_of_caller/ruby_headers/192/regparse.h", "ext/binding_of_caller/ruby_headers/192/rubys_gc.h", "ext/binding_of_caller/ruby_headers/192/thread_pthread.h", "ext/binding_of_caller/ruby_headers/192/thread_win32.h", "ext/binding_of_caller/ruby_headers/192/timev.h", "ext/binding_of_caller/ruby_headers/192/transcode_data.h", "ext/binding_of_caller/ruby_headers/192/version.h", "ext/binding_of_caller/ruby_headers/192/vm_core.h", "ext/binding_of_caller/ruby_headers/192/vm_exec.h", "ext/binding_of_caller/ruby_headers/192/vm_insnhelper.h", "ext/binding_of_caller/ruby_headers/192/vm_opts.h", "ext/binding_of_caller/ruby_headers/193/addr2line.h", "ext/binding_of_caller/ruby_headers/193/atomic.h", "ext/binding_of_caller/ruby_headers/193/constant.h", "ext/binding_of_caller/ruby_headers/193/debug.h", "ext/binding_of_caller/ruby_headers/193/dln.h", "ext/binding_of_caller/ruby_headers/193/encdb.h", "ext/binding_of_caller/ruby_headers/193/eval_intern.h", "ext/binding_of_caller/ruby_headers/193/id.h", "ext/binding_of_caller/ruby_headers/193/internal.h", "ext/binding_of_caller/ruby_headers/193/iseq.h", "ext/binding_of_caller/ruby_headers/193/method.h", "ext/binding_of_caller/ruby_headers/193/node.h", "ext/binding_of_caller/ruby_headers/193/parse.h", "ext/binding_of_caller/ruby_headers/193/regenc.h", "ext/binding_of_caller/ruby_headers/193/regint.h", "ext/binding_of_caller/ruby_headers/193/regparse.h", "ext/binding_of_caller/ruby_headers/193/revision.h", "ext/binding_of_caller/ruby_headers/193/rubys_gc.h", "ext/binding_of_caller/ruby_headers/193/thread_pthread.h", "ext/binding_of_caller/ruby_headers/193/thread_win32.h", "ext/binding_of_caller/ruby_headers/193/timev.h", "ext/binding_of_caller/ruby_headers/193/transcode_data.h", "ext/binding_of_caller/ruby_headers/193/transdb.h", "ext/binding_of_caller/ruby_headers/193/version.h", "ext/binding_of_caller/ruby_headers/193/vm_core.h", "ext/binding_of_caller/ruby_headers/193/vm_exec.h", "ext/binding_of_caller/ruby_headers/193/vm_insnhelper.h", "ext/binding_of_caller/ruby_headers/193/vm_opts.h", "lib/binding_of_caller.rb", "lib/binding_of_caller/jruby_interpreted.rb", "lib/binding_of_caller/mri2.rb", "lib/binding_of_caller/rubinius.rb", "lib/binding_of_caller/version.rb", "test/test_binding_of_caller.rb"]
|
14
17
|
s.homepage = "http://github.com/banister/binding_of_caller"
|
15
|
-
s.
|
16
|
-
s.rubygems_version = "2.0.3"
|
18
|
+
s.rubygems_version = "2.2.2"
|
17
19
|
s.summary = "Retrieve the binding of a method's caller. Can also retrieve bindings even further up the stack."
|
18
20
|
s.test_files = ["test/test_binding_of_caller.rb"]
|
19
21
|
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'benchmark'
|
2
|
+
|
3
|
+
unless Object.const_defined? :BindingOfCaller
|
4
|
+
$:.unshift File.expand_path '../../lib', __FILE__
|
5
|
+
require 'binding_of_caller'
|
6
|
+
require 'binding_of_caller/version'
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
n = 250000
|
11
|
+
|
12
|
+
Benchmark.bm(10) do |x|
|
13
|
+
x.report("#of_caller") do
|
14
|
+
1.upto(n) do
|
15
|
+
1.times do
|
16
|
+
1.times do
|
17
|
+
binding.of_caller(2)
|
18
|
+
binding.of_caller(1)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
x.report("#frame_count") do
|
25
|
+
1.upto(n) do
|
26
|
+
1.times do
|
27
|
+
1.times do
|
28
|
+
binding.frame_count
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
x.report("#callers") do
|
35
|
+
1.upto(n) do
|
36
|
+
1.times do
|
37
|
+
1.times do
|
38
|
+
binding.callers
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
x.report("#frame_description") do
|
45
|
+
1.upto(n) do
|
46
|
+
1.times do
|
47
|
+
1.times do
|
48
|
+
binding.of_caller(1).frame_description
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
x.report("#frame_type") do
|
55
|
+
1.upto(n) do
|
56
|
+
1.times do
|
57
|
+
1.times do
|
58
|
+
binding.of_caller(1).frame_type
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -4,18 +4,12 @@ def fake_makefile
|
|
4
4
|
end
|
5
5
|
end
|
6
6
|
|
7
|
-
def
|
7
|
+
def mri_1_9?
|
8
8
|
defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby" &&
|
9
|
-
RUBY_VERSION =~ /^
|
9
|
+
RUBY_VERSION =~ /^1\.9/
|
10
10
|
end
|
11
11
|
|
12
|
-
|
13
|
-
defined?(RUBY_ENGINE) && RUBY_ENGINE =~ /rbx/
|
14
|
-
end
|
15
|
-
|
16
|
-
if mri_2? || rbx?
|
17
|
-
fake_makefile
|
18
|
-
else
|
12
|
+
if mri_1_9?
|
19
13
|
require 'mkmf'
|
20
14
|
|
21
15
|
$CFLAGS += " -O0"
|
@@ -29,5 +23,6 @@ else
|
|
29
23
|
end
|
30
24
|
|
31
25
|
create_makefile('binding_of_caller')
|
26
|
+
else
|
27
|
+
fake_makefile
|
32
28
|
end
|
33
|
-
|
data/lib/binding_of_caller.rb
CHANGED
@@ -0,0 +1,64 @@
|
|
1
|
+
class org::jruby::runtime::ThreadContext
|
2
|
+
java_import org.jruby.runtime.Binding
|
3
|
+
java_import org.jruby.RubyBinding
|
4
|
+
java_import org.jruby.RubyInstanceConfig::CompileMode
|
5
|
+
|
6
|
+
field_accessor :frameStack, :frameIndex,
|
7
|
+
:scopeStack, :scopeIndex,
|
8
|
+
:backtrace, :backtraceIndex
|
9
|
+
|
10
|
+
def binding_of_caller(index)
|
11
|
+
unless JRuby.runtime.instance_config.compile_mode == CompileMode::OFF
|
12
|
+
raise RuntimeError, "caller binding only supported in interpreter"
|
13
|
+
end
|
14
|
+
|
15
|
+
index += 1 # always omit this frame
|
16
|
+
|
17
|
+
raise RuntimeError, "Invalid frame, gone beyond end of stack!" if index > frameIndex
|
18
|
+
|
19
|
+
frame = frameStack[frameIndex - index]
|
20
|
+
|
21
|
+
return binding_of_caller(index - 1) if index > scopeIndex
|
22
|
+
|
23
|
+
scope = scopeStack[scopeIndex - index]
|
24
|
+
element = backtrace[backtraceIndex - index]
|
25
|
+
|
26
|
+
binding = Binding.new(frame, scope.static_scope.module, scope, element.clone)
|
27
|
+
|
28
|
+
JRuby.dereference(RubyBinding.new(JRuby.runtime, Binding, binding))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
module BindingOfCaller
|
33
|
+
module BindingExtensions
|
34
|
+
def of_caller(index = 1)
|
35
|
+
index += 1 # always omit this frame
|
36
|
+
JRuby.runtime.current_context.binding_of_caller(index)
|
37
|
+
end
|
38
|
+
|
39
|
+
def callers
|
40
|
+
ary = []
|
41
|
+
n = 2
|
42
|
+
loop do
|
43
|
+
ary << of_caller(n) rescue break
|
44
|
+
n += 1
|
45
|
+
end
|
46
|
+
ary
|
47
|
+
end
|
48
|
+
|
49
|
+
def frame_count
|
50
|
+
callers.count - 1
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
class ::Binding
|
56
|
+
include BindingOfCaller::BindingExtensions
|
57
|
+
extend BindingOfCaller::BindingExtensions
|
58
|
+
end
|
59
|
+
|
60
|
+
class Java::OrgJrubyRuntime::Binding
|
61
|
+
def eval(code)
|
62
|
+
Kernel.eval code, self
|
63
|
+
end
|
64
|
+
end
|
@@ -4,22 +4,11 @@ module BindingOfCaller
|
|
4
4
|
# Retrieve the binding of the nth caller of the current frame.
|
5
5
|
# @return [Binding]
|
6
6
|
def of_caller(n)
|
7
|
-
|
7
|
+
location = Rubinius::VM.backtrace(1 + n, true).first
|
8
8
|
|
9
|
-
raise RuntimeError, "Invalid frame, gone beyond end of stack!" if
|
9
|
+
raise RuntimeError, "Invalid frame, gone beyond end of stack!" if location.nil?
|
10
10
|
|
11
|
-
|
12
|
-
bt.variables,
|
13
|
-
bt.variables.method,
|
14
|
-
bt.constant_scope,
|
15
|
-
bt.variables.self,
|
16
|
-
bt
|
17
|
-
)
|
18
|
-
|
19
|
-
b.instance_variable_set :@frame_description,
|
20
|
-
bt.describe.gsub("{ } in", "block in")
|
21
|
-
|
22
|
-
b
|
11
|
+
setup_binding_from_location(location)
|
23
12
|
end
|
24
13
|
|
25
14
|
# The description of the frame.
|
@@ -31,25 +20,14 @@ module BindingOfCaller
|
|
31
20
|
# Return bindings for all caller frames.
|
32
21
|
# @return [Array<Binding>]
|
33
22
|
def callers
|
34
|
-
|
35
|
-
|
36
|
-
loop do
|
37
|
-
begin
|
38
|
-
ary << Binding.of_caller(n)
|
39
|
-
rescue
|
40
|
-
break
|
41
|
-
end
|
42
|
-
n += 1
|
43
|
-
end
|
44
|
-
ary.drop_while do |v|
|
45
|
-
!(v.frame_type == :method && v.eval("__method__") == :callers)
|
46
|
-
end.drop(1)
|
23
|
+
Rubinius::VM.backtrace(1, true).map &(method(:setup_binding_from_location).
|
24
|
+
to_proc)
|
47
25
|
end
|
48
26
|
|
49
27
|
# Number of parent frames available at the point of call.
|
50
28
|
# @return [Fixnum]
|
51
29
|
def frame_count
|
52
|
-
|
30
|
+
Rubinius::VM.backtrace(1).count
|
53
31
|
end
|
54
32
|
|
55
33
|
# The type of the frame.
|
@@ -65,6 +43,21 @@ module BindingOfCaller
|
|
65
43
|
:method
|
66
44
|
end
|
67
45
|
end
|
46
|
+
|
47
|
+
protected
|
48
|
+
|
49
|
+
def setup_binding_from_location(location)
|
50
|
+
binding = Binding.setup location.variables,
|
51
|
+
location.variables.method,
|
52
|
+
location.constant_scope,
|
53
|
+
location.variables.self,
|
54
|
+
location
|
55
|
+
|
56
|
+
binding.instance_variable_set :@frame_description,
|
57
|
+
location.describe.gsub("{ } in", "block in")
|
58
|
+
|
59
|
+
binding
|
60
|
+
end
|
68
61
|
end
|
69
62
|
end
|
70
63
|
|
File without changes
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: binding_of_caller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Mair (banisterfiend)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debug_inspector
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.0.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.0.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bacon
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: Retrieve the binding of a method's caller. Can also retrieve bindings
|
@@ -60,16 +60,17 @@ extensions:
|
|
60
60
|
- ext/binding_of_caller/extconf.rb
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
-
- .gemtest
|
64
|
-
- .gitignore
|
65
|
-
- .travis.yml
|
66
|
-
- .yardopts
|
63
|
+
- ".gemtest"
|
64
|
+
- ".gitignore"
|
65
|
+
- ".travis.yml"
|
66
|
+
- ".yardopts"
|
67
67
|
- Gemfile
|
68
68
|
- HISTORY
|
69
69
|
- LICENSE
|
70
70
|
- README.md
|
71
71
|
- Rakefile
|
72
72
|
- binding_of_caller.gemspec
|
73
|
+
- examples/benchmark.rb
|
73
74
|
- examples/example.rb
|
74
75
|
- ext/binding_of_caller/binding_of_caller.c
|
75
76
|
- ext/binding_of_caller/extconf.rb
|
@@ -122,6 +123,7 @@ files:
|
|
122
123
|
- ext/binding_of_caller/ruby_headers/193/vm_insnhelper.h
|
123
124
|
- ext/binding_of_caller/ruby_headers/193/vm_opts.h
|
124
125
|
- lib/binding_of_caller.rb
|
126
|
+
- lib/binding_of_caller/jruby_interpreted.rb
|
125
127
|
- lib/binding_of_caller/mri2.rb
|
126
128
|
- lib/binding_of_caller/rubinius.rb
|
127
129
|
- lib/binding_of_caller/version.rb
|
@@ -135,17 +137,17 @@ require_paths:
|
|
135
137
|
- lib
|
136
138
|
required_ruby_version: !ruby/object:Gem::Requirement
|
137
139
|
requirements:
|
138
|
-
- -
|
140
|
+
- - ">="
|
139
141
|
- !ruby/object:Gem::Version
|
140
142
|
version: '0'
|
141
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
144
|
requirements:
|
143
|
-
- -
|
145
|
+
- - ">"
|
144
146
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
147
|
+
version: 1.3.1
|
146
148
|
requirements: []
|
147
149
|
rubyforge_project:
|
148
|
-
rubygems_version: 2.
|
150
|
+
rubygems_version: 2.2.2
|
149
151
|
signing_key:
|
150
152
|
specification_version: 4
|
151
153
|
summary: Retrieve the binding of a method's caller. Can also retrieve bindings even
|