tamplier 0.1.0 → 0.1.1
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/lib/tamplier/validator.rb +2 -2
- data/lib/tamplier/version.rb +1 -1
- data/spec/validator_spec.rb +3 -3
- 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: 09676fb096ed5b35481b54c8bdddf2d20752aec2
|
4
|
+
data.tar.gz: c4b61c927339e8f547abac5857151cbdd5db28e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e67de30eff33182070b670a8ca1be5c309b4a6ca3fbb4093f2a81eacd6353ee51b9892fcd43662220f48bdc293d47e6769e18379cbb13b73b626337fc0207a33
|
7
|
+
data.tar.gz: bb7d11c9ce2c196be63d3ba4d96526814d2594a6f2550d4ceee206b0e90efbfb324205cb15e1e5d52fff579bae49737f345b0751f9be2a137c24fcbe855fa520
|
data/lib/tamplier/validator.rb
CHANGED
@@ -23,10 +23,10 @@ module Tamplier
|
|
23
23
|
(YAML.load(file.read).keys & %w[development test]).present?
|
24
24
|
end
|
25
25
|
|
26
|
-
def flat_keys(hash, path =
|
26
|
+
def flat_keys(hash, path = nil)
|
27
27
|
return path unless hash.is_a?(Hash)
|
28
28
|
hash.map do |key, value|
|
29
|
-
flat_keys(value,
|
29
|
+
flat_keys(value, [path, key].compact.join('/'))
|
30
30
|
end.flatten
|
31
31
|
end
|
32
32
|
end
|
data/lib/tamplier/version.rb
CHANGED
data/spec/validator_spec.rb
CHANGED
@@ -12,14 +12,14 @@ describe Tamplier::Validator do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
it 'checks, that all environmental keys from sample file exist in real file' do
|
15
|
-
expect { subject.ensure('spec/examples/absent_environment_key/', 'production') }.to raise_error(ConfigurationException, %q[Several keys ["
|
15
|
+
expect { subject.ensure('spec/examples/absent_environment_key/', 'production') }.to raise_error(ConfigurationException, %q[Several keys ["not_exist"] from spec/examples/absent_environment_key/environment.yml.sample are not in spec/examples/absent_environment_key/environment.yml file.])
|
16
16
|
end
|
17
17
|
|
18
18
|
it 'checks, that all environmental keys (in deep) from sample file exist in real file' do
|
19
|
-
expect { subject.ensure('spec/examples/absent_environment_keys/', 'production') }.to raise_error(ConfigurationException, %q[Several keys ["
|
19
|
+
expect { subject.ensure('spec/examples/absent_environment_keys/', 'production') }.to raise_error(ConfigurationException, %q[Several keys ["first/second/fourth"] from spec/examples/absent_environment_keys/environment.yml.sample are not in spec/examples/absent_environment_keys/environment.yml file.])
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'checks, that all non enviromental keys from sample file exist in real file' do
|
23
|
-
expect { subject.ensure('spec/examples/absent_keys/') }.to raise_error(ConfigurationException, %q[Several keys ["
|
23
|
+
expect { subject.ensure('spec/examples/absent_keys/') }.to raise_error(ConfigurationException, %q[Several keys ["first/second/third", "first/second/fourth"] from spec/examples/absent_keys/non_environment.yml.sample are not in spec/examples/absent_keys/non_environment.yml file.])
|
24
24
|
end
|
25
25
|
end
|