https://github.com/banister/binding_of_caller
Retrieve the binding of a method's caller in MRI 1.9.2+
https://github.com/banister/binding_of_caller
Keywords from Contributors
activerecord mvc activejob pry rack crash-reporting rubygems rspec reflection irb
Last synced: about 22 hours ago
JSON representation
Repository metadata
Retrieve the binding of a method's caller in MRI 1.9.2+
- Host: GitHub
- URL: https://github.com/banister/binding_of_caller
- Owner: banister
- License: other
- Created: 2011-10-16T08:39:12.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2026-02-15T13:09:42.000Z (16 days ago)
- Last Synced: 2026-02-27T19:57:47.490Z (4 days ago)
- Language: Ruby
- Homepage:
- Size: 396 KB
- Stars: 670
- Watchers: 18
- Forks: 55
- Open Issues: 3
- Releases: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
README.md
binding_of_caller
(C) John Mair (banisterfiend) 2012
Retrieve the binding of a method's caller in MRI (>= 2.0.0) and RBX (Rubinius)
The binding_of_caller gem provides the Binding#of_caller method.
Using binding_of_caller we can grab bindings from higher up the call
stack and evaluate code in that context. Allows access to bindings arbitrarily far up the
call stack, not limited to just the immediate caller.
Recommended for use only in debugging situations. Do not use this in production apps.
Works in MRI Ruby (>= 2.0) and RBX (Rubinius)
- Install the gem:
gem install binding_of_caller - See the source code
Example: Modifying a local inside the caller of a caller
def a
var = 10
b
puts var
end
def b
c
end
def c
binding.of_caller(2).eval('var = :hello')
end
a()
# OUTPUT
# => hello
Spinoff project
This project is a spinoff from the Pry REPL project.
Features and limitations
- Works in MRI (>= 2.0.0) and RBX (Rubinius)
- For MRI 1.9.x, use version "~> 0.8" of the gem, which included support for MRI before 2.0.
- Does not work in 1.8.7, but there is a well known (continuation-based) hack to get a
Binding#of_callerthere. - There is experimental support for jruby 1.7.x, but it only works in interpreted
mode (i.e. use the option-Djruby.compile.mode=OFFor append
compile.mode=OFFto your.jrubyrc)
Development
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.
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.
Contact
Problems or questions contact me at github
License
(The MIT License)
Copyright (c) 2012 (John Mair)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Owner metadata
- Name: John Mair
- Login: banister
- Email:
- Kind: user
- Description: I created Pry, binding_of_caller, method_source, debug_inspector, and so on
- Website: http://twitter.com/banisterfiend
- Location: The Hague, Netherlands
- Twitter:
- Company: Secret
- Icon url: https://avatars.githubusercontent.com/u/17518?u=67690ef926a5f4bee3fcc01091b6b2ece18fe9ee&v=4
- Repositories: 76
- Last ynced at: 2023-04-09T03:40:22.037Z
- Profile URL: https://github.com/banister
GitHub Events
Total
- Fork event: 2
- Issues event: 1
- Watch event: 8
- Issue comment event: 3
- Push event: 2
Last Year
- Fork event: 2
- Issues event: 1
- Watch event: 5
- Issue comment event: 3
- Push event: 2
Committers metadata
Last synced: 1 day ago
Total Commits: 148
Total Committers: 20
Avg Commits per committer: 7.4
Development Distribution Score (DDS): 0.534
Commits in past year: 4
Committers in past year: 3
Avg Commits per committer in past year: 1.333
Development Distribution Score (DDS) in past year: 0.5
| Name | Commits | |
|---|---|---|
| John Mair | j****r@g****m | 69 |
| Amadeus Folego | a****o@g****m | 24 |
| Robin Daugherty | r****n@r****t | 15 |
| Jordon Bedwell | j****n@e****m | 8 |
| Paul Pettengill | p****l@s****m | 7 |
| sanemat | o****n@g****m | 7 |
| Marc-Andre Lafortune | g****b@m****a | 3 |
| Aboobacker MK | a****r@r****o | 2 |
| Carsten Bormann | c****o@t****g | 2 |
| Lennart Fridén | l****t@m****m | 1 |
| Akira Matsuda | r****e@d****p | 1 |
| Asherah Connor | a****r@g****m | 1 |
| Chris Marshall | c****s@c****m | 1 |
| Chris Price | c****s@p****m | 1 |
| David Celis | me@d****s | 1 |
| Eric Schultz | e****z@s****m | 1 |
| Fabien LEFEBVRE | d****d@g****m | 1 |
| Kian-Meng Ang | k****g@c****g | 1 |
| Martin Schürrer | m****n@s****g | 1 |
| Omer Katz | o****w@g****m | 1 |
Committer domains:
- schuerrer.org: 1
- cpan.org: 1
- softwareforgood.com: 1
- davidcel.is: 1
- puppetlabs.com: 1
- chrismar035.com: 1
- gitlab.com: 1
- dio.jp: 1
- magplus.com: 1
- tzi.org: 1
- redpanthers.co: 1
- marc-andre.ca: 1
- simplyinsured.com: 1
- envygeeks.com: 1
- robindaugherty.net: 1
Issue and Pull Request metadata
Last synced: 11 days ago
Total issues: 47
Total pull requests: 48
Average time to close issues: almost 3 years
Average time to close pull requests: 6 months
Total issue authors: 42
Total pull request authors: 30
Average comments per issue: 6.11
Average comments per pull request: 1.46
Merged pull request: 35
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 2
Past year average time to close issues: N/A
Past year average time to close pull requests: 3 months
Past year issue authors: 0
Past year pull request authors: 2
Past year average comments per issue: 0
Past year average comments per pull request: 4.5
Past year merged pull request: 1
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- ni-ka (2)
- badosu (2)
- gsamokovarov (2)
- shreeve (2)
- banister (2)
- JamesDullaghan (1)
- schmijos (1)
- seanjhulse (1)
- chrismo (1)
- apoorvparijat (1)
- tanraya (1)
- DannyBen (1)
- ConradIrwin (1)
- aaronlifton3 (1)
- execat (1)
Top Pull Request Authors
- badosu (7)
- prpetten (6)
- sanemat (3)
- RobinDaugherty (3)
- marcandre (2)
- envygeeks (2)
- kianmeng (2)
- skaes (1)
- cprice404 (1)
- amatsuda (1)
- yuri-zubov (1)
- kivikakk (1)
- thedrow (1)
- mathieujobin (1)
- timoschilling (1)
Top Issue Labels
- not-a-bug (1)
Top Pull Request Labels
Package metadata
- Total packages: 14
-
Total downloads:
- rubygems: 365,336,654 total
- Total docker downloads: 1,226,252,544
- Total dependent packages: 226 (may contain duplicates)
- Total dependent repositories: 177,207 (may contain duplicates)
- Total versions: 77
- Total maintainers: 4
gem.coop: binding_of_caller
Provides the Binding#of_caller method. Using binding_of_caller we can grab bindings from higher up the call stack and evaluate code in that context. Allows access to bindings arbitrarily far up the call stack, not limited to just the immediate caller. Recommended for use only in debugging situations. Do not use this in production apps.
- Homepage: https://github.com/banister/binding_of_caller
- Documentation: http://www.rubydoc.info/gems/binding_of_caller/
- Licenses: MIT
- Latest release: 2.0.0 (published 16 days ago)
- Last Synced: 2026-03-01T20:31:13.466Z (2 days ago)
- Versions: 26
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 182,618,827 Total
- Docker Downloads: 613,126,272
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.059%
- Docker downloads count: 0.094%
- Downloads: 0.141%
- Maintainers (4)
debian-13: ruby-binding-of-caller
- Homepage: https://github.com/banister/binding_of_caller
- Documentation: https://packages.debian.org/trixie/ruby-binding-of-caller
- Licenses: other
- Latest release: 1.0.0-1 (published 19 days ago)
- Last Synced: 2026-02-13T13:13:41.940Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.395%
- Stargazers count: 0.57%
- Forks count: 1.009%
rubygems.org: binding_of_caller
Provides the Binding#of_caller method. Using binding_of_caller we can grab bindings from higher up the call stack and evaluate code in that context. Allows access to bindings arbitrarily far up the call stack, not limited to just the immediate caller. Recommended for use only in debugging situations. Do not use this in production apps.
- Homepage: https://github.com/banister/binding_of_caller
- Documentation: http://www.rubydoc.info/gems/binding_of_caller/
- Licenses: MIT
- Latest release: 2.0.0 (published 16 days ago)
- Last Synced: 2026-03-02T18:31:58.237Z (1 day ago)
- Versions: 26
- Dependent Packages: 226
- Dependent Repositories: 177,207
- Downloads: 182,717,827 Total
- Docker Downloads: 613,126,272
-
Rankings:
- Dependent repos count: 0.098%
- Downloads: 0.144%
- Dependent packages count: 0.171%
- Docker downloads count: 0.2%
- Average: 1.136%
- Stargazers count: 2.267%
- Forks count: 3.934%
- Maintainers (4)
proxy.golang.org: github.com/banister/binding_of_caller
- Homepage:
- Documentation: https://pkg.go.dev/github.com/banister/binding_of_caller#section-documentation
- Licenses: other
- Latest release: v2.0.0+incompatible (published 16 days ago)
- Last Synced: 2026-02-27T22:01:26.174Z (4 days ago)
- Versions: 14
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 6.999%
- Average: 8.173%
- Dependent repos count: 9.346%
guix: ruby-binding-of-caller
Retrieve the binding of a method's caller
- Homepage: https://github.com/banister/binding_of_caller
- Documentation: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/ruby-xyz.scm#n9398
- Licenses: expat
- Latest release: 0.8.0 (published about 24 hours ago)
- Last Synced: 2026-03-02T18:57:52.628Z (about 24 hours ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-20.04: ruby-binding-of-caller
- Homepage: http://github.com/banister/binding_of_caller
- Licenses: other
- Latest release: 0.7.2+debian1-3 (published 18 days ago)
- Last Synced: 2026-02-13T07:10:45.351Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-11: ruby-binding-of-caller
- Homepage: http://github.com/banister/binding_of_caller
- Documentation: https://packages.debian.org/bullseye/ruby-binding-of-caller
- Licenses: other
- Latest release: 0.7.2+debian1-3 (published 21 days ago)
- Last Synced: 2026-02-13T08:18:49.929Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.10: ruby-binding-of-caller
- Homepage: https://github.com/banister/binding_of_caller
- Licenses: other
- Latest release: 1.0.0-1 (published 18 days ago)
- Last Synced: 2026-02-13T18:15:55.193Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-12: ruby-binding-of-caller
- Homepage: https://github.com/banister/binding_of_caller
- Documentation: https://packages.debian.org/bookworm/ruby-binding-of-caller
- Licenses: other
- Latest release: 1.0.0-1 (published 19 days ago)
- Last Synced: 2026-02-12T23:26:01.010Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-22.04: ruby-binding-of-caller
- Homepage: https://github.com/banister/binding_of_caller
- Licenses: other
- Latest release: 1.0.0-1 (published 18 days ago)
- Last Synced: 2026-02-13T13:13:30.890Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-10: ruby-binding-of-caller
- Homepage: http://github.com/banister/binding_of_caller
- Documentation: https://packages.debian.org/buster/ruby-binding-of-caller
- Licenses: other
- Latest release: 0.7.2+debian1-3 (published 20 days ago)
- Last Synced: 2026-02-13T04:19:28.305Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.04: ruby-binding-of-caller
- Homepage: https://github.com/banister/binding_of_caller
- Licenses: other
- Latest release: 1.0.0-1 (published 21 days ago)
- Last Synced: 2026-02-11T06:36:18.069Z (21 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
Dependencies
- rake >= 0
- rspec >= 0
- debug_inspector >= 0.0.1
- actions/checkout v2 composite
- ruby/setup-ruby v1 composite
Score: 30.695588551461068