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

- old
+ new

@@ -27,11 +27,18 @@ def build_params_line(key, value, filter) output = '' if !filter || Regexp.new(filter).match(key) first = value.pop - output << make_csv(in_what_file(first[:file]) + - [key, first[:value].to_s, '0']) + if first[:value] == first[:merged] + output << make_csv(in_what_file(first[:file]) + + [key, first[:value].to_s, '0']) + else + output << make_csv(in_what_file('-') + + [key, first[:merged].to_s, '0']) + output << make_csv(in_what_file(first[:file]) + + [key, first[:value].to_s, '1']) + end while value.count > 0 overriden = value.pop output << make_csv(in_what_file(overriden[:file]) + [key, overriden[:value].to_s, '1']) end