From 018dafe574d370165547516ffef43394e11ab4da Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sat, 12 Dec 2009 18:41:26 -0600 Subject: Allow autoloads to opt out of eager loading --- actionpack/lib/action_dispatch.rb | 49 +++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 20 deletions(-) (limited to 'actionpack/lib/action_dispatch.rb') 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' -- cgit v1.2.3