canfig 0.0.11 → 0.0.12

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: ba430bd04920933ac504636144cb797457e51446c1850c02ce8ba76a2fab1136
4
- data.tar.gz: 9b38d00d36ab5928c606a5aa869cb26597276743d9433f558b079dd8487ce2ec
3
+ metadata.gz: 0d19a1e225983ae80da02fce77a7d35aa9e05c2ea3c4460b434693de8d6a6340
4
+ data.tar.gz: 85e143439451d3209846e2e4761205ecbaeba44cbf42dbc89263d5f4f53f7e3d
5
5
  SHA512:
6
- metadata.gz: acf50db63b8d815cb835fc8ae8213e009040aecb68f17d1c09e760ef5fe10087af3eb5c9db91507385fc62617c1bc146b6bc4113addde3e803b5c5fd072c5414
7
- data.tar.gz: d97d1a93681dfe5c13ef6ea893eb2817cf5a6484a18b77ef40b2ea2da99fd12b2f54823c441f78d2db848e017091f0600e42b61dd20fa80e701549032890edac
6
+ metadata.gz: 8bf05ccd8d29215d4dd5f66b989b782d8a688fcab557567b169426582136c4a39818bd26b6f8253ceb08b93f28b670ec026458de0aaf36ed4c7209a086392c94
7
+ data.tar.gz: 8e79d8407c0903522b79e75925e3697475deb4ac28f6efec2163d1624cffa5d5bb3f2ff4201259aa0fdd45d9018c5c547be3385c5f1f317d575d1358f29b3d8a
@@ -2,11 +2,9 @@ module Canfig
2
2
  class EnvConfig < OpenConfig
3
3
  attr_reader :namespace
4
4
 
5
- def initialize(namespace=nil, **attributes, &block)
6
- @namespace = namespace ? "#{namespace.to_s.underscore.upcase.gsub(/_$/, '')}_" : namespace
7
- super(*attributes.keys, &block)
8
- attributes.each do |key,val|
9
- env(key, val)
5
+ def configure_with_args(argh)
6
+ save_state! do
7
+ argh.symbolize_keys.each { |key,val| env(key, val) }
10
8
  end
11
9
  end
12
10
 
@@ -22,5 +20,12 @@ module Canfig
22
20
  val && ENV.key?(val.to_s) ? env(val, default, &block) : val
23
21
  end
24
22
  end
23
+
24
+ protected
25
+
26
+ def initialize(namespace=nil, **attributes, &block)
27
+ @namespace = namespace ? "#{namespace.to_s.underscore.upcase.gsub(/_$/, '')}_" : namespace
28
+ super(**attributes, &block)
29
+ end
25
30
  end
26
31
  end
@@ -1,3 +1,3 @@
1
1
  module Canfig
2
- VERSION = '0.0.11'
2
+ VERSION = '0.0.12'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canfig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rebec
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-30 00:00:00.000000000 Z
11
+ date: 2020-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport