hiera 3.3.0-x64-mingw32 → 3.3.1-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/lib/hiera/config.rb +7 -1
- data/lib/hiera/filecache.rb +1 -1
- data/lib/hiera/version.rb +1 -1
- data/spec/unit/config_spec.rb +4 -0
- data/spec/unit/filecache_spec.rb +30 -0
- data/spec/unit/fixtures/badconfig/config/hiera.yaml +6 -0
- data/spec/unit/fixtures/badconfig/data/common.yaml +2 -0
- metadata +33 -29
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
ZDNkNGRjODE5NjE5N2FlZDc4MWQ0MWMxMDBhYjA5ODNhYjg2ODZiOA==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3f54ef65357296bc1a3656067a28dcb4a7c2bafa
|
4
|
+
data.tar.gz: 71a56f8dc356487e3e9ced91009d9ffcfe6bb1b2
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
ZDg2NDMxMTgzZWVhNzc2OGQ1NTQxOTU3YmU4M2Y2N2IxZmFjMDc4YzM5ZjA5
|
11
|
-
MzcyNDBhMmJjZDZhNmRlN2E3NGFjYWVjMDFmMTBlMDE0NGExNmU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MmY2NTZmOTZhODEyOGNhMDMxM2Q0MzI0NDVmNzlhYzc2NDVlMzk1MjBkMmQz
|
14
|
-
NWI4ZWJkZDhiNjIzNzczYTIzNjI4MTU3YTU4MWM2ZjJlOWFmNzNhNzdlOWYy
|
15
|
-
ZGIyNWRiNDBkNGIxNDQ2ZWM2ZDllN2Y1ZWY3OWJhZWY3ZjRkNzg=
|
6
|
+
metadata.gz: 0803eca2f370c4d24c2e551df39c1cb983c88af17cea08b92aa6fad00b60684b512229eef723d255fe70a81d875fb37490f6deca0b3201831af444c557f9cec4
|
7
|
+
data.tar.gz: 4400816c4d4e9fa6e24e93a9eece139682aba003eef03ec53afdf32932b8123248cecbff43c37870d85ffdec0603aeb86fc36d211f85f603f314a494a3192c1a
|
data/lib/hiera/config.rb
CHANGED
@@ -26,7 +26,13 @@ class Hiera::Config
|
|
26
26
|
raise detail
|
27
27
|
end
|
28
28
|
end
|
29
|
-
|
29
|
+
if config
|
30
|
+
version = config['version'] || config[:version] || 3
|
31
|
+
if version >= 4
|
32
|
+
raise "v4 hiera.yaml is only to be used inside an environment or a module and cannot be given to the global hiera"
|
33
|
+
end
|
34
|
+
@config.merge! config
|
35
|
+
end
|
30
36
|
else
|
31
37
|
raise "Config file #{source} not found"
|
32
38
|
end
|
data/lib/hiera/filecache.rb
CHANGED
@@ -49,7 +49,7 @@ class Hiera
|
|
49
49
|
# in processing will be propagated to the caller
|
50
50
|
def read_file(path, expected_type = Object)
|
51
51
|
if stale?(path)
|
52
|
-
data = File.read(path)
|
52
|
+
data = File.read(path, :encoding => 'BOM|UTF-8')
|
53
53
|
@cache[path][:data] = block_given? ? yield(data) : data
|
54
54
|
|
55
55
|
if !@cache[path][:data].is_a?(expected_type)
|
data/lib/hiera/version.rb
CHANGED
data/spec/unit/config_spec.rb
CHANGED
@@ -12,6 +12,10 @@ class Hiera
|
|
12
12
|
}
|
13
13
|
end
|
14
14
|
|
15
|
+
it 'should raise an error if the configuration version is greater than 3' do
|
16
|
+
expect { Hiera.new(:config => File.join(HieraSpec::FIXTURE_DIR, 'badconfig', 'config', 'hiera.yaml')) }.to raise_error(/v4 hiera\.yaml is only to be used inside an environment or a module/)
|
17
|
+
end
|
18
|
+
|
15
19
|
it "should raise an error for missing config files" do
|
16
20
|
File.expects(:exist?).with("/nonexisting").returns(false)
|
17
21
|
YAML.expects(:load_file).with("/nonexisting").never
|
data/spec/unit/filecache_spec.rb
CHANGED
@@ -84,6 +84,36 @@ class Hiera
|
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
|
+
it "sets the encoding to UTF-8 when reading a file" do
|
88
|
+
begin
|
89
|
+
original_encoding = Encoding.default_external
|
90
|
+
Encoding.default_external = Encoding::ISO_8859_1
|
91
|
+
|
92
|
+
Dir.mktmpdir do |dir|
|
93
|
+
file = File.join(dir, "testing")
|
94
|
+
write_file(file, "my data")
|
95
|
+
expect(@cache.read_file(file).encoding).to eq(Encoding::UTF_8)
|
96
|
+
end
|
97
|
+
ensure
|
98
|
+
Encoding.default_external = original_encoding
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
it "reads a file with unicode characters" do
|
103
|
+
begin
|
104
|
+
original_encoding = Encoding.default_external
|
105
|
+
Encoding.default_external = Encoding::ISO_8859_1
|
106
|
+
|
107
|
+
Dir.mktmpdir do |dir|
|
108
|
+
file = File.join(dir, "testing")
|
109
|
+
write_file(file, "\u2603")
|
110
|
+
expect(@cache.read_file(file)).to eq("\u2603")
|
111
|
+
end
|
112
|
+
ensure
|
113
|
+
Encoding.default_external = original_encoding
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
87
117
|
it "rereads data when the file changes" do
|
88
118
|
Dir.mktmpdir do |dir|
|
89
119
|
file = File.join(dir, "testing")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hiera
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.1
|
5
5
|
platform: x64-mingw32
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: win32-dir
|
@@ -31,11 +31,7 @@ executables:
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
-
- COPYING
|
35
|
-
- LICENSE
|
36
|
-
- README.md
|
37
34
|
- bin/hiera
|
38
|
-
- lib/hiera.rb
|
39
35
|
- lib/hiera/backend.rb
|
40
36
|
- lib/hiera/backend/json_backend.rb
|
41
37
|
- lib/hiera/backend/yaml_backend.rb
|
@@ -50,6 +46,10 @@ files:
|
|
50
46
|
- lib/hiera/recursive_guard.rb
|
51
47
|
- lib/hiera/util.rb
|
52
48
|
- lib/hiera/version.rb
|
49
|
+
- lib/hiera.rb
|
50
|
+
- COPYING
|
51
|
+
- README.md
|
52
|
+
- LICENSE
|
53
53
|
- spec/spec_helper.rb
|
54
54
|
- spec/unit/backend/json_backend_spec.rb
|
55
55
|
- spec/unit/backend/yaml_backend_spec.rb
|
@@ -58,6 +58,8 @@ files:
|
|
58
58
|
- spec/unit/console_logger_spec.rb
|
59
59
|
- spec/unit/fallback_logger_spec.rb
|
60
60
|
- spec/unit/filecache_spec.rb
|
61
|
+
- spec/unit/fixtures/badconfig/config/hiera.yaml
|
62
|
+
- spec/unit/fixtures/badconfig/data/common.yaml
|
61
63
|
- spec/unit/fixtures/interpolate/config/hiera.yaml
|
62
64
|
- spec/unit/fixtures/interpolate/config/hiera_iplm_hiera.yaml
|
63
65
|
- spec/unit/fixtures/interpolate/config/hiera_iplm_hiera_bad.yaml
|
@@ -87,46 +89,48 @@ require_paths:
|
|
87
89
|
- lib
|
88
90
|
required_ruby_version: !ruby/object:Gem::Requirement
|
89
91
|
requirements:
|
90
|
-
- -
|
92
|
+
- - '>='
|
91
93
|
- !ruby/object:Gem::Version
|
92
94
|
version: '0'
|
93
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
96
|
requirements:
|
95
|
-
- -
|
97
|
+
- - '>='
|
96
98
|
- !ruby/object:Gem::Version
|
97
99
|
version: '0'
|
98
100
|
requirements: []
|
99
101
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.
|
102
|
+
rubygems_version: 2.0.14
|
101
103
|
signing_key:
|
102
104
|
specification_version: 4
|
103
105
|
summary: Light weight hierarchical data store
|
104
106
|
test_files:
|
105
|
-
- spec/
|
106
|
-
- spec/unit/
|
107
|
-
- spec/unit/
|
108
|
-
- spec/unit/
|
107
|
+
- spec/spec_helper.rb
|
108
|
+
- spec/unit/backend/json_backend_spec.rb
|
109
|
+
- spec/unit/backend/yaml_backend_spec.rb
|
110
|
+
- spec/unit/backend_spec.rb
|
111
|
+
- spec/unit/config_spec.rb
|
112
|
+
- spec/unit/console_logger_spec.rb
|
113
|
+
- spec/unit/fallback_logger_spec.rb
|
114
|
+
- spec/unit/filecache_spec.rb
|
115
|
+
- spec/unit/fixtures/badconfig/config/hiera.yaml
|
116
|
+
- spec/unit/fixtures/badconfig/data/common.yaml
|
117
|
+
- spec/unit/fixtures/interpolate/config/hiera.yaml
|
109
118
|
- spec/unit/fixtures/interpolate/config/hiera_iplm_hiera.yaml
|
110
119
|
- spec/unit/fixtures/interpolate/config/hiera_iplm_hiera_bad.yaml
|
111
|
-
- spec/unit/fixtures/interpolate/config/hiera.yaml
|
112
|
-
- spec/unit/fixtures/interpolate/data/niltest.yaml
|
113
|
-
- spec/unit/fixtures/interpolate/data/complex.yaml
|
114
|
-
- spec/unit/fixtures/interpolate/data/frontend.json
|
115
|
-
- spec/unit/fixtures/interpolate/data/role.json
|
116
120
|
- spec/unit/fixtures/interpolate/data/bad_interpolation.yaml
|
121
|
+
- spec/unit/fixtures/interpolate/data/complex.yaml
|
117
122
|
- spec/unit/fixtures/interpolate/data/dotted_keys.yaml
|
118
|
-
- spec/unit/fixtures/interpolate/data/weird_keys.yaml
|
119
123
|
- spec/unit/fixtures/interpolate/data/empty_interpolation.yaml
|
124
|
+
- spec/unit/fixtures/interpolate/data/frontend.json
|
125
|
+
- spec/unit/fixtures/interpolate/data/niltest.yaml
|
120
126
|
- spec/unit/fixtures/interpolate/data/recursive.yaml
|
121
|
-
- spec/unit/
|
122
|
-
- spec/unit/
|
123
|
-
- spec/unit/
|
124
|
-
- spec/unit/
|
125
|
-
- spec/unit/
|
127
|
+
- spec/unit/fixtures/interpolate/data/role.json
|
128
|
+
- spec/unit/fixtures/interpolate/data/weird_keys.yaml
|
129
|
+
- spec/unit/fixtures/override/config/hiera.yaml
|
130
|
+
- spec/unit/fixtures/override/data/alternate.yaml
|
131
|
+
- spec/unit/fixtures/override/data/common.yaml
|
132
|
+
- spec/unit/hiera_spec.rb
|
133
|
+
- spec/unit/interpolate_spec.rb
|
126
134
|
- spec/unit/puppet_logger_spec.rb
|
127
|
-
- spec/unit/console_logger_spec.rb
|
128
|
-
- spec/unit/version_spec.rb
|
129
|
-
- spec/unit/fallback_logger_spec.rb
|
130
135
|
- spec/unit/util_spec.rb
|
131
|
-
- spec/unit/
|
132
|
-
- spec/spec_helper.rb
|
136
|
+
- spec/unit/version_spec.rb
|