-
-
Save artero/d55459b8aaf94d8454fdde7099713f9b to your computer and use it in GitHub Desktop.
Reload gem from library in Rails 5+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if Rails.env.development? | |
localistico_files = Dir['lib/localistico/*.rb'] + ['lib/localistico.rb'] | |
reloader = ActiveSupport::FileUpdateChecker.new(localistico_files) do | |
localistico_files.each { |file| load file } | |
end | |
ActiveSupport::Reloader.to_prepare do | |
reloader.execute_if_updated | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment