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

- old
+ new

@@ -26,11 +26,11 @@ def paths(_) @node.paths.join("\n") + "\n" end def build_head(without_common) - output = '' + output = "[-] (merged)\n" @node.files(without_common).each_with_index do |f, i| output << "[#{i}] #{f}\n" @index[f] = i end "#{output}\n" @@ -39,10 +39,15 @@ def build_params_line(key, value, filter) output = '' if !filter || Regexp.new(filter).match(key) first = value.pop filecolor_index = @index[first[:file]] - output << "[#{filecolor_index}] #{key} #{first[:value]}\n" + if first[:merged] != first[:value] + output << "[-] #{key} #{first[:merged]}\n" + output << " [#{filecolor_index}] #{key} #{first[:value]}\n" + else + output << "[#{filecolor_index}] #{key} #{first[:value]}\n" + end while value.count > 0 overriden = value.pop filecolor_index = @index[overriden[:file]] output << " [#{filecolor_index}] #{key} #{overriden[:value]}\n" end