hieracles 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c192a57c0dd89751f2e3bfb54cbe618619a86899
4
- data.tar.gz: c912bca31c59ade51a5406afd7a6d0694f0b14c3
3
+ metadata.gz: 979857ccc68e688d421a488ae1d7a46e43363208
4
+ data.tar.gz: 6ddb11e2037df811f6c209d8def3f0fc25805427
5
5
  SHA512:
6
- metadata.gz: c04d028ce1dde5e210085724be74031dbe8792b55bf320fe172a93d01a5613c76599d76b36ad3b59efe7e2a7db6e6d98bd34b944f7bf3609c37d4af6f5fd5960
7
- data.tar.gz: ba1cbd0281931e8ecd799d6f91334afde0cf0ead9e5e1ccb9cc4ca801a150aa43d2ebb2523295b9f14e74662e744b8c49ae03f24c0efcf02af1e0cc91213ab8c
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 add_fixnum(output, key, leaf, params, indent)
78
- added output, key, leaf, params
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
@@ -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
- s = to_shallow_hash(data)
51
- s.each do |k,v|
52
- params[k] ||= []
53
- params[k] << { value: v, file: f}
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hieracles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - mose