Created
January 7, 2011 02:23
-
-
Save aiwilliams/769013 to your computer and use it in GitHub Desktop.
config/initializers/reload_hack.rb
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" | |
lib_reloader = ActiveSupport::FileUpdateChecker.new(Dir["app/grape/api/**/*"], true) do | |
Rails.application.reload_routes! # or do something better here | |
end | |
ActionDispatch::Callbacks.to_prepare do | |
lib_reloader.execute_if_updated | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment