diff options
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/initializer.rb | 17 | ||||
-rw-r--r-- | railties/lib/performance_test_help.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/configuration.rb | 1 |
3 files changed, 12 insertions, 8 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index ef0520d7cc..cdf2a22c83 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -101,6 +101,7 @@ module Rails def self.run(initializer = nil, config = nil) default.config = config if config default.config ||= Configuration.new + yield default.config if block_given? default.run(initializer) end end @@ -176,7 +177,8 @@ module Rails # Action Pack, Action Mailer, and Active Resource) are loaded. Initializer.default.add :require_frameworks do begin - require 'active_support/all' + require 'active_support' + require 'active_support/core_ext/kernel/reporting' configuration.frameworks.each { |framework| require(framework.to_s) } rescue LoadError => e # Re-raise as RuntimeError because Mongrel would swallow LoadError. @@ -396,12 +398,15 @@ module Rails end Initializer.default.add :initialize_metal do - Rails::Rack::Metal.requested_metals = configuration.metals - Rails::Rack::Metal.metal_paths += plugin_loader.engine_metal_paths + # TODO: Make Rails and metal work without ActionController + if defined?(ActionController) + Rails::Rack::Metal.requested_metals = configuration.metals + Rails::Rack::Metal.metal_paths += plugin_loader.engine_metal_paths - configuration.middleware.insert_before( - :"ActionDispatch::ParamsParser", - Rails::Rack::Metal, :if => Rails::Rack::Metal.metals.any?) + configuration.middleware.insert_before( + :"ActionDispatch::ParamsParser", + Rails::Rack::Metal, :if => Rails::Rack::Metal.metals.any?) + end end # Add the load paths used by support functions such as the info controller diff --git a/railties/lib/performance_test_help.rb b/railties/lib/performance_test_help.rb index 5148b4ab77..2aaa21e85f 100644 --- a/railties/lib/performance_test_help.rb +++ b/railties/lib/performance_test_help.rb @@ -1,4 +1,4 @@ -require 'action_controller/performance_test' +require 'action_controller/testing/performance_test' ActionController::Base.perform_caching = true ActiveSupport::Dependencies.mechanism = :require diff --git a/railties/lib/rails/configuration.rb b/railties/lib/rails/configuration.rb index c48c989b18..fdb071fc18 100644 --- a/railties/lib/rails/configuration.rb +++ b/railties/lib/rails/configuration.rb @@ -93,7 +93,6 @@ module Rails # TODO: Fix this when there is an application object def middleware - require 'action_controller' ActionController::Dispatcher.middleware end |