erb-hiera 0.2.0 → 0.3.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: 3a6f2b4aa5eea06a3ce6db8a7d2d1bf9a21f8e12
4
- data.tar.gz: a4358d3c004e05a31fafb0b4f2c94492ad1f71d2
3
+ metadata.gz: 72323e397c958defd855c4f6cd90b17167f99170
4
+ data.tar.gz: b24f7a28b719ba44c6184958ebb04689aabba37a
5
5
  SHA512:
6
- metadata.gz: 40c3159c55add88589e2afd08d5081631f1146c5f94daf972274bb417c8e81786ff2c884798762fc86cdb0406423047a59bceb9273a4fd4f6d6f859a1bfe3e3b
7
- data.tar.gz: ea6e6132bf150202d86157c6db3f3cb06cd8aa0a21c2afbbebc754dc934a93984a9828df79188e24e30fdbeef662dc1cb955ae80b70cda778f23277c2ff944e3
6
+ metadata.gz: 9740b36ac7b38b5e82fe316912f74e3095cb25bed182a9e032bf09c7cb06c18fafe800e10055a33b5574b43dc61ad5cce8e08715fdc3fb46e542ab10b310a795
7
+ data.tar.gz: d0b558df12b27f483bcd241ad753f11560abc8ac1efddabec52c831d4ca5ba783b10af8e66325ffa64f0fef8f1c20282a78f134413a3c5fdda96a3e88bceace8
data/example/config.yaml CHANGED
@@ -1,10 +1,12 @@
1
1
  - scope:
2
2
  environment: dev
3
- in_dir: templates
4
- out_dir: output/dev
3
+ dir:
4
+ input: templates
5
+ output: output/dev
5
6
 
6
7
  - scope:
7
8
  environment: stage
8
- in_dir: templates
9
- out_dir: output/stage
9
+ dir:
10
+ input: templates
11
+ output: output/stage
10
12
 
data/example/hiera.yaml CHANGED
@@ -5,8 +5,5 @@
5
5
  :datadir: "hiera"
6
6
 
7
7
  :hierarchy:
8
- # globals / environment
9
8
  - "environment/%{environment}"
10
-
11
- # globals
12
9
  - "common"
@@ -1,2 +1,2 @@
1
- Global: some global variable
2
- Environment Description: this is the development environment
1
+ common variable: some common variable
2
+ environment variable: this is the development environment
@@ -1,2 +1,2 @@
1
- Global: some global variable
2
- Environment Description: this is the staging environment
1
+ common variable: some common variable
2
+ environment variable: this is the staging environment
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  module ErbHiera
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
data/lib/erb-hiera.rb CHANGED
@@ -20,11 +20,15 @@ module ErbHiera
20
20
 
21
21
  mappings.each do |config|
22
22
  ErbHiera.scope = config["scope"]
23
- in_dir = config["in_dir"]
24
- out_dir = config["out_dir"]
23
+ in_dir = config["dir"]["input"]
24
+ out_dir = config["dir"]["output"]
25
+
26
+ [in_dir, out_dir].each do |dir|
27
+ raise StandardError, "error: undefined #{dir.split('_')[0]} dir" unless dir
28
+ end
25
29
 
26
30
  manifests(in_dir).each do |manifest|
27
- out_file = File.join(out_dir ,manifest.gsub(in_dir, ""))
31
+ out_file = File.join(out_dir, manifest.gsub(in_dir, ""))
28
32
 
29
33
  Manifest.info(manifest, out_file) if options[:verbose]
30
34
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erb-hiera
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Wilson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-10 00:00:00.000000000 Z
11
+ date: 2017-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hiera