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 +5 -5
- data/lib/conf_loader.rb +5 -5
- data/lib/conf_loader/version.rb +1 -1
- data/spec/fixtures/simple.yml +2 -0
- data/spec/integration/conf_loader_spec.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 54c86f6f5b32b9d1eb905dec6024dc795dd7ff239d9cc55465a38439e3086cd2
|
4
|
+
data.tar.gz: e29a190889f3c47a3ca517eafb100708872206f6cf0ad3959d1aaed7cbc3ec3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d80800f2cc368da21002589a7a028b79fa3af8508521607f360fa8da190f8af5c39f58a8b35aea019d5a5cc965e3efba9b3d710cd967a296375b7f0d26f8cf2a
|
7
|
+
data.tar.gz: af839ccd3b493377e535eabedefb1748a229163b32516d85fff6cdf65ad89aa1488f0c5ca5caf824d0b32197cfb44f520c4273bbcc787ec78b2b41639ce58ce1
|
data/lib/conf_loader.rb
CHANGED
@@ -46,11 +46,11 @@ class ConfLoader
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def self.check_value_presence(hash)
|
49
|
-
|
50
|
-
if
|
49
|
+
error_keys = check_values_not_empty(hash)
|
50
|
+
if error_keys.empty?
|
51
51
|
hash
|
52
52
|
else
|
53
|
-
raise ValueNotDefinedError,
|
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
|
-
[
|
63
|
+
[key]
|
64
64
|
else
|
65
65
|
[]
|
66
66
|
end
|
data/lib/conf_loader/version.rb
CHANGED
data/spec/fixtures/simple.yml
CHANGED
@@ -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
|
-
'
|
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.
|
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:
|
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
|
-
|
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
|