{"id":13879631,"url":"https://github.com/teohm/require_reloader","last_synced_at":"2025-07-16T15:32:44.481Z","repository":{"id":6263649,"uuid":"7496707","full_name":"teohm/require_reloader","owner":"teohm","description":"Auto-reload require files or local gems without restarting server in Rails development.","archived":false,"fork":true,"pushed_at":"2021-03-15T13:02:18.000Z","size":130,"stargazers_count":137,"open_issues_count":6,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-11T23:59:00.367Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"colinyoung/gem_reloader","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teohm.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}},"created_at":"2013-01-08T06:19:46.000Z","updated_at":"2024-08-31T02:17:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/teohm/require_reloader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teohm%2Frequire_reloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teohm%2Frequire_reloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teohm%2Frequire_reloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teohm%2Frequire_reloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teohm","download_url":"https://codeload.github.com/teohm/require_reloader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226143895,"owners_count":17580245,"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-08-06T08:02:27.285Z","updated_at":"2024-11-24T08:31:35.508Z","avatar_url":"https://github.com/teohm.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# RequireReloader\n\n[![Gem Version](https://badge.fury.io/rb/require_reloader.png)](http://badge.fury.io/rb/require_reloader)\n\nAuto-reload `require` files or local gems without restarting server\nduring Rails development.\n\nCurrently, it supports Rails 3+ and above, including 3.1 and 3.2.\n\nIt uses `ActionDispatch::Callbacks.to_prepare` to reload the\n`require` files before each request. In Rails 3.2, it uses\n`watchable_dirs` to reload only when you modify a file. More details in [this blog post](http://teohm.github.com/blog/2013/01/10/reload-required-files-in-rails/).\n\n## Usage\n\nGiven a `Gemfile`\n\n    # Gemfile\n    gem 'my_gem',  :path =\u003e '~/work/my_gem'\n    gem 'my_gem2', :path =\u003e '~/fun/my_gem2', :module_name =\u003e 'MYGEM2'\n\nTo reload all **local gems** (the ones with `:path` attribute,\nor using [local git repo](http://gembundler.com/v1.2/git.html#local)):\n\n    # config/environments/development.rb\n    YourApp::Application.configure do\n      ...\n      RequireReloader.watch_local_gems!\n    end\n\nTo reload a specific local gem:\n\n    RequireReloader.watch :my_gem\n\nYou can also **reload a `.rb` file in `lib`** or any directory:\n\n    RequireReloader.watch :half_baked_gem  # in lib dir\n    RequireReloader.watch :foo, :path =\u003e 'app/models'\n\nThe `:path` option is *optional*. In **Rails 3.2**, `:path` value is added into `watchable_dirs`. Rails 3.1 and 3.0 ignore this value.\n\nThe `:module_name` option is *optional*. By default, it is assumed that the top-level module is a CamelCase version of the gem name.\nIf this is not the case, you can pass this option, a String. This value will also be picked up if included in the metadata of the gemspec,\nas in `spec.metadata = {'module_name' =\u003e 'MYMOD'}`.\n\nRequireReloader adds `lib` into `watchable_dirs`. So, specify `:path`\nonly if it is not specified in `Gemfile` and the file is located in other directory.\n\n    RequireReloader.watch :foo, :callback =\u003e lambda { |gem| puts \"#{gem} got reloaded\" }\n\nYou can supply a Proc with the *optional* `:callback` option. This proc gets called everytime after your gem got reloaded.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'require_reloader'\n\nAnd then execute:\n\n    $ bundle\n\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Credits\n\nThis gem is forked from Colin Young's [gem_reloader](https://github.com/colinyoung/gem_reloader), based on [a solution by Timothy Cardenas](http://timcardenas.com/automatically-reload-gems-in-rails-327-on-eve), inspired by [a post from Leitch](http://ileitch.github.com/2012/03/24/rails-32-code-reloading-from-lib.html).\n\n### Contributors\n- @sven-winkler: trigger callback after gem reloaded (issue #2)\n- @aceofspades: support gem metadata :module_name in Gemfile (issue #4)\n\n## Changelog\n- v0.2.1: Add Rails 5.1 support ([pull request](https://github.com/teohm/require_reloader/pull/7) from @kibenimatik)\n- v0.2.0: Support module_name option/spec-metadata\n- v0.1.6: RequireReloader::watch accepts :callback, runs it after gem reloaded ([pull request](https://github.com/teohm/require_reloader/pull/2) from @sven-winkler).\n- v0.1.5: properly guess top-level module name based on gem name\npattern, only watch git repo if it's local.\n- v0.1.4: remove 'vendor/gems' from watchable_dirs \u0026 autoload_paths, as local gem path is already specified in Gemfile.\n- v0.1.3: Skip reload local gem if it's itself; added integration tests.\n- v0.1.2: Minor rephrase on gem's description and summary.\n- v0.1.1: Use Bundler to fetch local gems info, instead of parsing Gemfile by hand.\n- v0.1.0: Forked colinyoung/gem_reloader, renamed \u0026 major rewrite to support Rails 3.2 and new features.\n- v0.0.2: Added \"vendor/gems\" to the config.autoload_paths so the user doesn't have to.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteohm%2Frequire_reloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteohm%2Frequire_reloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteohm%2Frequire_reloader/lists"}