hieracles 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/hieracles/formats/yaml.rb +10 -6
- data/lib/hieracles/node.rb +7 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 979857ccc68e688d421a488ae1d7a46e43363208
|
4
|
+
data.tar.gz: 6ddb11e2037df811f6c209d8def3f0fc25805427
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d30867447a99006f2a4a3d70b027e54c25630b04aabf65ec41a53801846b2f2e347a3fcc9ddf73859e05b25475da7e18b1428049b1e9abaedab6da9fdf6b4d54
|
7
|
+
data.tar.gz: d3556118c9d8230a9b472668a475c23c3a2ccd365365ed818cc86b94fca94b881091a1d52614c4e3466b1953739617d6a6d967667b2b859636e046b573b68a39
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
Hieracles Changelog
|
2
2
|
=======================
|
3
3
|
|
4
|
+
### 0.1.2 - 2015-11-12
|
5
|
+
- fix yaml more for case of nilclass in params
|
6
|
+
- fix the case when a params file is empty
|
7
|
+
|
4
8
|
### 0.1.1 - 2015-11-11
|
5
9
|
- add json format output
|
6
10
|
- add an option to load facts files in json or yaml
|
@@ -66,6 +66,14 @@ module Hieracles
|
|
66
66
|
added output, key, leaf, params
|
67
67
|
end
|
68
68
|
|
69
|
+
def add_fixnum(output, key, leaf, params, indent)
|
70
|
+
added output, key, leaf, params
|
71
|
+
end
|
72
|
+
|
73
|
+
def add_float(output, key, leaf, params, indent)
|
74
|
+
added output, key, leaf, params
|
75
|
+
end
|
76
|
+
|
69
77
|
def add_trueclass(output, key, leaf, params, indent)
|
70
78
|
added output, key, 'true', params
|
71
79
|
end
|
@@ -74,12 +82,8 @@ module Hieracles
|
|
74
82
|
added output, key, 'false', params
|
75
83
|
end
|
76
84
|
|
77
|
-
def
|
78
|
-
added output, key,
|
79
|
-
end
|
80
|
-
|
81
|
-
def add_float(output, key, leaf, params, indent)
|
82
|
-
added output, key, leaf, params
|
85
|
+
def add_nilclass(output, key, leaf, params, indent)
|
86
|
+
added output, key, '', params
|
83
87
|
end
|
84
88
|
|
85
89
|
private
|
data/lib/hieracles/node.rb
CHANGED
@@ -47,10 +47,12 @@ module Hieracles
|
|
47
47
|
params = {}
|
48
48
|
files(without_common).each do |f|
|
49
49
|
data = YAML.load_file(File.join(Config.basepath, f))
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
if data
|
51
|
+
s = to_shallow_hash(data)
|
52
|
+
s.each do |k,v|
|
53
|
+
params[k] ||= []
|
54
|
+
params[k] << { value: v, file: f}
|
55
|
+
end
|
54
56
|
end
|
55
57
|
end
|
56
58
|
params.sort
|
@@ -60,7 +62,7 @@ module Hieracles
|
|
60
62
|
params = {}
|
61
63
|
paths(without_common).each do |f|
|
62
64
|
data = YAML.load_file(f)
|
63
|
-
deep_merge!(params, data)
|
65
|
+
deep_merge!(params, data) if data
|
64
66
|
end
|
65
67
|
deep_sort(params)
|
66
68
|
end
|