lib/staticpress/configuration.rb in staticpress-0.1.3 vs lib/staticpress/configuration.rb in staticpress-0.2.0

- old
+ new

@@ -13,10 +13,24 @@ YAML.dump(custom_values.to_hash, f) end end def self.default - @default ||= new(YAML.load_file(Staticpress.root + 'skeleton' + 'config.yml')) + @default ||= lambda do + reply = YAML.load_file(Staticpress.root + 'skeleton' + 'config.yml') + + reply[:template_engine_options] ||= {} + + if defined? Compass + [ :sass, :scss ].each do |template_engine| + (reply[:template_engine_options][template_engine] ||= {}).merge!(Compass.sass_engine_options) do |key, first_choice, second_choice| + reply[:template_engine_options][template_engine].key?(key) ? first_choice : second_choice + end + end + end + + new reply + end.call end def self.instance @config ||= new(default.to_hash.merge(YAML.load_file(Staticpress.blog_path + 'config.yml'))) end