aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/configuration.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-12-25 12:09:13 +0100
committerJosé Valim <jose.valim@gmail.com>2009-12-25 12:09:13 +0100
commiteb8e627c6918dae53c7ab8b9208e72ff64d20348 (patch)
tree4f153960d158c119ebdcef7a3a02c407e4b82dd0 /railties/lib/rails/configuration.rb
parent4b8330d2d50ae4de14dd43ffbea4d91804553140 (diff)
parent1c66f85eb6cd80053cf60889634a8c39c21b11a1 (diff)
downloadrails-eb8e627c6918dae53c7ab8b9208e72ff64d20348.tar.gz
rails-eb8e627c6918dae53c7ab8b9208e72ff64d20348.tar.bz2
rails-eb8e627c6918dae53c7ab8b9208e72ff64d20348.zip
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'railties/lib/rails/configuration.rb')
-rw-r--r--railties/lib/rails/configuration.rb25
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 = []