configx 0.4.0 → 0.5.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
2
  SHA256:
3
- metadata.gz: 52b7bdd6e023a3ea747b90c4ef46061484bbe831bab45bf121e51f4352f8ca1a
4
- data.tar.gz: 87ec00bce9b86453747a1f36579b5c2fb9ee6b7440c68681febe75799e425f95
3
+ metadata.gz: 8fa499413f7259555212788113cbd46e3dcbe17ab331a063cf9bb6ec6c2ef8c9
4
+ data.tar.gz: 2dc562016aed2c719eeecfea330d17d012227d1445b919a57eac67bc0eb89fac
5
5
  SHA512:
6
- metadata.gz: 8e1143144c3f21e83c3d5059bb40bdb0e5921c2788a5d6d149dab1e12e8dfd79990a78e0066e2a5a1b9f94c43585a00ab8136814fadb1aa25d6fe3f398cf8f17
7
- data.tar.gz: 92755126398c1c3a53846661bd5a8b53606a84c81984897a51a2c460c1cf4a44cd10cc63397323e5e246cee1feb23d689132b168614158ea5cb3c221343beecf
6
+ metadata.gz: 38baeae60af41a65366a03dc8891b614314e21c2b703392d8c1d751f924888c92f01aa170bc4794898eed5db49baf80015d61f202f9c6a354d43fc6d73cb3095
7
+ data.tar.gz: '019b8383fbef554437d05092303ac46b5470e433e1a41b7097e1b95cbefe882cd6b8a61662a0f3092cb9ee53bd2c1db1985dc17ca54f3d30064b7889df37f92d'
@@ -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 = source
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConfigX
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
@@ -1,6 +1,8 @@
1
1
 
2
2
  module ConfigX
3
3
  class HashSource < Source
4
+ def self.deep_stringify_keys: [T] (Hash[(String | Symbol), T])-> Hash[String, T]
5
+
4
6
  def initialize: (Source::config_hash) -> void
5
7
 
6
8
  attr_reader source: Source::config_hash
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.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-06 00:00:00.000000000 Z
11
+ date: 2024-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deep_merge