Simplify configuration a bit, and make extensions raise an error if the user tries to set an invalid extension option.
This commit is contained in:
parent
b9b17e3ac5
commit
b607d70a52
2 changed files with 6 additions and 11 deletions
|
@ -165,16 +165,12 @@ module Middleman
|
|||
# mode and no new settings may be defined.
|
||||
def finalize!
|
||||
@finalized = true
|
||||
self
|
||||
end
|
||||
|
||||
# Deep duplicate of the configuration manager
|
||||
def dup
|
||||
copy = ConfigurationManager.new
|
||||
@settings.each do |key, setting|
|
||||
copy_setting = copy.define_setting(setting.key, setting.default, setting.description)
|
||||
copy_setting.value = setting.value if setting.value_set?
|
||||
end
|
||||
copy
|
||||
ConfigurationManager.new.tap {|c| c.load_settings(self.all_settings) }
|
||||
end
|
||||
|
||||
# Load in a list of settings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue