configx 0.4.0 → 0.5.0
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/config_x/hash_source.rb +16 -1
- data/lib/config_x/version.rb +1 -1
- data/sig/config_x/hash_source.rbs +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fa499413f7259555212788113cbd46e3dcbe17ab331a063cf9bb6ec6c2ef8c9
|
4
|
+
data.tar.gz: 2dc562016aed2c719eeecfea330d17d012227d1445b919a57eac67bc0eb89fac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38baeae60af41a65366a03dc8891b614314e21c2b703392d8c1d751f924888c92f01aa170bc4794898eed5db49baf80015d61f202f9c6a354d43fc6d73cb3095
|
7
|
+
data.tar.gz: '019b8383fbef554437d05092303ac46b5470e433e1a41b7097e1b95cbefe882cd6b8a61662a0f3092cb9ee53bd2c1db1985dc17ca54f3d30064b7889df37f92d'
|
data/lib/config_x/hash_source.rb
CHANGED
@@ -7,11 +7,26 @@ module ConfigX
|
|
7
7
|
attr_reader :source
|
8
8
|
protected :source
|
9
9
|
|
10
|
+
class << self
|
11
|
+
def deep_stringify_keys(hash)
|
12
|
+
hash.each_with_object({}) do |(key, value), acc|
|
13
|
+
acc[key.to_s] =
|
14
|
+
if Hash === value
|
15
|
+
deep_stringify_keys(value)
|
16
|
+
else
|
17
|
+
value
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
10
23
|
def initialize(source)
|
11
24
|
@source = source
|
12
25
|
end
|
13
26
|
|
14
|
-
def load
|
27
|
+
def load
|
28
|
+
self.class.deep_stringify_keys(source)
|
29
|
+
end
|
15
30
|
|
16
31
|
def ==(other)
|
17
32
|
other.is_a?(self.class) && source == other.source
|
data/lib/config_x/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tëma Bolshakov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deep_merge
|