{"id":13428067,"url":"https://github.com/banister/binding_of_caller","last_synced_at":"2025-05-14T13:04:14.711Z","repository":{"id":55475374,"uuid":"2585324","full_name":"banister/binding_of_caller","owner":"banister","description":"Retrieve the binding of a method's caller in MRI 1.9.2+","archived":false,"fork":false,"pushed_at":"2024-03-06T23:56:25.000Z","size":399,"stargazers_count":663,"open_issues_count":1,"forks_count":42,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-05-03T07:02:32.538Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/banister.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-10-16T08:39:12.000Z","updated_at":"2025-04-28T07:32:01.000Z","dependencies_parsed_at":"2024-03-08T20:31:17.469Z","dependency_job_id":null,"html_url":"https://github.com/banister/binding_of_caller","commit_stats":{"total_commits":136,"total_committers":16,"mean_commits":8.5,"dds":"0.49264705882352944","last_synced_commit":"7edf4b494a8af981dda8a3d18cd8ff8fd400df32"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banister%2Fbinding_of_caller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banister%2Fbinding_of_caller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banister%2Fbinding_of_caller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banister%2Fbinding_of_caller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/banister","download_url":"https://codeload.github.com/banister/binding_of_caller/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252166981,"owners_count":21705014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T01:00:45.324Z","updated_at":"2025-05-14T13:04:14.652Z","avatar_url":"https://github.com/banister.png","language":"Ruby","funding_links":[],"categories":["Debug","Ruby"],"sub_categories":["Omniauth"],"readme":"[![Build Status](https://github.com/banister/binding_of_caller/workflows/Test/badge.svg?branch=master\u0026event=push)](https://github.com/banister/binding_of_caller/actions?query=branch%3Amaster)\n[![Gem Version](https://img.shields.io/gem/v/binding_of_caller.svg)](https://rubygems.org/gems/binding_of_caller)\n\nbinding_of_caller\n=================\n\n(C) John Mair (banisterfiend) 2012\n\n_Retrieve the binding of a method's caller in MRI (\u003e= 2.0.0) and RBX (Rubinius)_\n\nThe `binding_of_caller` gem provides the `Binding#of_caller` method.\n\nUsing `binding_of_caller` we can grab bindings from higher up the call\nstack and evaluate code in that context. Allows access to bindings arbitrarily far up the\ncall stack, not limited to just the immediate caller.\n\n**Recommended for use only in debugging situations. Do not use this in production apps.**\n\n**Works in MRI Ruby (\u003e= 2.0) and RBX (Rubinius)**\n\n* Install the [gem](https://rubygems.org/gems/binding_of_caller): `gem install binding_of_caller`\n* See the [source code](http://github.com/banister/binding_of_caller)\n\nExample: Modifying a local inside the caller of a caller\n--------\n\n```ruby\ndef a\n  var = 10\n  b\n  puts var\nend\n\ndef b\n  c\nend\n\ndef c\n  binding.of_caller(2).eval('var = :hello')\nend\n\na()\n\n# OUTPUT\n# =\u003e hello\n```\n\nSpinoff project\n-------\n\nThis project is a spinoff from the [Pry REPL project.](http://pry.github.com)\n\nFeatures and limitations\n-------------------------\n\n* Works in MRI (\u003e= 2.0.0) and RBX (Rubinius)\n* For MRI 1.9.x, use version \"~\u003e 0.8\" of the gem, which included support for MRI before 2.0.\n* Does not work in 1.8.7, but there is a well known (continuation-based) hack to get a `Binding#of_caller` there.\n* There is experimental support for jruby 1.7.x, but it only works in interpreted\nmode (i.e. use the option `-Djruby.compile.mode=OFF` or append\n`compile.mode=OFF` to your `.jrubyrc`)\n\nDevelopment\n-----------\n\nAfter 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.\n\nTo 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).\n\nContact\n-------\n\nProblems or questions contact me at [github](http://github.com/banister)\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2012 (John Mair)\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanister%2Fbinding_of_caller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbanister%2Fbinding_of_caller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanister%2Fbinding_of_caller/lists"}