{"id":15877534,"url":"https://github.com/zimbatm/methodchain","last_synced_at":"2025-07-24T15:35:56.410Z","repository":{"id":583252,"uuid":"216632","full_name":"zimbatm/methodchain","owner":"zimbatm","description":"Replace methods in an existing class but keep super","archived":false,"fork":false,"pushed_at":"2023-12-15T05:30:55.000Z","size":5,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-09T07:52:21.912Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zimbatm.png","metadata":{"files":{"readme":"README.rdoc","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2009-06-02T17:55:23.000Z","updated_at":"2017-05-26T01:47:40.000Z","dependencies_parsed_at":"2023-12-15T06:46:02.916Z","dependency_job_id":null,"html_url":"https://github.com/zimbatm/methodchain","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zimbatm/methodchain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbatm%2Fmethodchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbatm%2Fmethodchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbatm%2Fmethodchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbatm%2Fmethodchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zimbatm","download_url":"https://codeload.github.com/zimbatm/methodchain/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbatm%2Fmethodchain/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266862632,"owners_count":23996867,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-06T02:01:47.080Z","updated_at":"2025-07-24T15:35:56.382Z","avatar_url":"https://github.com/zimbatm.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"= MethodChain\n\nMethodChain#chain_method is a replacement of alias_method_chain\n\nInstead of aliasing the method, it moves the original method in a module\nand includes it in the class. That way, you can still use the super keyworkd.\n\nIf you look at your class ancestors, you can see the #\u003cBackup:...\u003e\ninstance with the method name, the reason if it was given and where it\nwas called. That way, it is easy to keep track at runtime what methods\nwhere replaced and where.\n\nExtend your object with this module to add the MethodChain#chain_method method \n(see method definition for more doc)\n\n== Usage\n  \n  require 'methodchain'\n  \n  class MyClass\n    extend MethodChain\n    def mymeth; \"hello\" end\n    chain_method :mymeth, \"replace original\"\n    def mymeth; super + \"world\" end\n  end\n  MyClass.new.mymeth #=\u003e \"helloworld\"\n  MyClass.ancestors \n  #=\u003e [MyClass, \n  # #\u003cMethodChain::Backup:0x614cc #mymeth,\"replace original\",\"/opt/local/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding'\"\u003e, \n  # Object, Kernel]\n\n== Features\n\n* 100% test coverage\n* One file implementation, easy to put in your project\n* Lots of meta-guru magic\n\n== Project infos\n\nHomepage:: http://github.com/zimbatm/methodchain\nLicence:: public domain\n\n== Stability \u0026 bug report\n\nThe current version has 100% test coverage. However, it was not used in\nlots of real-world projects. If you find an error, report to \nhttp://github.com/zimbatm/methodchain\n\n== Ruby 1.9 notes\n\nThis current implementation does not work with ruby 1.9 because define_method\nnow uses Method#bind, which does not allow binding to other classes.\n\nNext version will probably implement a bouncer module to intercept super calls\nand bind the methods to the current class. That way, it should work in ruby1.9\nwithout hacking the internals. It should also allow re-ordering the call order.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimbatm%2Fmethodchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzimbatm%2Fmethodchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimbatm%2Fmethodchain/lists"}