diff options
Diffstat (limited to 'actionpack/lib/action_controller/dispatch')
-rw-r--r-- | actionpack/lib/action_controller/dispatch/dispatcher.rb | 16 | ||||
-rw-r--r-- | actionpack/lib/action_controller/dispatch/middlewares.rb | 18 |
2 files changed, 4 insertions, 30 deletions
diff --git a/actionpack/lib/action_controller/dispatch/dispatcher.rb b/actionpack/lib/action_controller/dispatch/dispatcher.rb index 9ad1cadfd3..e04da42637 100644 --- a/actionpack/lib/action_controller/dispatch/dispatcher.rb +++ b/actionpack/lib/action_controller/dispatch/dispatcher.rb @@ -7,15 +7,6 @@ module ActionController cattr_accessor :prepare_each_request self.prepare_each_request = false - cattr_accessor :router - self.router = Routing::Routes - - cattr_accessor :middleware - self.middleware = ActionDispatch::MiddlewareStack.new do |middleware| - middlewares = File.join(File.dirname(__FILE__), "middlewares.rb") - middleware.instance_eval(File.read(middlewares), middlewares, 1) - end - class << self def define_dispatcher_callbacks(cache_classes) unless cache_classes @@ -24,7 +15,7 @@ module ActionController # Development mode callbacks ActionDispatch::Callbacks.before_dispatch do |app| - ActionController::Dispatcher.router.reload + ActionController::Routing::Routes.reload end ActionDispatch::Callbacks.after_dispatch do @@ -54,11 +45,12 @@ module ActionController end end - delegate :to_prepare, :prepare_dispatch, :before_dispatch, :after_dispatch, + delegate :to_prepare, :before_dispatch, :around_dispatch, :after_dispatch, :to => ActionDispatch::Callbacks def new - @@middleware.build(@@router) + # DEPRECATE Rails application fallback + Rails.application end end end diff --git a/actionpack/lib/action_controller/dispatch/middlewares.rb b/actionpack/lib/action_controller/dispatch/middlewares.rb deleted file mode 100644 index b25ed3fd3f..0000000000 --- a/actionpack/lib/action_controller/dispatch/middlewares.rb +++ /dev/null @@ -1,18 +0,0 @@ -use "Rack::Lock", :if => lambda { - !ActionController::Base.allow_concurrency -} - -use "ActionDispatch::ShowExceptions", lambda { ActionController::Base.consider_all_requests_local } -use "ActionDispatch::Callbacks", lambda { ActionController::Dispatcher.prepare_each_request } -use "ActionDispatch::Rescue", lambda { - controller = (::ApplicationController rescue ActionController::Base) - # TODO: Replace with controller.action(:_rescue_action) - controller.method(:rescue_action) -} - -use lambda { ActionController::Base.session_store }, - lambda { ActionController::Base.session_options } - -use "ActionDispatch::ParamsParser" -use "Rack::MethodOverride" -use "Rack::Head"
\ No newline at end of file |