lib/yaml_extend.rb in yaml_extend-1.0.3 vs lib/yaml_extend.rb in yaml_extend-1.1.0
- old
+ new
@@ -103,10 +103,17 @@
inheritance_key = @@ext_load_key || DEFAULT_INHERITANCE_KEY
end
total_config = config.clone
yaml_path = YAML.make_absolute_path yaml_path
- super_config = YAML.load_file(File.open(yaml_path))
+
+ super_config =
+ if yaml_path.match(/(\.erb\.|\.erb$)/)
+ YAML.load(ERB.new(File.read(yaml_path)).result)
+ else
+ YAML.load_file(File.open(yaml_path))
+ end
+
super_inheritance_files = yaml_value_by_key inheritance_key, super_config
unless options[:preserve_inheritance_key]
delete_yaml_key inheritance_key, super_config # we don't merge the super inheritance keys into the base yaml
end