diff options
author | Carlhuda <carlhuda@engineyard.com> | 2009-12-23 14:55:12 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2009-12-23 16:13:09 -0800 |
commit | 38aeb1528c376f7a058beea6db0a328720b85f01 (patch) | |
tree | c7bb623d13b49e7861e531ec05ba4f2f2c770a0b /railties/lib/rails/configuration.rb | |
parent | fa8dfc7d014f6768599077b79a874894e13d317f (diff) | |
download | rails-38aeb1528c376f7a058beea6db0a328720b85f01.tar.gz rails-38aeb1528c376f7a058beea6db0a328720b85f01.tar.bz2 rails-38aeb1528c376f7a058beea6db0a328720b85f01.zip |
Moving out some framework specific initializers into the framework libraries.
Diffstat (limited to 'railties/lib/rails/configuration.rb')
-rw-r--r-- | railties/lib/rails/configuration.rb | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/railties/lib/rails/configuration.rb b/railties/lib/rails/configuration.rb index bf5b9478cc..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 = [] |