lib/hieracles/formats/yaml.rb in hieracles-0.3.6 vs lib/hieracles/formats/yaml.rb in hieracles-0.4.0
- old
+ new
@@ -90,9 +90,17 @@
def add_nilclass(output, key, leaf, params, indent)
added output, key, '', params
end
+ def build_list(hash, notifications, filter)
+ if filter[0]
+ hash.select { |k, e| Regexp.new(filter[0]).match k }.to_yaml
+ else
+ hash.to_yaml
+ end
+ end
+
private
def added(output, key, leaf, params)
output += leaf.to_s
k = params["#{key.join('.')}"]