Skip to content

Instantly share code, notes, and snippets.

@aiwilliams
Created January 7, 2011 02:23
Show Gist options
  • Save aiwilliams/769013 to your computer and use it in GitHub Desktop.
Save aiwilliams/769013 to your computer and use it in GitHub Desktop.
config/initializers/reload_hack.rb
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