diff options
author | José Valim <jose.valim@gmail.com> | 2010-09-02 21:10:29 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-02 21:11:03 +0200 |
commit | 599e46bf24419a429ee0bb0ea02afd48f47aa4ec (patch) | |
tree | 725252bd044bd41ec1952be7a65265576302dc2a /actionpack | |
parent | 13d2a081645db873379668b6f21e449201b6b036 (diff) | |
download | rails-599e46bf24419a429ee0bb0ea02afd48f47aa4ec.tar.gz rails-599e46bf24419a429ee0bb0ea02afd48f47aa4ec.tar.bz2 rails-599e46bf24419a429ee0bb0ea02afd48f47aa4ec.zip |
Revert "Setup explicit requires for files with exceptions. Removed them from autoloading."
Booting a new Rails application does not work after this commit [#5359 state:open]
This reverts commit 38a421b34d0b414564e919f67d339fac067a56e6.
Diffstat (limited to 'actionpack')
17 files changed, 15 insertions, 18 deletions
diff --git a/actionpack/lib/action_controller.rb b/actionpack/lib/action_controller.rb index 34fae1d893..e02578eafd 100644 --- a/actionpack/lib/action_controller.rb +++ b/actionpack/lib/action_controller.rb @@ -43,6 +43,21 @@ 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 dc711e31a9..7a9c91f563 100644 --- a/actionpack/lib/action_controller/metal/compatibility.rb +++ b/actionpack/lib/action_controller/metal/compatibility.rb @@ -1,5 +1,3 @@ -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 ab5238bea4..b5f1d23ef0 100644 --- a/actionpack/lib/action_controller/metal/redirecting.rb +++ b/actionpack/lib/action_controller/metal/redirecting.rb @@ -1,5 +1,3 @@ -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 04d53e2ba1..fc3118671f 100644 --- a/actionpack/lib/action_controller/metal/request_forgery_protection.rb +++ b/actionpack/lib/action_controller/metal/request_forgery_protection.rb @@ -1,5 +1,4 @@ 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 debb2e1c35..d75b46dace 100644 --- a/actionpack/lib/action_controller/metal/streaming.rb +++ b/actionpack/lib/action_controller/metal/streaming.rb @@ -1,5 +1,4 @@ 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 7eccd23dab..5606d6abfe 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -5,7 +5,6 @@ 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 9355b9c657..ef0c9c51f5 100644 --- a/actionpack/lib/action_dispatch/middleware/show_exceptions.rb +++ b/actionpack/lib/action_dispatch/middleware/show_exceptions.rb @@ -1,7 +1,6 @@ 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 c97cbfe1f1..e04062ce8b 100644 --- a/actionpack/lib/action_dispatch/routing/deprecated_mapper.rb +++ b/actionpack/lib/action_dispatch/routing/deprecated_mapper.rb @@ -1,7 +1,6 @@ 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 e6803b2722..b531cc1a8e 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -2,7 +2,6 @@ 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 38765dd8ef..c9e20ca14e 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -1,7 +1,6 @@ require "pathname" require "active_support/core_ext/class" require "action_view/template" -require 'action_controller/metal/exceptions' module ActionView # = Action View Resolver diff --git a/actionpack/test/controller/redirect_test.rb b/actionpack/test/controller/redirect_test.rb index 7315c4eed1..441bc47908 100644 --- a/actionpack/test/controller/redirect_test.rb +++ b/actionpack/test/controller/redirect_test.rb @@ -1,5 +1,4 @@ require 'abstract_unit' -require 'action_controller/metal/exceptions' class WorkshopsController < ActionController::Base end diff --git a/actionpack/test/controller/rescue_test.rb b/actionpack/test/controller/rescue_test.rb index f8c2bc9505..f476db3792 100644 --- a/actionpack/test/controller/rescue_test.rb +++ b/actionpack/test/controller/rescue_test.rb @@ -1,5 +1,4 @@ require 'abstract_unit' -require 'action_controller/metal/exceptions' module ActionDispatch class ShowExceptions diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb index a7c02f4253..4505cdabae 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -1,6 +1,5 @@ require 'abstract_unit' require 'active_support/core_ext/object/try' -require 'action_controller/metal/exceptions' class ResourcesController < ActionController::Base def index() render :nothing => true end diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 2bb278d09c..a8c74a6064 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -2,7 +2,6 @@ require 'abstract_unit' require 'controller/fake_controllers' require 'active_support/dependencies' -require 'action_controller/metal/exceptions' class MilestonesController < ActionController::Base def index() head :ok end diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb index 1f434c487a..546c4cb253 100644 --- a/actionpack/test/dispatch/request_test.rb +++ b/actionpack/test/dispatch/request_test.rb @@ -1,5 +1,4 @@ require 'abstract_unit' -require 'action_controller/metal/exceptions' class RequestTest < ActiveSupport::TestCase test "remote ip" do diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index c48b1b0eb1..c90c1041ed 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -1,7 +1,6 @@ require 'erb' require 'abstract_unit' require 'controller/fake_controllers' -require 'action_controller/metal/exceptions' class TestRoutingMapper < ActionDispatch::IntegrationTest SprocketsApp = lambda { |env| diff --git a/actionpack/test/dispatch/show_exceptions_test.rb b/actionpack/test/dispatch/show_exceptions_test.rb index 123e1b187e..4966527f4d 100644 --- a/actionpack/test/dispatch/show_exceptions_test.rb +++ b/actionpack/test/dispatch/show_exceptions_test.rb @@ -1,5 +1,4 @@ require 'abstract_unit' -require 'action_controller/metal/exceptions' module ActionDispatch class ShowExceptions |