lib/hieracles/formats/yaml.rb in hieracles-0.1.6 vs lib/hieracles/formats/yaml.rb in hieracles-0.1.7

- old
+ new

@@ -55,10 +55,17 @@ def add_array(output, key, leaf, params, indent) yaml = leaf.to_yaml[4..-1] aryaml = yaml.each_line.map do |l| indent + l end - output += "\n" + indent + "# " + params[key.join('.')][0][:file] + if @node.hiera.merge_behavior == :deep || + @node.hiera.merge_behavior == :deeper + params[key.join('.')].each do |f| + output += "\n" + indent + "# " + f[:file] + end + else + output += "\n" + indent + "# " + params[key.join('.')].last[:file] + end output += "\n" + aryaml.join().chomp output end def add_string(output, key, leaf, params, indent)