1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Setup explicit requires for files with exceptions. Removed them from autoloading.

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
Łukasz Strzałkowski 2010-08-11 21:56:22 +02:00 committed by José Valim
parent c5c839f75f
commit 38a421b34d
27 changed files with 32 additions and 16 deletions

View file

@ -43,21 +43,6 @@ module ActionController
eager_autoload do eager_autoload do
autoload :RecordIdentifier 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
end end

View file

@ -1,3 +1,5 @@
require 'action_controller/metal/exceptions'
module ActionController module ActionController
module Compatibility module Compatibility
extend ActiveSupport::Concern extend ActiveSupport::Concern

View file

@ -1,3 +1,5 @@
require 'action_controller/metal/exceptions'
module ActionController module ActionController
class RedirectBackError < AbstractController::Error #:nodoc: 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"].' 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"].'

View file

@ -1,4 +1,5 @@
require 'active_support/core_ext/class/attribute' require 'active_support/core_ext/class/attribute'
require 'action_controller/metal/exceptions'
module ActionController #:nodoc: module ActionController #:nodoc:
class InvalidAuthenticityToken < ActionControllerError #:nodoc: class InvalidAuthenticityToken < ActionControllerError #:nodoc:

View file

@ -1,4 +1,5 @@
require 'active_support/core_ext/file/path' require 'active_support/core_ext/file/path'
require 'action_controller/metal/exceptions'
module ActionController #:nodoc: module ActionController #:nodoc:
# Methods for sending arbitrary data and for streaming files to the browser, # Methods for sending arbitrary data and for streaming files to the browser,

View file

@ -5,6 +5,7 @@ require 'strscan'
require 'active_support/core_ext/hash/indifferent_access' require 'active_support/core_ext/hash/indifferent_access'
require 'active_support/core_ext/string/access' require 'active_support/core_ext/string/access'
require 'action_dispatch/http/headers' require 'action_dispatch/http/headers'
require 'action_controller/metal/exceptions'
module ActionDispatch module ActionDispatch
class Request < Rack::Request class Request < Rack::Request

View file

@ -1,6 +1,7 @@
require 'active_support/core_ext/exception' require 'active_support/core_ext/exception'
require 'active_support/notifications' require 'active_support/notifications'
require 'action_dispatch/http/request' require 'action_dispatch/http/request'
require 'action_controller/metal/exceptions'
module ActionDispatch module ActionDispatch
# This middleware rescues any exception returned by the application and renders # This middleware rescues any exception returned by the application and renders

View file

@ -1,6 +1,7 @@
require 'active_support/core_ext/object/blank' require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/object/with_options' require 'active_support/core_ext/object/with_options'
require 'active_support/core_ext/object/try' require 'active_support/core_ext/object/try'
require 'action_controller/metal/exceptions'
module ActionDispatch module ActionDispatch
module Routing module Routing

View file

@ -2,6 +2,7 @@ require 'rack/mount'
require 'forwardable' require 'forwardable'
require 'active_support/core_ext/object/to_query' require 'active_support/core_ext/object/to_query'
require 'action_dispatch/routing/deprecated_mapper' require 'action_dispatch/routing/deprecated_mapper'
require 'action_controller/metal/exceptions'
module ActionDispatch module ActionDispatch
module Routing module Routing

View file

@ -1,6 +1,7 @@
require "pathname" require "pathname"
require "active_support/core_ext/class" require "active_support/core_ext/class"
require "action_view/template" require "action_view/template"
require 'action_controller/metal/exceptions'
module ActionView module ActionView
# = Action View Resolver # = Action View Resolver

View file

@ -1,4 +1,5 @@
require 'abstract_unit' require 'abstract_unit'
require 'action_controller/metal/exceptions'
class WorkshopsController < ActionController::Base class WorkshopsController < ActionController::Base
end end

View file

@ -1,4 +1,5 @@
require 'abstract_unit' require 'abstract_unit'
require 'action_controller/metal/exceptions'
module ActionDispatch module ActionDispatch
class ShowExceptions class ShowExceptions

View file

@ -1,5 +1,6 @@
require 'abstract_unit' require 'abstract_unit'
require 'active_support/core_ext/object/try' require 'active_support/core_ext/object/try'
require 'action_controller/metal/exceptions'
class ResourcesController < ActionController::Base class ResourcesController < ActionController::Base
def index() render :nothing => true end def index() render :nothing => true end

View file

@ -2,6 +2,7 @@
require 'abstract_unit' require 'abstract_unit'
require 'controller/fake_controllers' require 'controller/fake_controllers'
require 'active_support/dependencies' require 'active_support/dependencies'
require 'action_controller/metal/exceptions'
class MilestonesController < ActionController::Base class MilestonesController < ActionController::Base
def index() head :ok end def index() head :ok end

View file

@ -1,4 +1,5 @@
require 'abstract_unit' require 'abstract_unit'
require 'action_controller/metal/exceptions'
class RequestTest < ActiveSupport::TestCase class RequestTest < ActiveSupport::TestCase
test "remote ip" do test "remote ip" do

View file

@ -1,6 +1,7 @@
require 'erb' require 'erb'
require 'abstract_unit' require 'abstract_unit'
require 'controller/fake_controllers' require 'controller/fake_controllers'
require 'action_controller/metal/exceptions'
class TestRoutingMapper < ActionDispatch::IntegrationTest class TestRoutingMapper < ActionDispatch::IntegrationTest
SprocketsApp = lambda { |env| SprocketsApp = lambda { |env|

View file

@ -1,4 +1,5 @@
require 'abstract_unit' require 'abstract_unit'
require 'action_controller/metal/exceptions'
module ActionDispatch module ActionDispatch
class ShowExceptions class ShowExceptions

View file

@ -1,6 +1,7 @@
require 'active_support/core_ext/array/wrap' require 'active_support/core_ext/array/wrap'
require "active_support/core_ext/module/anonymous" require "active_support/core_ext/module/anonymous"
require 'active_support/core_ext/object/blank' require 'active_support/core_ext/object/blank'
require 'action_controller/metal/exceptions'
module ActiveModel #:nodoc: module ActiveModel #:nodoc:

View file

@ -22,6 +22,7 @@ require 'active_support/core_ext/object/blank'
require 'arel' require 'arel'
require 'active_record/errors' require 'active_record/errors'
require 'active_record/log_subscriber' require 'active_record/log_subscriber'
require 'action_controller/metal/exceptions'
module ActiveRecord #:nodoc: module ActiveRecord #:nodoc:
# = Active Record # = Active Record

View file

@ -1,4 +1,5 @@
require 'active_support/core_ext/array/wrap' require 'active_support/core_ext/array/wrap'
require 'action_controller/metal/exceptions'
module ActiveRecord module ActiveRecord
module ConnectionAdapters # :nodoc: module ConnectionAdapters # :nodoc:

View file

@ -1,5 +1,6 @@
require 'active_support/core_ext/kernel/singleton_class' require 'active_support/core_ext/kernel/singleton_class'
require 'active_support/core_ext/module/aliasing' require 'active_support/core_ext/module/aliasing'
require 'action_controller/metal/exceptions'
module ActiveRecord module ActiveRecord
# Exception that can be raised to stop migrations from going backwards. # Exception that can be raised to stop migrations from going backwards.

View file

@ -1,3 +1,5 @@
require 'action_controller/metal/exceptions'
module ActiveRecord module ActiveRecord
# = Active Record Session Store # = Active Record Session Store
# #

View file

@ -1,8 +1,9 @@
require 'active_support/core_ext/benchmark'
require 'net/https' require 'net/https'
require 'date' require 'date'
require 'time' require 'time'
require 'uri' require 'uri'
require 'active_support/core_ext/benchmark'
require 'action_controller/metal/exceptions'
module ActiveResource module ActiveResource
# Class to handle connections to remote web services. # Class to handle connections to remote web services.

View file

@ -1,3 +1,5 @@
require 'action_controller/metal/exceptions'
module ActiveResource module ActiveResource
class ConnectionError < StandardError # :nodoc: class ConnectionError < StandardError # :nodoc:
attr_reader :response attr_reader :response

View file

@ -1,4 +1,5 @@
require 'abstract_unit' require 'abstract_unit'
require 'action_controller/metal/exceptions'
class ConnectionTest < Test::Unit::TestCase class ConnectionTest < Test::Unit::TestCase
ResponseCodeStub = Struct.new(:code) ResponseCodeStub = Struct.new(:code)

View file

@ -9,6 +9,7 @@ require 'active_support/core_ext/numeric/bytes'
require 'active_support/core_ext/numeric/time' require 'active_support/core_ext/numeric/time'
require 'active_support/core_ext/object/to_param' require 'active_support/core_ext/object/to_param'
require 'active_support/core_ext/string/inflections' require 'active_support/core_ext/string/inflections'
require 'action_controller/metal/exceptions'
module ActiveSupport module ActiveSupport
# See ActiveSupport::Cache::Store for documentation. # See ActiveSupport::Cache::Store for documentation.

View file

@ -1,3 +1,5 @@
require 'action_controller/metal/exceptions'
begin begin
require 'securerandom' require 'securerandom'
rescue LoadError rescue LoadError