hiera-examiner 0.1.0 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75995a51092b3e500d8c5f564b74e3aa6c584387
4
- data.tar.gz: af86a32b73b60ef46b27af16d0aa1e167f91295c
3
+ metadata.gz: 7b9868f58b06234f63addbc0894cc853dafa883f
4
+ data.tar.gz: 71010790ae816f88e3bf7b2d7d2a4cdc888b3166
5
5
  SHA512:
6
- metadata.gz: 8eaef8d209fa6ac42152709240e2d1b69e112ed0163adb8fb33dd7d2ebc6e7d06f1c8fa22b02b420313f05a19695d7fb8d03677512ffdc8de9fb5933f8751c0a
7
- data.tar.gz: 323b2f5539f9e0a199636cdbb8ddd482c054fc8f7b4065e6eaa02c3731e35ad66c35a3f9f0210edad12939a7c0ac4c05dc58f52745c0ab0b1232b3c8f775432d
6
+ metadata.gz: 10cec0fbc78bc7733dccb78053107fd58954f756685a0166a1ee8e4a64f23708b98ec2ff8905d9a0d1461a57ee4b16dd981e06ef35e9550dddc94d9e2e584e92
7
+ data.tar.gz: 5d0ee0e296533d3810f0ea55d8cf458a6be86416442ff28e4a369b592e41053cdd0083566ef20ece43109a41d6d495a4bdbdcd719e10232e5a13e5e56cf28495
data/bin/hiera-examiner CHANGED
@@ -1,10 +1,17 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'hiera-examiner'
4
- examiner = HieraExaminer.new()
5
4
 
6
- if (ARGV[1])
7
- HieraExaminer.new(ARGV[1])
8
- end
9
-
10
- examiner.explain(ARGV[0])
5
+ if (ARGV[0])
6
+ examiner = HieraExaminer.new()
7
+ if (ARGV[1])
8
+ HieraExaminer.new(ARGV[1])
9
+ end
10
+
11
+ examiner.explain(ARGV[0])
12
+ else
13
+ puts 'hiera-examiner Usage:'
14
+ puts 'hiera-examiner <key> [path]'
15
+ puts '\tkey:\tHiera key to examine'
16
+ puts '\tpath:\tPath to hiera config file to use. Default: /vagrant/puppet/hiera/hiera.yaml'
17
+ end
@@ -82,8 +82,8 @@ class HieraExaminer
82
82
  yamlVal = yamlMap[:val]
83
83
  yamlFile = yamlMap[:file]
84
84
 
85
- if (hieraVal.empty?() && yamlVal.empty?())
86
- puts 'Unknown value'
85
+ if (hieraVal.empty?() || (!yamlVal || yamlVal.empty?()))
86
+ return 'MISSING'.magenta.blink
87
87
  elsif (yamlVal.index(startExp))
88
88
  if (showSource)
89
89
  res = explainDetail(yamlVal, "#{prefix}|", true, yamlFile)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiera-examiner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Stortz