Skip to content

Commit

Permalink
Revert "Setup explicit requires for files with exceptions. Removed th…
Browse files Browse the repository at this point in the history
…em from autoloading."

Booting a new Rails application does not work after this commit [#5359 state:open]

This reverts commit 38a421b.
  • Loading branch information
josevalim committed Sep 2, 2010
1 parent 13d2a08 commit 599e46b
Show file tree
Hide file tree
Showing 27 changed files with 16 additions and 32 deletions.
15 changes: 15 additions & 0 deletions actionpack/lib/action_controller.rb
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions actionpack/lib/action_controller/metal/compatibility.rb
@@ -1,5 +1,3 @@
require 'action_controller/metal/exceptions'

module ActionController
module Compatibility
extend ActiveSupport::Concern
Expand Down
2 changes: 0 additions & 2 deletions 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"].'
Expand Down
@@ -1,5 +1,4 @@
require 'active_support/core_ext/class/attribute'
require 'action_controller/metal/exceptions'

module ActionController #:nodoc:
class InvalidAuthenticityToken < ActionControllerError #:nodoc:
Expand Down
1 change: 0 additions & 1 deletion 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,
Expand Down
1 change: 0 additions & 1 deletion actionpack/lib/action_dispatch/http/request.rb
Expand Up @@ -5,7 +5,6 @@
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
Expand Down
@@ -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
Expand Down
@@ -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
Expand Down
1 change: 0 additions & 1 deletion actionpack/lib/action_dispatch/routing/route_set.rb
Expand Up @@ -2,7 +2,6 @@
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
Expand Down
1 change: 0 additions & 1 deletion 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
Expand Down
1 change: 0 additions & 1 deletion actionpack/test/controller/redirect_test.rb
@@ -1,5 +1,4 @@
require 'abstract_unit'
require 'action_controller/metal/exceptions'

class WorkshopsController < ActionController::Base
end
Expand Down
1 change: 0 additions & 1 deletion actionpack/test/controller/rescue_test.rb
@@ -1,5 +1,4 @@
require 'abstract_unit'
require 'action_controller/metal/exceptions'

module ActionDispatch
class ShowExceptions
Expand Down
1 change: 0 additions & 1 deletion 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
Expand Down
1 change: 0 additions & 1 deletion actionpack/test/controller/routing_test.rb
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion 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
Expand Down
1 change: 0 additions & 1 deletion 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|
Expand Down
1 change: 0 additions & 1 deletion actionpack/test/dispatch/show_exceptions_test.rb
@@ -1,5 +1,4 @@
require 'abstract_unit'
require 'action_controller/metal/exceptions'

module ActionDispatch
class ShowExceptions
Expand Down
1 change: 0 additions & 1 deletion activemodel/lib/active_model/validator.rb
@@ -1,7 +1,6 @@
require 'active_support/core_ext/array/wrap'
require "active_support/core_ext/module/anonymous"
require 'active_support/core_ext/object/blank'
require 'action_controller/metal/exceptions'

module ActiveModel #:nodoc:

Expand Down
1 change: 0 additions & 1 deletion activerecord/lib/active_record/base.rb
Expand Up @@ -22,7 +22,6 @@
require 'arel'
require 'active_record/errors'
require 'active_record/log_subscriber'
require 'action_controller/metal/exceptions'

module ActiveRecord #:nodoc:
# = Active Record
Expand Down
@@ -1,5 +1,4 @@
require 'active_support/core_ext/array/wrap'
require 'action_controller/metal/exceptions'

module ActiveRecord
module ConnectionAdapters # :nodoc:
Expand Down
1 change: 0 additions & 1 deletion activerecord/lib/active_record/migration.rb
@@ -1,6 +1,5 @@
require 'active_support/core_ext/kernel/singleton_class'
require 'active_support/core_ext/module/aliasing'
require 'action_controller/metal/exceptions'

module ActiveRecord
# Exception that can be raised to stop migrations from going backwards.
Expand Down
2 changes: 0 additions & 2 deletions activerecord/lib/active_record/session_store.rb
@@ -1,5 +1,3 @@
require 'action_controller/metal/exceptions'

module ActiveRecord
# = Active Record Session Store
#
Expand Down
3 changes: 1 addition & 2 deletions activeresource/lib/active_resource/connection.rb
@@ -1,9 +1,8 @@
require 'active_support/core_ext/benchmark'
require 'net/https'
require 'date'
require 'time'
require 'uri'
require 'active_support/core_ext/benchmark'
require 'action_controller/metal/exceptions'

module ActiveResource
# Class to handle connections to remote web services.
Expand Down
2 changes: 0 additions & 2 deletions activeresource/lib/active_resource/exceptions.rb
@@ -1,5 +1,3 @@
require 'action_controller/metal/exceptions'

module ActiveResource
class ConnectionError < StandardError # :nodoc:
attr_reader :response
Expand Down
1 change: 0 additions & 1 deletion activeresource/test/connection_test.rb
@@ -1,5 +1,4 @@
require 'abstract_unit'
require 'action_controller/metal/exceptions'

class ConnectionTest < Test::Unit::TestCase
ResponseCodeStub = Struct.new(:code)
Expand Down
1 change: 0 additions & 1 deletion activesupport/lib/active_support/cache.rb
Expand Up @@ -9,7 +9,6 @@
require 'active_support/core_ext/numeric/time'
require 'active_support/core_ext/object/to_param'
require 'active_support/core_ext/string/inflections'
require 'action_controller/metal/exceptions'

module ActiveSupport
# See ActiveSupport::Cache::Store for documentation.
Expand Down
2 changes: 0 additions & 2 deletions activesupport/lib/active_support/secure_random.rb
@@ -1,5 +1,3 @@
require 'action_controller/metal/exceptions'

begin
require 'securerandom'
rescue LoadError
Expand Down

0 comments on commit 599e46b

Please sign in to comment.