{"id":22980969,"url":"https://github.com/rubyworks/backload","last_synced_at":"2025-08-13T17:33:40.806Z","repository":{"id":3146074,"uuid":"4175540","full_name":"rubyworks/backload","owner":"rubyworks","description":"Shouldn't loading have a callback?","archived":false,"fork":false,"pushed_at":"2018-09-27T12:22:47.000Z","size":868,"stargazers_count":3,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-01T17:52:43.719Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/rubyworks.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-04-29T16:06:30.000Z","updated_at":"2022-10-12T11:48:57.000Z","dependencies_parsed_at":"2022-08-19T11:41:46.330Z","dependency_job_id":null,"html_url":"https://github.com/rubyworks/backload","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubyworks%2Fbackload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubyworks%2Fbackload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubyworks%2Fbackload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubyworks%2Fbackload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubyworks","download_url":"https://codeload.github.com/rubyworks/backload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229773540,"owners_count":18122031,"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-12-15T01:46:19.529Z","updated_at":"2024-12-15T01:46:20.151Z","avatar_url":"https://github.com/rubyworks.png","language":"Ruby","readme":"[Homepage](http://rubygems.org/gems/backload) |\n[Report Issue](http://github.com/rubyworks/backload/issues) |\n[Source Code](http://github.com/rubyworks/backload) \n( [![Build Status](https://secure.travis-ci.org/rubyworks/backload.png)](http://travis-ci.org/rubyworks/backload) )\n\n\n# Backload\n\nShouldn't loading have a callback?\n\n\n## Installation\n\nUsing RubyGems type on a command line:\n\n    $ gem install backload\n\n\n## Instruction\n\nTo use Backload simply override the `Kernel.backloaded` method.\n\n```ruby\n  require 'backload'\n  require 'backload/require_relative'\n\n  def Kernel.backloaded(feature, options={})\n    if options[:require]\n      if rel = options[:relative]\n        puts \"#{feature} has been required relative to #{rel}!\"\n      else\n        puts \"#{feature} has been required!\"\n      end\n    else\n      if wrap = options[:wrap]\n        puts \"#{feature} has been loaded with wrap, it's #{wrap}!\"  \n      else\n        puts \"#{feature} has been loaded!\" \n      end\n    end\n  end\n```\n\nBecuase of implementation details, `#require_relative` has to be reimplemented completely \nto make the callback work. To be on the safe side, at least for now, it therefore has to\nbe required separately, as the example above demonstrates.\n\nBackload also provides callbacks for each type of loading. Just use the past tense\nof the term for any of `#load`, `#require` and `#require_relative`. For example, to\nsee all features as they have been required.\n\n```ruby\n  def Kernel.required(feature)\n    puts \"#{feature} required!\"\n  end\n```\n\n## Feedback\n\nPlease report issues or suggestions to\n[GitHub Issues](http://github.com/rubyworks/backload/issues).\nOr if you wish to discuss in real-time try [IRC #rubyworks](irc://chat.us.freenet.org/rubyworks) on freenode.net.\n\n\n## Copying\n\nBackload is copyrighted open source software.\n\n    Copyright 2012 Rubyworks.\n\nIt is modifiable and redistributable in accordance with the\n**BSD-2-Clause** license.\n\nSee LICENSE.txt for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyworks%2Fbackload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubyworks%2Fbackload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyworks%2Fbackload/lists"}