aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/middleware/reloader.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/reloader.rb')
-rw-r--r--actionpack/lib/action_dispatch/middleware/reloader.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/reloader.rb b/actionpack/lib/action_dispatch/middleware/reloader.rb
new file mode 100644
index 0000000000..67313e30e4
--- /dev/null
+++ b/actionpack/lib/action_dispatch/middleware/reloader.rb
@@ -0,0 +1,14 @@
+module ActionDispatch
+ class Reloader
+ def initialize(app)
+ @app = app
+ end
+
+ def call(env)
+ ActionController::Dispatcher.reload_application
+ @app.call(env)
+ ensure
+ ActionController::Dispatcher.cleanup_application
+ end
+ end
+end