diff options
author | José Valim <jose.valim@gmail.com> | 2009-12-27 12:09:20 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-12-27 12:09:20 +0100 |
commit | 47e5caa96bffc04c8c0b287a975a609fb048e530 (patch) | |
tree | 653d360dc9ad7eb7c5d2338840e15ab8b28a902b /railties/lib/rails/configuration.rb | |
parent | fd58a2d1da04508a7fdf825143e61d186112e63e (diff) | |
parent | d92c4a84023bc0c8dd75869c9b4d5e50277f4650 (diff) | |
download | rails-47e5caa96bffc04c8c0b287a975a609fb048e530.tar.gz rails-47e5caa96bffc04c8c0b287a975a609fb048e530.tar.bz2 rails-47e5caa96bffc04c8c0b287a975a609fb048e530.zip |
Merge Mail with latest Rails and move mail gem to Gemfile.
Diffstat (limited to 'railties/lib/rails/configuration.rb')
-rw-r--r-- | railties/lib/rails/configuration.rb | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/railties/lib/rails/configuration.rb b/railties/lib/rails/configuration.rb index 0fa42091dd..086f67a419 100644 --- a/railties/lib/rails/configuration.rb +++ b/railties/lib/rails/configuration.rb @@ -5,22 +5,26 @@ module Rails # configuration class while this bit is being cleaned up. class Plugin::Configuration - def initialize - @options = Hash.new { |h,k| h[k] = ActiveSupport::OrderedOptions.new } + def self.default + @default ||= new end - def middleware - @middleware ||= ActionDispatch::MiddlewareStack.new + attr_reader :middleware + + def initialize(base = nil) + if base + @options = base.options.dup + @middleware = base.middleware.dup + else + @options = Hash.new { |h,k| h[k] = ActiveSupport::OrderedOptions.new } + @middleware = ActionDispatch::MiddlewareStack.new + end end def respond_to?(name) super || name.to_s =~ config_key_regexp end - def merge(config) - @options = config.options.merge(@options) - end - protected attr_reader :options @@ -41,8 +45,7 @@ module Rails end def config_keys - ([ :active_support, :active_record, :action_controller, - :action_view, :action_mailer, :active_resource ] + + ([ :active_support, :action_view, :action_mailer, :active_resource ] + Plugin.plugin_names).map { |n| n.to_s }.uniq end end @@ -60,7 +63,7 @@ module Rails :log_level, :log_path, :paths, :routes_configuration_file, :view_path - def initialize + def initialize(base = nil) super @load_once_paths = [] @after_initialize_blocks = [] @@ -158,6 +161,10 @@ module Rails @routes_configuration_file ||= File.join(root, 'config', 'routes.rb') end + def builtin_routes_configuration_file + @builtin_routes_configuration_file ||= File.join(RAILTIES_PATH, 'builtin', 'routes.rb') + end + def controller_paths @controller_paths ||= begin paths = [File.join(root, 'app', 'controllers')] |