conf_loader 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0faf9108d7e238f50b273199aaffa4170995a137
4
- data.tar.gz: 19433f3f3b1595f0f1f1ed2f1c05bb8b381ff9de
2
+ SHA256:
3
+ metadata.gz: 54c86f6f5b32b9d1eb905dec6024dc795dd7ff239d9cc55465a38439e3086cd2
4
+ data.tar.gz: e29a190889f3c47a3ca517eafb100708872206f6cf0ad3959d1aaed7cbc3ec3c
5
5
  SHA512:
6
- metadata.gz: 8598f2926e6902f67cf6b9e4332cb1d90d7246dea1d64ed81257290223473cc25af0128314b846322f80b379016b06b752760bd5656936e5a37d8ac0e0edc50c
7
- data.tar.gz: 9f2b2b29c155fd56514fdb7a113794f6cd60e3d3f37501439fdbb5e55a042b2fe793018cc1e33091d9478a42e4ba146c2003cda97d16ec7ef15541c1fcd46220
6
+ metadata.gz: d80800f2cc368da21002589a7a028b79fa3af8508521607f360fa8da190f8af5c39f58a8b35aea019d5a5cc965e3efba9b3d710cd967a296375b7f0d26f8cf2a
7
+ data.tar.gz: af839ccd3b493377e535eabedefb1748a229163b32516d85fff6cdf65ad89aa1488f0c5ca5caf824d0b32197cfb44f520c4273bbcc787ec78b2b41639ce58ce1
@@ -46,11 +46,11 @@ class ConfLoader
46
46
  end
47
47
 
48
48
  def self.check_value_presence(hash)
49
- errors = check_values_not_empty(hash)
50
- if errors.empty?
49
+ error_keys = check_values_not_empty(hash)
50
+ if error_keys.empty?
51
51
  hash
52
52
  else
53
- raise ValueNotDefinedError, errors.join(', ')
53
+ raise ValueNotDefinedError, "Undefined keys: #{error_keys.join(', ')}"
54
54
  end
55
55
  end
56
56
 
@@ -58,9 +58,9 @@ class ConfLoader
58
58
  hash.inject([]) do |acc, (key, value)|
59
59
  errors =
60
60
  if value.is_a?(Hash)
61
- check_values_not_empty(value)
61
+ check_values_not_empty(value).map { |child_key| "#{key}.#{child_key}" }
62
62
  elsif value.to_s.empty?
63
- ["#{key} value not defined"]
63
+ [key]
64
64
  else
65
65
  []
66
66
  end
@@ -1,3 +1,3 @@
1
1
  class ConfLoader
2
- VERSION = '2.0.0'
2
+ VERSION = '2.1.0'
3
3
  end
@@ -15,3 +15,5 @@ invalid:
15
15
  empty_value: ''
16
16
  nested_field:
17
17
  nested_empty_value: ''
18
+ nested_empty_value2: ''
19
+ nested_non_empty_value: 'non-empty'
@@ -64,7 +64,7 @@ describe ConfLoader do
64
64
  it 'raises ValueNotDefinedError' do
65
65
  expect{conf}.to raise_error(
66
66
  described_class::ValueNotDefinedError,
67
- 'empty_value value not defined, nested_empty_value value not defined'
67
+ 'Undefined keys: empty_value, nested_field.nested_empty_value, nested_field.nested_empty_value2'
68
68
  )
69
69
  end
70
70
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conf_loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Indrek Juhkam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-24 00:00:00.000000000 Z
11
+ date: 2019-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: symbolizer
@@ -65,8 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  requirements: []
68
- rubyforge_project:
69
- rubygems_version: 2.6.7
68
+ rubygems_version: 3.0.6
70
69
  signing_key:
71
70
  specification_version: 4
72
71
  summary: Helps to load conf files in SaleMove ecosystem