konfig-config 2.0.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/konfig/schema_group.rb +1 -1
- data/lib/konfig/sources/yaml.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a22afc67d2963b64a215cd391ccaedfe7e06b8225380efd1e9d5617cc3ceaa19
|
4
|
+
data.tar.gz: 2d6e3591b8dd6b439b291d89d56fd220f3494481046e78932bf42a5e7c6d7ee9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa032900f8624afa1c9f3ffb4af0ba386beccd75ec475fed0ce065d1042eba90aa28d37a8a15dd6ea703ae882be4decad31059244c6a80c761dbe023173d7451
|
7
|
+
data.tar.gz: e8c8319850a83410ea1bba2ba8b097049bad517c8fcaa25585e55b88ed6e3128e0bed03bde11a85a6e0cc80c48d3684258f7f18c3f850e80ea1c5a8bfb53c2fc
|
data/lib/konfig/schema_group.rb
CHANGED
@@ -30,7 +30,7 @@ module Konfig
|
|
30
30
|
@attributes.each_with_object({}) do |(name, attribute), hash|
|
31
31
|
attribute_path = path + [name]
|
32
32
|
if source.nil?
|
33
|
-
hash[name] = attribute.
|
33
|
+
hash[name] = attribute.default
|
34
34
|
else
|
35
35
|
begin
|
36
36
|
source_value = source.get(attribute_path, attribute: attribute)
|
data/lib/konfig/sources/yaml.rb
CHANGED
@@ -13,7 +13,8 @@ module Konfig
|
|
13
13
|
@source = ::YAML.safe_load(source)
|
14
14
|
end
|
15
15
|
|
16
|
-
|
16
|
+
# rubocop:disable Lint/UnusedMethodArgument
|
17
|
+
def get(path, attribute: nil)
|
17
18
|
source = @source
|
18
19
|
path.each do |p|
|
19
20
|
raise ValueNotPresentError unless source.key?(p.to_s)
|
@@ -22,6 +23,7 @@ module Konfig
|
|
22
23
|
end
|
23
24
|
source
|
24
25
|
end
|
26
|
+
# rubocop:enable Lint/UnusedMethodArgument
|
25
27
|
|
26
28
|
end
|
27
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: konfig-config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|
@@ -62,7 +62,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
62
62
|
requirements:
|
63
63
|
- - ">="
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: '2.
|
65
|
+
version: '2.7'
|
66
66
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - ">="
|