Move reloader middleware in ActionDispatch

This commit is contained in:
Joshua Peek 2009-04-14 17:06:32 -05:00
parent 1d2686517c
commit d7396b5ca9
4 changed files with 6 additions and 6 deletions

@ -57,7 +57,6 @@ def self.load_all!
autoload :PolymorphicRoutes, 'action_controller/routing/generation/polymorphic_routes'
autoload :RecordIdentifier, 'action_controller/record_identifier'
autoload :Redirector, 'action_controller/base/redirect'
autoload :Reloader, 'action_controller/reloader'
autoload :Renderer, 'action_controller/base/render'
autoload :RequestForgeryProtection, 'action_controller/base/request_forgery_protection'
autoload :Rescue, 'action_controller/dispatch/rescue'

@ -5,8 +5,8 @@ class Dispatcher
class << self
def define_dispatcher_callbacks(cache_classes)
unless cache_classes
unless self.middleware.include?(Reloader)
self.middleware.insert_after(ActionDispatch::Failsafe, Reloader)
unless self.middleware.include?(ActionDispatch::Reloader)
self.middleware.insert_after(ActionDispatch::Failsafe, ActionDispatch::Reloader)
end
ActionView::Helpers::AssetTagHelper.cache_asset_timestamps = false

@ -46,6 +46,7 @@ module ActionDispatch
autoload :Failsafe, 'action_dispatch/middleware/failsafe'
autoload :ParamsParser, 'action_dispatch/middleware/params_parser'
autoload :Reloader, 'action_dispatch/middleware/reloader'
autoload :RewindableInput, 'action_dispatch/middleware/rewindable_input'
autoload :MiddlewareStack, 'action_dispatch/middleware/stack'

@ -1,14 +1,14 @@
module ActionController
module ActionDispatch
class Reloader
def initialize(app)
@app = app
end
def call(env)
Dispatcher.reload_application
ActionController::Dispatcher.reload_application
@app.call(env)
ensure
Dispatcher.cleanup_application
ActionController::Dispatcher.cleanup_application
end
end
end