smart_config 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79021decd1e8da1ca164f03eb52d4e4291516844c5142ae38c11d1ba88f967f7
4
- data.tar.gz: 728aaac6723424090f3c5b53cbb0289ac003fb40b1429b7ed5c7ebef71f3690b
3
+ metadata.gz: ddb40432c6a54e8bd6f1a1b15b9ee29b6b517f0fdb031ad0db9f94949216292b
4
+ data.tar.gz: b61fd62743e2de932ee74156ac10c4b69fd8f0d222aac42bccaae9a883a25d24
5
5
  SHA512:
6
- metadata.gz: 3e4754d90251092a7ae9d31b8a16ab855ce4630f2e1595e23b0b532bec60c383e5d1a26c08319bf2f72683ff5147681eb4549ad880a1e2cf764be302965be0cc
7
- data.tar.gz: ad94e8af908a5a4cd9da816552af14374187a6d18c643fad444a893b5a87319e845b993af1fbb4326f08b61f36b0434c399b7f062678e7b9a9179baaf2fd3971
6
+ metadata.gz: 0a8c09025c904d35697c0daf13eece221474840c894c4da16c7293bb3229fd35e1022c5003d33f27f803406bc2e8f6841a1d5df69166342091b1e7445b32fa4a
7
+ data.tar.gz: ae66a9425d35f269bf632cc6ab71205f25c1ba69b81084d3081fb734786f523a4ea0630109b85235cd80738b3539af4d3da6c01b8250a5eb118ea1e0d73d321a
@@ -9,14 +9,16 @@ module SmartConfig
9
9
  class Group
10
10
  include SmartConfig::Values
11
11
 
12
- def initialize(namespace, walker, &)
12
+ def initialize(namespace, walker_fn, &)
13
13
  @namespace = namespace
14
- @walker = walker
14
+ @walker_fn = walker_fn
15
15
  instance_exec(&)
16
16
  end
17
17
 
18
18
  private
19
19
 
20
- attr_reader :walker
20
+ def walker
21
+ @walker ||= @walker_fn.call
22
+ end
21
23
  end
22
24
  end
@@ -17,7 +17,7 @@ module SmartConfig
17
17
  def group(name, &)
18
18
  @config ||= {}
19
19
  @config[name.to_sym] ||= {}
20
- @config[name.to_sym][:group] = SmartConfig::Group.new([namespace, name].compact.flatten, walker, &)
20
+ @config[name.to_sym][:group] = SmartConfig::Group.new([namespace, name].compact.flatten, method(:walker), &)
21
21
  end
22
22
 
23
23
  def keys
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SmartConfig
4
- VERSION = '0.0.2'
4
+ VERSION = '0.0.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien MATHIEU
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-13 00:00:00.000000000 Z
11
+ date: 2024-04-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Define and access static configuration, from a YAML config file, or environment
14
14
  variables