lib/octopress/configuration.rb in octopress-3.0.0.rc.10 vs lib/octopress/configuration.rb in octopress-3.0.0.rc.11
- old
+ new
@@ -14,26 +14,26 @@
file = options['octopress-config'] || '_octopress.yml'
user_config = {}
if File.exist? file
- user_config = SafeYAML.load(File.open(file).read) || {}
+ user_config = SafeYAML.load_file(file) || {}
end
- user_config = user_config.deep_merge(options['override'] || {})
- user_config = (options['defaults'] || {}).deep_merge(user_config)
+ user_config = Jekyll::Utils.deep_merge_hashes(user_config, options['override'] || {})
+ user_config = Jekyll::Utils.deep_merge_hashes(options['defaults'] || {}, user_config)
- @config = DEFAULTS.deep_merge(user_config)
+ @config = Jekyll::Utils.deep_merge_hashes(DEFAULTS, user_config)
end
def self.jekyll_config(options={})
return @jekyll_config if @jekyll_config
configs = Jekyll::Configuration::DEFAULTS
(options['config'] || ['_config.yml']).each do |file|
if File.exist? file
- configs = configs.deep_merge SafeYAML.load(File.open(file))
+ configs = Jekyll::Utils.deep_merge_hashes(configs, SafeYAML.load_file(file) || {})
end
end
@jekyll_config = configs
end