canfig 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/canfig/config.rb +3 -1
- data/lib/canfig/env_config.rb +3 -1
- 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: f5cf1818dc05ca85705475f4f667a025716f351f6c846b17ad2ca8d71ca94967
|
4
|
+
data.tar.gz: 0b94d7c75bbb9e4cb443ee07094881af53b42dca689c5373fc28b04fb76f5fd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c07a4de23a58dffad06507b3dcadbae8c5ba77b24ab841a98ce1064c37b1caf55726502c9ca2d4abeab8ce753b7869b9aea52c316ce5309a972d15673ea973e3
|
7
|
+
data.tar.gz: 3e7ac47e76ece7eb4311fbca9b3786ba445a6ed59b4e520aaaf44350f567c5c420762f7770bd2dc78e9d8f5a43c614d154ed9a6c37bf3a56305a649cd881f4bb
|
data/lib/canfig/config.rb
CHANGED
@@ -40,7 +40,9 @@ module Canfig
|
|
40
40
|
@state[key] ||= begin
|
41
41
|
val = ENV.fetch(key.to_s.underscore.upcase, default, &block)
|
42
42
|
val = default if val.blank?
|
43
|
-
val
|
43
|
+
val = env(val, default, &block) if val && ENV.key?(val.to_s)
|
44
|
+
val = eval(val) if val == 'true' || val == 'false'
|
45
|
+
val
|
44
46
|
end
|
45
47
|
end
|
46
48
|
|
data/lib/canfig/env_config.rb
CHANGED
@@ -18,7 +18,9 @@ module Canfig
|
|
18
18
|
key = key.gsub(/^#{namespace}/, '') if namespace
|
19
19
|
val = ENV.fetch("#{namespace}#{key}", default, &block)
|
20
20
|
val = default if val.blank?
|
21
|
-
val
|
21
|
+
val = env(val, default, &block) if val && ENV.key?(val.to_s)
|
22
|
+
val = eval(val) if val == 'true' || val == 'false'
|
23
|
+
val
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
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.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rebec
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|