![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Auto-reload require
files or local gems without restarting server
during Rails development.
Currently, it supports Rails 3+ and above, including 3.1 and 3.2.
It uses ActionDispatch::Callbacks.to_prepare
to reload the
require
files before each request. In Rails 3.2, it uses
watchable_dirs
to reload only when you modify a file. More details in this blog post.
Given a Gemfile
# Gemfile
gem 'my_gem', :path => '~/work/my_gem'
gem 'my_gem2', :path => '~/fun/my_gem2', :module_name => 'MYGEM2'
To reload all local gems (the ones with :path
attribute,
or using local git repo):
# config/environments/development.rb
YourApp::Application.configure do
...
RequireReloader.watch_local_gems!
end
To reload a specific local gem:
RequireReloader.watch :my_gem
You can also reload a .rb
file in lib
or any directory:
RequireReloader.watch :half_baked_gem # in lib dir
RequireReloader.watch :foo, :path => 'app/models'
The :path
option is optional. In Rails 3.2, :path
value is added into watchable_dirs
. Rails 3.1 and 3.0 ignore this value.
The :module_name
option is optional. By default, it is assumed that the top-level module is a CamelCase version of the gem name.
If 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,
as in spec.metadata = {'module_name' => 'MYMOD'}
.
RequireReloader adds lib
into watchable_dirs
. So, specify :path
only if it is not specified in Gemfile
and the file is located in other directory.
RequireReloader.watch :foo, :callback => lambda { |gem| puts "#{gem} got reloaded" }
You can supply a Proc with the optional :callback
option. This proc gets called everytime after your gem got reloaded.
Add this line to your application's Gemfile:
gem 'require_reloader'
And then execute:
$ bundle
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)This gem is forked from Colin Young's gem_reloader, based on a solution by Timothy Cardenas, inspired by a post from Leitch.
FAQs
Unknown package
We found that require_reloader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.