binding_of_caller 0.8.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/test.yml +108 -0
  3. data/.gitignore +12 -7
  4. data/Gemfile +6 -1
  5. data/README.md +14 -5
  6. data/Rakefile +4 -132
  7. data/binding_of_caller.gemspec +33 -37
  8. data/lib/binding_of_caller/{mri2.rb → mri.rb} +2 -2
  9. data/lib/binding_of_caller/version.rb +1 -1
  10. data/lib/binding_of_caller.rb +7 -8
  11. metadata +25 -103
  12. data/.travis.yml +0 -35
  13. data/HISTORY +0 -35
  14. data/examples/benchmark.rb +0 -63
  15. data/examples/example.rb +0 -41
  16. data/ext/binding_of_caller/binding_of_caller.c +0 -225
  17. data/ext/binding_of_caller/extconf.rb +0 -28
  18. data/ext/binding_of_caller/ruby_headers/192/debug.h +0 -36
  19. data/ext/binding_of_caller/ruby_headers/192/dln.h +0 -41
  20. data/ext/binding_of_caller/ruby_headers/192/eval_intern.h +0 -232
  21. data/ext/binding_of_caller/ruby_headers/192/id.h +0 -173
  22. data/ext/binding_of_caller/ruby_headers/192/iseq.h +0 -104
  23. data/ext/binding_of_caller/ruby_headers/192/method.h +0 -103
  24. data/ext/binding_of_caller/ruby_headers/192/node.h +0 -483
  25. data/ext/binding_of_caller/ruby_headers/192/regenc.h +0 -211
  26. data/ext/binding_of_caller/ruby_headers/192/regint.h +0 -841
  27. data/ext/binding_of_caller/ruby_headers/192/regparse.h +0 -354
  28. data/ext/binding_of_caller/ruby_headers/192/rubys_gc.h +0 -77
  29. data/ext/binding_of_caller/ruby_headers/192/thread_pthread.h +0 -27
  30. data/ext/binding_of_caller/ruby_headers/192/thread_win32.h +0 -33
  31. data/ext/binding_of_caller/ruby_headers/192/timev.h +0 -21
  32. data/ext/binding_of_caller/ruby_headers/192/transcode_data.h +0 -109
  33. data/ext/binding_of_caller/ruby_headers/192/version.h +0 -55
  34. data/ext/binding_of_caller/ruby_headers/192/vm_core.h +0 -703
  35. data/ext/binding_of_caller/ruby_headers/192/vm_exec.h +0 -184
  36. data/ext/binding_of_caller/ruby_headers/192/vm_insnhelper.h +0 -208
  37. data/ext/binding_of_caller/ruby_headers/192/vm_opts.h +0 -51
  38. data/ext/binding_of_caller/ruby_headers/193/addr2line.h +0 -21
  39. data/ext/binding_of_caller/ruby_headers/193/atomic.h +0 -56
  40. data/ext/binding_of_caller/ruby_headers/193/constant.h +0 -34
  41. data/ext/binding_of_caller/ruby_headers/193/debug.h +0 -41
  42. data/ext/binding_of_caller/ruby_headers/193/dln.h +0 -50
  43. data/ext/binding_of_caller/ruby_headers/193/encdb.h +0 -167
  44. data/ext/binding_of_caller/ruby_headers/193/eval_intern.h +0 -234
  45. data/ext/binding_of_caller/ruby_headers/193/id.h +0 -175
  46. data/ext/binding_of_caller/ruby_headers/193/internal.h +0 -227
  47. data/ext/binding_of_caller/ruby_headers/193/iseq.h +0 -125
  48. data/ext/binding_of_caller/ruby_headers/193/method.h +0 -105
  49. data/ext/binding_of_caller/ruby_headers/193/node.h +0 -503
  50. data/ext/binding_of_caller/ruby_headers/193/parse.h +0 -186
  51. data/ext/binding_of_caller/ruby_headers/193/regenc.h +0 -219
  52. data/ext/binding_of_caller/ruby_headers/193/regint.h +0 -851
  53. data/ext/binding_of_caller/ruby_headers/193/regparse.h +0 -362
  54. data/ext/binding_of_caller/ruby_headers/193/revision.h +0 -1
  55. data/ext/binding_of_caller/ruby_headers/193/rubys_gc.h +0 -98
  56. data/ext/binding_of_caller/ruby_headers/193/thread_pthread.h +0 -51
  57. data/ext/binding_of_caller/ruby_headers/193/thread_win32.h +0 -40
  58. data/ext/binding_of_caller/ruby_headers/193/timev.h +0 -21
  59. data/ext/binding_of_caller/ruby_headers/193/transcode_data.h +0 -117
  60. data/ext/binding_of_caller/ruby_headers/193/transdb.h +0 -189
  61. data/ext/binding_of_caller/ruby_headers/193/version.h +0 -52
  62. data/ext/binding_of_caller/ruby_headers/193/vm_core.h +0 -755
  63. data/ext/binding_of_caller/ruby_headers/193/vm_exec.h +0 -184
  64. data/ext/binding_of_caller/ruby_headers/193/vm_insnhelper.h +0 -220
  65. data/ext/binding_of_caller/ruby_headers/193/vm_opts.h +0 -51
  66. data/test/test_binding_of_caller.rb +0 -161
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3ca118584b33771699ce8297cafc573b9f1d2d80
4
- data.tar.gz: cdfcd664fd08599e4f4826862fb49f8d4eecc992
2
+ SHA256:
3
+ metadata.gz: 0254f3b28703e0ce22f22a5835efdc9ac7f8d7756eb018c9700174d2dab1bf00
4
+ data.tar.gz: e87d62228e3eca329d9315c15f329a1d163be3ff7aee49702ddc604b4fe85e52
5
5
  SHA512:
6
- metadata.gz: 21766025ccac08d6f79ba1e5bbef018116b765ca44b98f4fb269e494cf52dfb1066c4deb305eb30ddcdac2edc9e4f041926fe0e77767eb40a7cbd3ac866c00a7
7
- data.tar.gz: 3b23f40eca0b622e89af12c443c54eed869441da9e3f2042b7d57acc77ffee2cd971ac8ee7e3beb9efcd58ce5b33003948f3705f711d928af1eeef3ee370fe3f
6
+ metadata.gz: 91989097e5c3d8420c2fc4cb8071a262879325cbe59d16f6bbb35cb86b0f2be42ab1d27b515c0497a4deea863d0f0f60b6e8dce446ce2c4bb777f7699e87d8e1
7
+ data.tar.gz: 13a9eb1a35130ba007dc12517cdac063e623faeef11d7533d57c6762fe25664ad224711d3902d10fe1c081c089c91314fd8c661720b15c6bcc02e3c873caba6e
@@ -0,0 +1,108 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ schedule:
7
+ - cron: '0 0 11,25 * *' # roughly every two weeks to run on new Ruby versions
8
+ pull_request:
9
+ branches: [ master ]
10
+ workflow_dispatch:
11
+
12
+ jobs:
13
+ test:
14
+ name: "Unit"
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ ruby:
20
+ - "2.1"
21
+ - "2.2"
22
+ - "2.3"
23
+ - "2.4"
24
+ - "2.5"
25
+ - "2.6"
26
+ - "2.7"
27
+ - "3.0"
28
+ - "3.1"
29
+ - "3.2"
30
+ exclude:
31
+ # 2.2 segfaults on recent Ubuntu: https://github.com/ruby/setup-ruby/issues/496
32
+ - { ruby: "2.2" }
33
+
34
+ steps:
35
+
36
+ - uses: actions/checkout@v2
37
+
38
+ - name: Set up Ruby
39
+ uses: ruby/setup-ruby@v1
40
+ with:
41
+ ruby-version: ${{ matrix.ruby }}
42
+ bundler-cache: true
43
+
44
+ - name: Test
45
+ run: bundle exec rspec -f doc
46
+
47
+ system:
48
+ name: "System"
49
+ runs-on: ${{ matrix.os }}
50
+ strategy:
51
+ fail-fast: false
52
+ matrix:
53
+ os:
54
+ - macos-latest
55
+ - ubuntu-latest
56
+ - windows-latest
57
+ ruby:
58
+ - "2"
59
+ - "3.0"
60
+ - "jruby"
61
+ - "truffleruby"
62
+ exclude:
63
+ # Windows releases of jruby and truffleruby have issues. Skip them for now.
64
+ - { ruby: "jruby", os: "windows-latest" }
65
+ - { ruby: "truffleruby", os: "windows-latest" }
66
+
67
+ steps:
68
+
69
+ - uses: actions/checkout@v2
70
+
71
+ - name: Determine ruby version name
72
+ id: ruby_version
73
+ run: |
74
+ if [[ $OS == 'windows-latest' && $RUBY == '3.0' ]]; then
75
+ # Windows doesn't have 3.0, so run head there but nowhere else.
76
+ echo "::set-output name=release::head"
77
+ else
78
+ echo "::set-output name=release::$RUBY"
79
+ fi
80
+ shell: bash
81
+ env:
82
+ OS: ${{ matrix.os }}
83
+ RUBY: ${{ matrix.ruby }}
84
+
85
+ - name: Set up Ruby
86
+ uses: ruby/setup-ruby@v1
87
+ with:
88
+ ruby-version: ${{ steps.ruby_version.outputs.release }}
89
+ bundler-cache: true
90
+
91
+ - name: Install gem
92
+ run: bundle exec rake install
93
+
94
+ - name: Create directory for gem test
95
+ run: mkdir -p tmp/gem-test
96
+
97
+ - name: Create test Gemfile
98
+ run: echo "gem 'binding_of_caller'" > Gemfile
99
+ working-directory: ./tmp/gem-test
100
+
101
+ - name: Test gem load
102
+ run: bundle exec ruby -e "require 'binding_of_caller'"
103
+
104
+ - name: Test gem functionality
105
+ if: ${{ matrix.ruby != 'jruby' && matrix.ruby != 'truffleruby' }}
106
+ run: bundle exec ruby -e "require 'binding_of_caller'; binding.of_caller(0).eval('var = :hello')"
107
+ env:
108
+ JRUBY_OPTS: "--dev" # This will support JRuby once the gem is updated to support JRuby 9.x
data/.gitignore CHANGED
@@ -1,8 +1,13 @@
1
- Makefile
2
- *.so
3
- *.o
4
- *.def
5
- doc/
6
- pkg/
7
- .yardoc/
8
1
  Gemfile.lock
2
+
3
+ /.bundle/
4
+ /.yardoc
5
+ /_yardoc/
6
+ /coverage/
7
+ /doc/
8
+ /pkg/
9
+ /spec/reports/
10
+ /tmp/
11
+
12
+ # rspec failure tracking
13
+ .rspec_status
data/Gemfile CHANGED
@@ -1,2 +1,7 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in binding_of_caller.gemspec
2
4
  gemspec
5
+
6
+ gem "rake"
7
+ gem "rspec"
data/README.md CHANGED
@@ -1,11 +1,12 @@
1
- [![Build Status](https://secure.travis-ci.org/banister/binding_of_caller.png)](http://travis-ci.org/banister/binding_of_caller)
1
+ [![Build Status](https://github.com/banister/binding_of_caller/workflows/Test/badge.svg?branch=master&event=push)](https://github.com/banister/binding_of_caller/actions?query=branch%3Amaster)
2
+ [![Gem Version](https://img.shields.io/gem/v/binding_of_caller.svg)](https://rubygems.org/gems/binding_of_caller)
2
3
 
3
4
  binding_of_caller
4
- ===========
5
+ =================
5
6
 
6
7
  (C) John Mair (banisterfiend) 2012
7
8
 
8
- _Retrieve the binding of a method's caller in MRI (>= 1.9.2) and RBX (Rubinius)_
9
+ _Retrieve the binding of a method's caller in MRI (>= 2.0.0) and RBX (Rubinius)_
9
10
 
10
11
  The `binding_of_caller` gem provides the `Binding#of_caller` method.
11
12
 
@@ -15,7 +16,7 @@ call stack, not limited to just the immediate caller.
15
16
 
16
17
  **Recommended for use only in debugging situations. Do not use this in production apps.**
17
18
 
18
- **Works in MRI Ruby (>= 1.9.2) and RBX (Rubinius)**
19
+ **Works in MRI Ruby (>= 2.0) and RBX (Rubinius)**
19
20
 
20
21
  * Install the [gem](https://rubygems.org/gems/binding_of_caller): `gem install binding_of_caller`
21
22
  * See the [source code](http://github.com/banister/binding_of_caller)
@@ -52,12 +53,20 @@ This project is a spinoff from the [Pry REPL project.](http://pry.github.com)
52
53
  Features and limitations
53
54
  -------------------------
54
55
 
55
- * Works in MRI (>= 1.9.2) and RBX (Rubinius)
56
+ * Works in MRI (>= 2.0.0) and RBX (Rubinius)
57
+ * For MRI 1.9.x, use version "~> 0.8" of the gem, which included support for MRI before 2.0.
56
58
  * Does not work in 1.8.7, but there is a well known (continuation-based) hack to get a `Binding#of_caller` there.
57
59
  * There is experimental support for jruby 1.7.x, but it only works in interpreted
58
60
  mode (i.e. use the option `-Djruby.compile.mode=OFF` or append
59
61
  `compile.mode=OFF` to your `.jrubyrc`)
60
62
 
63
+ Development
64
+ -----------
65
+
66
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
67
+
68
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
69
+
61
70
  Contact
62
71
  -------
63
72
 
data/Rakefile CHANGED
@@ -1,134 +1,6 @@
1
- dlext = RbConfig::CONFIG['DLEXT']
2
- direc = File.dirname(__FILE__)
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
3
 
4
- $:.unshift 'lib'
4
+ RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- require 'rake/clean'
7
- require 'rubygems/package_task'
8
-
9
- require "binding_of_caller/version"
10
-
11
- CLOBBER.include("**/*.#{dlext}", "**/*~", "**/*#*", "**/*.log", "**/*.o")
12
- CLEAN.include("ext/**/*.#{dlext}", "ext/**/*.log", "ext/**/*.o",
13
- "ext/**/*~", "ext/**/*#*", "ext/**/*.obj", "**/*#*", "**/*#*.*",
14
- "ext/**/*.def", "ext/**/*.pdb", "**/*_flymake*.*", "**/*_flymake", "**/*.rbc")
15
-
16
- def mri_2?
17
- defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby" &&
18
- RUBY_VERSION =~ /^2/
19
- end
20
-
21
- def apply_spec_defaults(s)
22
- s.name = "binding_of_caller"
23
- s.summary = "Retrieve the binding of a method's caller. Can also retrieve bindings even further up the stack."
24
- s.version = BindingOfCaller::VERSION
25
- s.date = Time.now.strftime '%Y-%m-%d'
26
- s.author = "John Mair (banisterfiend)"
27
- s.email = 'jrmair@gmail.com'
28
- s.description = s.summary
29
- s.require_path = 'lib'
30
- s.add_dependency 'debug_inspector', '>= 0.0.1'
31
- s.add_development_dependency 'bacon'
32
- s.add_development_dependency 'rake'
33
- s.homepage = "http://github.com/banister/binding_of_caller"
34
- s.has_rdoc = 'yard'
35
- s.files = `git ls-files`.split("\n")
36
- s.test_files = `git ls-files -- test/*`.split("\n")
37
- end
38
-
39
- desc "Show version"
40
- task :version do
41
- puts "BindingOfCaller version: #{BindingOfCaller::VERSION}"
42
- end
43
-
44
- desc "run tests"
45
- task :default => [:test]
46
-
47
- desc "Run tests"
48
- task :test do
49
- unless defined?(Rubinius) or defined?(JRuby)
50
- Rake::Task['compile'].execute
51
- end
52
-
53
- $stdout.puts("\033[33m")
54
- sh "bacon -Itest -r rubygems -a -q"
55
- $stdout.puts("\033[0m")
56
-
57
- unless defined?(Rubinius)
58
- Rake::Task['cleanup'].execute
59
- end
60
- end
61
-
62
- task :pry do
63
- puts "loading binding_of_caller into pry"
64
- sh "pry -r ./lib/binding_of_caller"
65
- end
66
-
67
- desc "generate gemspec"
68
- task :gemspec => "ruby:gemspec"
69
-
70
- namespace :ruby do
71
- spec = Gem::Specification.new do |s|
72
- apply_spec_defaults(s)
73
- s.platform = Gem::Platform::RUBY
74
- s.extensions = ["ext/binding_of_caller/extconf.rb"]
75
- end
76
-
77
- Gem::PackageTask.new(spec) do |pkg|
78
- pkg.need_zip = false
79
- pkg.need_tar = false
80
- end
81
-
82
- desc "Generate gemspec file"
83
- task :gemspec do
84
- File.open("#{spec.name}.gemspec", "w") do |f|
85
- f << spec.to_ruby
86
- end
87
- end
88
- end
89
-
90
- desc "build the binaries"
91
- task :compile => :cleanup do
92
- if !mri_2?
93
- chdir "./ext/binding_of_caller/" do
94
- sh "ruby extconf.rb"
95
- sh "make"
96
- sh "cp *.#{dlext} ../../lib/"
97
- end
98
- end
99
- end
100
-
101
- desc 'cleanup the extensions'
102
- task :cleanup do
103
- if !mri_2?
104
- sh 'rm -rf lib/binding_of_caller.so'
105
- chdir "./ext/binding_of_caller/" do
106
- sh 'make clean'
107
- end
108
- end
109
- end
110
-
111
- desc "reinstall gem"
112
- task :reinstall => :gems do
113
- sh "gem uninstall binding_of_caller" rescue nil
114
- sh "gem install #{direc}/pkg/binding_of_caller-#{BindingOfCaller::VERSION}.gem"
115
- end
116
-
117
- task :install => :reinstall
118
-
119
- desc "build all platform gems at once"
120
- task :gems => [:clean, :rmgems, "ruby:gem"]
121
-
122
- task :gem => [:gems]
123
-
124
- desc "remove all platform gems"
125
- task :rmgems => ["ruby:clobber_package"]
126
-
127
- desc "build and push latest gems"
128
- task :pushgems => :gems do
129
- chdir("./pkg") do
130
- Dir["*.gem"].each do |gemfile|
131
- sh "gem push #{gemfile}"
132
- end
133
- end
134
- end
6
+ task :default => :spec
@@ -1,39 +1,35 @@
1
- # -*- encoding: utf-8 -*-
2
- # stub: binding_of_caller 0.8.0 ruby lib
3
- # stub: ext/binding_of_caller/extconf.rb
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "binding_of_caller".freeze
7
- s.version = "0.8.0"
8
-
9
- s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
10
- s.require_paths = ["lib".freeze]
11
- s.authors = ["John Mair (banisterfiend)".freeze]
12
- s.date = "2018-01-10"
13
- s.description = "Retrieve the binding of a method's caller. Can also retrieve bindings even further up the stack.".freeze
14
- s.email = "jrmair@gmail.com".freeze
15
- s.extensions = ["ext/binding_of_caller/extconf.rb".freeze]
16
- s.files = [".gemtest".freeze, ".gitignore".freeze, ".travis.yml".freeze, ".yardopts".freeze, "Gemfile".freeze, "HISTORY".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "binding_of_caller.gemspec".freeze, "examples/benchmark.rb".freeze, "examples/example.rb".freeze, "ext/binding_of_caller/binding_of_caller.c".freeze, "ext/binding_of_caller/extconf.rb".freeze, "ext/binding_of_caller/ruby_headers/192/debug.h".freeze, "ext/binding_of_caller/ruby_headers/192/dln.h".freeze, "ext/binding_of_caller/ruby_headers/192/eval_intern.h".freeze, "ext/binding_of_caller/ruby_headers/192/id.h".freeze, "ext/binding_of_caller/ruby_headers/192/iseq.h".freeze, "ext/binding_of_caller/ruby_headers/192/method.h".freeze, "ext/binding_of_caller/ruby_headers/192/node.h".freeze, "ext/binding_of_caller/ruby_headers/192/regenc.h".freeze, "ext/binding_of_caller/ruby_headers/192/regint.h".freeze, "ext/binding_of_caller/ruby_headers/192/regparse.h".freeze, "ext/binding_of_caller/ruby_headers/192/rubys_gc.h".freeze, "ext/binding_of_caller/ruby_headers/192/thread_pthread.h".freeze, "ext/binding_of_caller/ruby_headers/192/thread_win32.h".freeze, "ext/binding_of_caller/ruby_headers/192/timev.h".freeze, "ext/binding_of_caller/ruby_headers/192/transcode_data.h".freeze, "ext/binding_of_caller/ruby_headers/192/version.h".freeze, "ext/binding_of_caller/ruby_headers/192/vm_core.h".freeze, "ext/binding_of_caller/ruby_headers/192/vm_exec.h".freeze, "ext/binding_of_caller/ruby_headers/192/vm_insnhelper.h".freeze, "ext/binding_of_caller/ruby_headers/192/vm_opts.h".freeze, "ext/binding_of_caller/ruby_headers/193/addr2line.h".freeze, "ext/binding_of_caller/ruby_headers/193/atomic.h".freeze, "ext/binding_of_caller/ruby_headers/193/constant.h".freeze, "ext/binding_of_caller/ruby_headers/193/debug.h".freeze, "ext/binding_of_caller/ruby_headers/193/dln.h".freeze, "ext/binding_of_caller/ruby_headers/193/encdb.h".freeze, "ext/binding_of_caller/ruby_headers/193/eval_intern.h".freeze, "ext/binding_of_caller/ruby_headers/193/id.h".freeze, "ext/binding_of_caller/ruby_headers/193/internal.h".freeze, "ext/binding_of_caller/ruby_headers/193/iseq.h".freeze, "ext/binding_of_caller/ruby_headers/193/method.h".freeze, "ext/binding_of_caller/ruby_headers/193/node.h".freeze, "ext/binding_of_caller/ruby_headers/193/parse.h".freeze, "ext/binding_of_caller/ruby_headers/193/regenc.h".freeze, "ext/binding_of_caller/ruby_headers/193/regint.h".freeze, "ext/binding_of_caller/ruby_headers/193/regparse.h".freeze, "ext/binding_of_caller/ruby_headers/193/revision.h".freeze, "ext/binding_of_caller/ruby_headers/193/rubys_gc.h".freeze, "ext/binding_of_caller/ruby_headers/193/thread_pthread.h".freeze, "ext/binding_of_caller/ruby_headers/193/thread_win32.h".freeze, "ext/binding_of_caller/ruby_headers/193/timev.h".freeze, "ext/binding_of_caller/ruby_headers/193/transcode_data.h".freeze, "ext/binding_of_caller/ruby_headers/193/transdb.h".freeze, "ext/binding_of_caller/ruby_headers/193/version.h".freeze, "ext/binding_of_caller/ruby_headers/193/vm_core.h".freeze, "ext/binding_of_caller/ruby_headers/193/vm_exec.h".freeze, "ext/binding_of_caller/ruby_headers/193/vm_insnhelper.h".freeze, "ext/binding_of_caller/ruby_headers/193/vm_opts.h".freeze, "lib/binding_of_caller.rb".freeze, "lib/binding_of_caller/jruby_interpreted.rb".freeze, "lib/binding_of_caller/mri2.rb".freeze, "lib/binding_of_caller/rubinius.rb".freeze, "lib/binding_of_caller/version.rb".freeze, "test/test_binding_of_caller.rb".freeze]
17
- s.homepage = "http://github.com/banister/binding_of_caller".freeze
18
- s.rubygems_version = "2.6.14".freeze
19
- s.summary = "Retrieve the binding of a method's caller. Can also retrieve bindings even further up the stack.".freeze
20
- s.test_files = ["test/test_binding_of_caller.rb".freeze]
21
-
22
- if s.respond_to? :specification_version then
23
- s.specification_version = 4
24
-
25
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
- s.add_runtime_dependency(%q<debug_inspector>.freeze, [">= 0.0.1"])
27
- s.add_development_dependency(%q<bacon>.freeze, [">= 0"])
28
- s.add_development_dependency(%q<rake>.freeze, [">= 0"])
29
- else
30
- s.add_dependency(%q<debug_inspector>.freeze, [">= 0.0.1"])
31
- s.add_dependency(%q<bacon>.freeze, [">= 0"])
32
- s.add_dependency(%q<rake>.freeze, [">= 0"])
33
- end
34
- else
35
- s.add_dependency(%q<debug_inspector>.freeze, [">= 0.0.1"])
36
- s.add_dependency(%q<bacon>.freeze, [">= 0"])
37
- s.add_dependency(%q<rake>.freeze, [">= 0"])
1
+ require_relative 'lib/binding_of_caller/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "binding_of_caller"
5
+ spec.version = BindingOfCaller::VERSION
6
+ spec.authors = ["John Mair (banisterfiend)"]
7
+ spec.email = ["jrmair@gmail.com"]
8
+
9
+ spec.summary = %q{Retrieve the binding of a method's caller, or further up the stack.}
10
+ spec.description = <<-TXT
11
+ Provides the Binding#of_caller method.
12
+
13
+ Using binding_of_caller we can grab bindings from higher up the call stack and evaluate code in that context.
14
+ Allows access to bindings arbitrarily far up the call stack, not limited to just the immediate caller.
15
+
16
+ Recommended for use only in debugging situations. Do not use this in production apps.
17
+ TXT
18
+ spec.homepage = "https://github.com/banister/binding_of_caller"
19
+ spec.license = "MIT"
20
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.0.0")
21
+
22
+ spec.metadata = {
23
+ "changelog_uri" => "https://github.com/banister/binding_of_caller/releases",
24
+ }
25
+
26
+ # Specify which files should be added to the gem when it is released.
27
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
28
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
29
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|examples|bin)/}) }
38
30
  end
31
+
32
+ spec.require_paths = ["lib"]
33
+
34
+ spec.add_dependency "debug_inspector", ">= 1.2.0"
39
35
  end
@@ -18,7 +18,7 @@ module BindingOfCaller
18
18
  def callers
19
19
  ary = []
20
20
 
21
- RubyVM::DebugInspector.open do |dc|
21
+ DebugInspector.open do |dc|
22
22
  locs = dc.backtrace_locations
23
23
 
24
24
  locs.size.times do |i|
@@ -43,7 +43,7 @@ module BindingOfCaller
43
43
  # @return [Symbol]
44
44
  def frame_type
45
45
  return nil if !@iseq
46
-
46
+
47
47
  # apparently the 9th element of the iseq array holds the frame type
48
48
  # ...not sure how reliable this is.
49
49
  @frame_type ||= @iseq.to_a[9]
@@ -1,3 +1,3 @@
1
1
  module BindingOfCaller
2
- VERSION = "0.8.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -1,12 +1,11 @@
1
- dlext = RbConfig::CONFIG['DLEXT']
1
+ require "binding_of_caller/version"
2
2
 
3
- mri_2 = defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby" &&
4
- RUBY_VERSION =~ /^2/
5
-
6
- if mri_2
7
- require 'binding_of_caller/mri2'
8
- elsif defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby"
9
- require "binding_of_caller.#{dlext}"
3
+ if defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby"
4
+ if RUBY_VERSION =~ /^[23]/
5
+ require 'binding_of_caller/mri'
6
+ else
7
+ puts "This version of binding_of_caller doesn't support this version of Ruby"
8
+ end
10
9
  elsif defined?(Rubinius)
11
10
  require 'binding_of_caller/rubinius'
12
11
  elsif defined?(JRuby)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: binding_of_caller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 1.0.1
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: 2018-01-10 00:00:00.000000000 Z
11
+ date: 2024-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug_inspector
@@ -16,121 +16,46 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.1
19
+ version: 1.2.0
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
- version: 0.0.1
27
- - !ruby/object:Gem::Dependency
28
- name: bacon
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rake
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- description: Retrieve the binding of a method's caller. Can also retrieve bindings
56
- even further up the stack.
57
- email: jrmair@gmail.com
26
+ version: 1.2.0
27
+ description: |
28
+ Provides the Binding#of_caller method.
29
+
30
+ Using binding_of_caller we can grab bindings from higher up the call stack and evaluate code in that context.
31
+ Allows access to bindings arbitrarily far up the call stack, not limited to just the immediate caller.
32
+
33
+ Recommended for use only in debugging situations. Do not use this in production apps.
34
+ email:
35
+ - jrmair@gmail.com
58
36
  executables: []
59
- extensions:
60
- - ext/binding_of_caller/extconf.rb
37
+ extensions: []
61
38
  extra_rdoc_files: []
62
39
  files:
63
40
  - ".gemtest"
41
+ - ".github/workflows/test.yml"
64
42
  - ".gitignore"
65
- - ".travis.yml"
66
43
  - ".yardopts"
67
44
  - Gemfile
68
- - HISTORY
69
45
  - LICENSE
70
46
  - README.md
71
47
  - Rakefile
72
48
  - binding_of_caller.gemspec
73
- - examples/benchmark.rb
74
- - examples/example.rb
75
- - ext/binding_of_caller/binding_of_caller.c
76
- - ext/binding_of_caller/extconf.rb
77
- - ext/binding_of_caller/ruby_headers/192/debug.h
78
- - ext/binding_of_caller/ruby_headers/192/dln.h
79
- - ext/binding_of_caller/ruby_headers/192/eval_intern.h
80
- - ext/binding_of_caller/ruby_headers/192/id.h
81
- - ext/binding_of_caller/ruby_headers/192/iseq.h
82
- - ext/binding_of_caller/ruby_headers/192/method.h
83
- - ext/binding_of_caller/ruby_headers/192/node.h
84
- - ext/binding_of_caller/ruby_headers/192/regenc.h
85
- - ext/binding_of_caller/ruby_headers/192/regint.h
86
- - ext/binding_of_caller/ruby_headers/192/regparse.h
87
- - ext/binding_of_caller/ruby_headers/192/rubys_gc.h
88
- - ext/binding_of_caller/ruby_headers/192/thread_pthread.h
89
- - ext/binding_of_caller/ruby_headers/192/thread_win32.h
90
- - ext/binding_of_caller/ruby_headers/192/timev.h
91
- - ext/binding_of_caller/ruby_headers/192/transcode_data.h
92
- - ext/binding_of_caller/ruby_headers/192/version.h
93
- - ext/binding_of_caller/ruby_headers/192/vm_core.h
94
- - ext/binding_of_caller/ruby_headers/192/vm_exec.h
95
- - ext/binding_of_caller/ruby_headers/192/vm_insnhelper.h
96
- - ext/binding_of_caller/ruby_headers/192/vm_opts.h
97
- - ext/binding_of_caller/ruby_headers/193/addr2line.h
98
- - ext/binding_of_caller/ruby_headers/193/atomic.h
99
- - ext/binding_of_caller/ruby_headers/193/constant.h
100
- - ext/binding_of_caller/ruby_headers/193/debug.h
101
- - ext/binding_of_caller/ruby_headers/193/dln.h
102
- - ext/binding_of_caller/ruby_headers/193/encdb.h
103
- - ext/binding_of_caller/ruby_headers/193/eval_intern.h
104
- - ext/binding_of_caller/ruby_headers/193/id.h
105
- - ext/binding_of_caller/ruby_headers/193/internal.h
106
- - ext/binding_of_caller/ruby_headers/193/iseq.h
107
- - ext/binding_of_caller/ruby_headers/193/method.h
108
- - ext/binding_of_caller/ruby_headers/193/node.h
109
- - ext/binding_of_caller/ruby_headers/193/parse.h
110
- - ext/binding_of_caller/ruby_headers/193/regenc.h
111
- - ext/binding_of_caller/ruby_headers/193/regint.h
112
- - ext/binding_of_caller/ruby_headers/193/regparse.h
113
- - ext/binding_of_caller/ruby_headers/193/revision.h
114
- - ext/binding_of_caller/ruby_headers/193/rubys_gc.h
115
- - ext/binding_of_caller/ruby_headers/193/thread_pthread.h
116
- - ext/binding_of_caller/ruby_headers/193/thread_win32.h
117
- - ext/binding_of_caller/ruby_headers/193/timev.h
118
- - ext/binding_of_caller/ruby_headers/193/transcode_data.h
119
- - ext/binding_of_caller/ruby_headers/193/transdb.h
120
- - ext/binding_of_caller/ruby_headers/193/version.h
121
- - ext/binding_of_caller/ruby_headers/193/vm_core.h
122
- - ext/binding_of_caller/ruby_headers/193/vm_exec.h
123
- - ext/binding_of_caller/ruby_headers/193/vm_insnhelper.h
124
- - ext/binding_of_caller/ruby_headers/193/vm_opts.h
125
49
  - lib/binding_of_caller.rb
126
50
  - lib/binding_of_caller/jruby_interpreted.rb
127
- - lib/binding_of_caller/mri2.rb
51
+ - lib/binding_of_caller/mri.rb
128
52
  - lib/binding_of_caller/rubinius.rb
129
53
  - lib/binding_of_caller/version.rb
130
- - test/test_binding_of_caller.rb
131
- homepage: http://github.com/banister/binding_of_caller
132
- licenses: []
133
- metadata: {}
54
+ homepage: https://github.com/banister/binding_of_caller
55
+ licenses:
56
+ - MIT
57
+ metadata:
58
+ changelog_uri: https://github.com/banister/binding_of_caller/releases
134
59
  post_install_message:
135
60
  rdoc_options: []
136
61
  require_paths:
@@ -139,18 +64,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
139
64
  requirements:
140
65
  - - ">="
141
66
  - !ruby/object:Gem::Version
142
- version: '0'
67
+ version: 2.0.0
143
68
  required_rubygems_version: !ruby/object:Gem::Requirement
144
69
  requirements:
145
70
  - - ">="
146
71
  - !ruby/object:Gem::Version
147
72
  version: '0'
148
73
  requirements: []
149
- rubyforge_project:
150
- rubygems_version: 2.6.14
74
+ rubygems_version: 3.0.3.1
151
75
  signing_key:
152
76
  specification_version: 4
153
- summary: Retrieve the binding of a method's caller. Can also retrieve bindings even
154
- further up the stack.
155
- test_files:
156
- - test/test_binding_of_caller.rb
77
+ summary: Retrieve the binding of a method's caller, or further up the stack.
78
+ test_files: []