lib/hieracles/node.rb in hieracles-0.1.1 vs lib/hieracles/node.rb in hieracles-0.1.2
- old
+ new
@@ -45,23 +45,25 @@
def params(without_common = true)
params = {}
files(without_common).each do |f|
data = YAML.load_file(File.join(Config.basepath, f))
- s = to_shallow_hash(data)
- s.each do |k,v|
- params[k] ||= []
- params[k] << { value: v, file: f}
+ if data
+ s = to_shallow_hash(data)
+ s.each do |k,v|
+ params[k] ||= []
+ params[k] << { value: v, file: f}
+ end
end
end
params.sort
end
def params_tree(without_common = true)
params = {}
paths(without_common).each do |f|
data = YAML.load_file(f)
- deep_merge!(params, data)
+ deep_merge!(params, data) if data
end
deep_sort(params)
end
def modules