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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c19c4b86a92337ec4c88daf48eac19b48f18ba0d
4
- data.tar.gz: ae4d04d4295cbbe1574f375599939c7dbb6283c6
3
+ metadata.gz: 09676fb096ed5b35481b54c8bdddf2d20752aec2
4
+ data.tar.gz: c4b61c927339e8f547abac5857151cbdd5db28e6
5
5
  SHA512:
6
- metadata.gz: 1c02be62ff4cb55581ab70ef4f3dff913c2a765bb263983b41e097ecd5ecafe61c533d67b96dc3233fb0381bdaa9ced476058ce22c6396774e445f5b1f621e11
7
- data.tar.gz: 782e381c1d7ff8a869d30ea50fae8c0b4fd437c64a13b415dc1fd3c8e7d2da85063b091cd02384868efc8fadaa08d1e30595205923ec5b46a34ac311f2354d47
6
+ metadata.gz: e67de30eff33182070b670a8ca1be5c309b4a6ca3fbb4093f2a81eacd6353ee51b9892fcd43662220f48bdc293d47e6769e18379cbb13b73b626337fc0207a33
7
+ data.tar.gz: bb7d11c9ce2c196be63d3ba4d96526814d2594a6f2550d4ceee206b0e90efbfb324205cb15e1e5d52fff579bae49737f345b0751f9be2a137c24fcbe855fa520
@@ -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, "#{path}/#{key}")
29
+ flat_keys(value, [path, key].compact.join('/'))
30
30
  end.flatten
31
31
  end
32
32
  end
@@ -1,3 +1,3 @@
1
1
  module Tamplier
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -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 ["/not_exist"] from spec/examples/absent_environment_key/environment.yml.sample are not in spec/examples/absent_environment_key/environment.yml file.])
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 ["/first/second/fourth"] from spec/examples/absent_environment_keys/environment.yml.sample are not in spec/examples/absent_environment_keys/environment.yml file.])
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 ["/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.])
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tamplier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Shestakov