diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-12-12 18:41:26 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-12-12 18:41:26 -0600 |
commit | 018dafe574d370165547516ffef43394e11ab4da (patch) | |
tree | 6ad2359b8f00dabee5e1fd46bebb59fc72530f36 /actionpack/lib | |
parent | ee395fe626760e897abd9e881b54d3cc3f407d31 (diff) | |
download | rails-018dafe574d370165547516ffef43394e11ab4da.tar.gz rails-018dafe574d370165547516ffef43394e11ab4da.tar.bz2 rails-018dafe574d370165547516ffef43394e11ab4da.zip |
Allow autoloads to opt out of eager loading
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/deprecated/integration_test.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 1 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch.rb | 49 | ||||
-rwxr-xr-x | actionpack/lib/action_dispatch/http/request.rb | 3 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/test_case.rb | 7 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/testing/integration.rb | 1 |
6 files changed, 31 insertions, 32 deletions
diff --git a/actionpack/lib/action_controller/deprecated/integration_test.rb b/actionpack/lib/action_controller/deprecated/integration_test.rb index 05c8c0f156..86336b6bc4 100644 --- a/actionpack/lib/action_controller/deprecated/integration_test.rb +++ b/actionpack/lib/action_controller/deprecated/integration_test.rb @@ -1,4 +1,2 @@ -require "action_dispatch/testing/integration" - ActionController::Integration = ActionDispatch::Integration ActionController::IntegrationTest = ActionDispatch::IntegrationTest diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 14cd0dc7e0..398ea52495 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -1,7 +1,6 @@ require 'active_support/test_case' require 'rack/session/abstract/id' require 'action_controller/metal/testing' -require 'action_dispatch/test_case' module ActionController class TestRequest < ActionDispatch::TestRequest #:nodoc: diff --git a/actionpack/lib/action_dispatch.rb b/actionpack/lib/action_dispatch.rb index e21dbc59cc..d1c191d652 100644 --- a/actionpack/lib/action_dispatch.rb +++ b/actionpack/lib/action_dispatch.rb @@ -30,38 +30,47 @@ end module ActionDispatch extend ActiveSupport::Autoload - autoload_under "http" do + autoload_under 'http' do autoload :Request autoload :Response autoload :StatusCodes autoload :Utils end - autoload_under "middleware" do - autoload :Callbacks - autoload :ParamsParser - autoload :Rescue - autoload :ShowExceptions - autoload :Static - autoload :StringCoercion - end + deferrable do + autoload_under 'middleware' do + autoload :Callbacks + autoload :ParamsParser + autoload :Rescue + autoload :ShowExceptions + autoload :Static + autoload :StringCoercion + end - autoload :MiddlewareStack, 'action_dispatch/middleware/stack' - autoload :Routing + autoload :MiddlewareStack, 'action_dispatch/middleware/stack' + autoload :Routing - autoload :HTML, 'action_controller/vendor/html-scanner' + module Http + autoload :Headers, 'action_dispatch/http/headers' + end - module Http - extend ActiveSupport::Autoload + module Session + autoload :AbstractStore, 'action_dispatch/middleware/session/abstract_store' + autoload :CookieStore, 'action_dispatch/middleware/session/cookie_store' + autoload :MemCacheStore, 'action_dispatch/middleware/session/mem_cache_store' + end - autoload :Headers + autoload_under 'testing' do + autoload :Assertions + autoload :Integration + autoload :PerformanceTest + autoload :TestProcess + autoload :TestRequest + autoload :TestResponse + end end - module Session - autoload :AbstractStore, 'action_dispatch/middleware/session/abstract_store' - autoload :CookieStore, 'action_dispatch/middleware/session/cookie_store' - autoload :MemCacheStore, 'action_dispatch/middleware/session/mem_cache_store' - end + autoload :HTML, 'action_controller/vendor/html-scanner' end autoload :Mime, 'action_dispatch/http/mime_type' diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index 6a52854961..7d1f5a4504 100755 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -6,6 +6,7 @@ require 'active_support/memoizable' require 'active_support/core_ext/array/wrap' require 'active_support/core_ext/hash/indifferent_access' require 'active_support/core_ext/string/access' +require 'action_dispatch/http/headers' module ActionDispatch class Request < Rack::Request @@ -117,7 +118,7 @@ module ActionDispatch end end end - + def if_modified_since if since = env['HTTP_IF_MODIFIED_SINCE'] Time.rfc2822(since) rescue nil diff --git a/actionpack/lib/action_dispatch/test_case.rb b/actionpack/lib/action_dispatch/test_case.rb deleted file mode 100644 index 0b3dfaae79..0000000000 --- a/actionpack/lib/action_dispatch/test_case.rb +++ /dev/null @@ -1,7 +0,0 @@ -require "rack/test" -require "action_dispatch/testing/assertions" -require "action_dispatch/testing/integration" -require "action_dispatch/testing/performance_test" -require "action_dispatch/testing/test_request" -require "action_dispatch/testing/test_response" -require "action_dispatch/testing/integration"
\ No newline at end of file diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb index 76021dc059..5c127dfe37 100644 --- a/actionpack/lib/action_dispatch/testing/integration.rb +++ b/actionpack/lib/action_dispatch/testing/integration.rb @@ -2,7 +2,6 @@ require 'stringio' require 'uri' require 'active_support/test_case' require 'active_support/core_ext/object/metaclass' -require 'action_dispatch/testing/test_process' require 'rack/test' module ActionDispatch |