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 +4 -4
- data/lib/canfig/env_config.rb +10 -5
- data/lib/canfig/version.rb +1 -1
- 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: 0d19a1e225983ae80da02fce77a7d35aa9e05c2ea3c4460b434693de8d6a6340
|
4
|
+
data.tar.gz: 85e143439451d3209846e2e4761205ecbaeba44cbf42dbc89263d5f4f53f7e3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bf05ccd8d29215d4dd5f66b989b782d8a688fcab557567b169426582136c4a39818bd26b6f8253ceb08b93f28b670ec026458de0aaf36ed4c7209a086392c94
|
7
|
+
data.tar.gz: 8e79d8407c0903522b79e75925e3697475deb4ac28f6efec2163d1624cffa5d5bb3f2ff4201259aa0fdd45d9018c5c547be3385c5f1f317d575d1358f29b3d8a
|
data/lib/canfig/env_config.rb
CHANGED
@@ -2,11 +2,9 @@ module Canfig
|
|
2
2
|
class EnvConfig < OpenConfig
|
3
3
|
attr_reader :namespace
|
4
4
|
|
5
|
-
def
|
6
|
-
|
7
|
-
|
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
|
data/lib/canfig/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2020-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|