diff options
author | Łukasz Strzałkowski <lukasz.strzalkowski@gmail.com> | 2010-08-11 21:56:22 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-02 11:54:04 +0200 |
commit | 38a421b34d0b414564e919f67d339fac067a56e6 (patch) | |
tree | 049be1f37edf18d380b9e8716e2a3165b67be71e /actionpack/lib | |
parent | c5c839f75f332b02f85fc74f5d1b1347cba411ff (diff) | |
download | rails-38a421b34d0b414564e919f67d339fac067a56e6.tar.gz rails-38a421b34d0b414564e919f67d339fac067a56e6.tar.bz2 rails-38a421b34d0b414564e919f67d339fac067a56e6.zip |
Setup explicit requires for files with exceptions. Removed them from autoloading.
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib')
10 files changed, 11 insertions, 15 deletions
diff --git a/actionpack/lib/action_controller.rb b/actionpack/lib/action_controller.rb index e02578eafd..34fae1d893 100644 --- a/actionpack/lib/action_controller.rb +++ b/actionpack/lib/action_controller.rb @@ -43,21 +43,6 @@ module ActionController eager_autoload do autoload :RecordIdentifier - - # TODO: Don't autoload exceptions, setup explicit - # requires for files that need them - autoload_at "action_controller/metal/exceptions" do - autoload :ActionControllerError - autoload :RenderError - autoload :RoutingError - autoload :MethodNotAllowed - autoload :NotImplemented - autoload :UnknownController - autoload :MissingFile - autoload :RenderError - autoload :SessionOverflowError - autoload :UnknownHttpMethod - end end end diff --git a/actionpack/lib/action_controller/metal/compatibility.rb b/actionpack/lib/action_controller/metal/compatibility.rb index 7a9c91f563..dc711e31a9 100644 --- a/actionpack/lib/action_controller/metal/compatibility.rb +++ b/actionpack/lib/action_controller/metal/compatibility.rb @@ -1,3 +1,5 @@ +require 'action_controller/metal/exceptions' + module ActionController module Compatibility extend ActiveSupport::Concern diff --git a/actionpack/lib/action_controller/metal/redirecting.rb b/actionpack/lib/action_controller/metal/redirecting.rb index b5f1d23ef0..ab5238bea4 100644 --- a/actionpack/lib/action_controller/metal/redirecting.rb +++ b/actionpack/lib/action_controller/metal/redirecting.rb @@ -1,3 +1,5 @@ +require 'action_controller/metal/exceptions' + module ActionController class RedirectBackError < AbstractController::Error #:nodoc: DEFAULT_MESSAGE = 'No HTTP_REFERER was set in the request to this action, so redirect_to :back could not be called successfully. If this is a test, make sure to specify request.env["HTTP_REFERER"].' diff --git a/actionpack/lib/action_controller/metal/request_forgery_protection.rb b/actionpack/lib/action_controller/metal/request_forgery_protection.rb index fc3118671f..04d53e2ba1 100644 --- a/actionpack/lib/action_controller/metal/request_forgery_protection.rb +++ b/actionpack/lib/action_controller/metal/request_forgery_protection.rb @@ -1,4 +1,5 @@ require 'active_support/core_ext/class/attribute' +require 'action_controller/metal/exceptions' module ActionController #:nodoc: class InvalidAuthenticityToken < ActionControllerError #:nodoc: diff --git a/actionpack/lib/action_controller/metal/streaming.rb b/actionpack/lib/action_controller/metal/streaming.rb index d75b46dace..debb2e1c35 100644 --- a/actionpack/lib/action_controller/metal/streaming.rb +++ b/actionpack/lib/action_controller/metal/streaming.rb @@ -1,4 +1,5 @@ require 'active_support/core_ext/file/path' +require 'action_controller/metal/exceptions' module ActionController #:nodoc: # Methods for sending arbitrary data and for streaming files to the browser, diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index 5606d6abfe..7eccd23dab 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -5,6 +5,7 @@ require 'strscan' require 'active_support/core_ext/hash/indifferent_access' require 'active_support/core_ext/string/access' require 'action_dispatch/http/headers' +require 'action_controller/metal/exceptions' module ActionDispatch class Request < Rack::Request diff --git a/actionpack/lib/action_dispatch/middleware/show_exceptions.rb b/actionpack/lib/action_dispatch/middleware/show_exceptions.rb index ef0c9c51f5..9355b9c657 100644 --- a/actionpack/lib/action_dispatch/middleware/show_exceptions.rb +++ b/actionpack/lib/action_dispatch/middleware/show_exceptions.rb @@ -1,6 +1,7 @@ require 'active_support/core_ext/exception' require 'active_support/notifications' require 'action_dispatch/http/request' +require 'action_controller/metal/exceptions' module ActionDispatch # This middleware rescues any exception returned by the application and renders diff --git a/actionpack/lib/action_dispatch/routing/deprecated_mapper.rb b/actionpack/lib/action_dispatch/routing/deprecated_mapper.rb index e04062ce8b..c97cbfe1f1 100644 --- a/actionpack/lib/action_dispatch/routing/deprecated_mapper.rb +++ b/actionpack/lib/action_dispatch/routing/deprecated_mapper.rb @@ -1,6 +1,7 @@ require 'active_support/core_ext/object/blank' require 'active_support/core_ext/object/with_options' require 'active_support/core_ext/object/try' +require 'action_controller/metal/exceptions' module ActionDispatch module Routing diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index b531cc1a8e..e6803b2722 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -2,6 +2,7 @@ require 'rack/mount' require 'forwardable' require 'active_support/core_ext/object/to_query' require 'action_dispatch/routing/deprecated_mapper' +require 'action_controller/metal/exceptions' module ActionDispatch module Routing diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb index c9e20ca14e..38765dd8ef 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -1,6 +1,7 @@ require "pathname" require "active_support/core_ext/class" require "action_view/template" +require 'action_controller/metal/exceptions' module ActionView # = Action View Resolver |