canfig 0.0.12 → 0.0.13

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: 0d19a1e225983ae80da02fce77a7d35aa9e05c2ea3c4460b434693de8d6a6340
4
- data.tar.gz: 85e143439451d3209846e2e4761205ecbaeba44cbf42dbc89263d5f4f53f7e3d
3
+ metadata.gz: 1a5e786da847f0b3b9f6c70578bcdb948f11d59bb7eab3a403ac7c4a900505a8
4
+ data.tar.gz: 21fa40cda7709f79b6604ea3f8883b84aa1f62f8e8b1bc3a73f5f415a5d4788a
5
5
  SHA512:
6
- metadata.gz: 8bf05ccd8d29215d4dd5f66b989b782d8a688fcab557567b169426582136c4a39818bd26b6f8253ceb08b93f28b670ec026458de0aaf36ed4c7209a086392c94
7
- data.tar.gz: 8e79d8407c0903522b79e75925e3697475deb4ac28f6efec2163d1624cffa5d5bb3f2ff4201259aa0fdd45d9018c5c547be3385c5f1f317d575d1358f29b3d8a
6
+ metadata.gz: 2fa3db95500d7b55fe6ceedfda1fa3467b6a6bdf212af67f5fda28fb98155d1522a4dad858165d1d3b58695c083df212a533336646dd2dc5aaa9162a666067d0
7
+ data.tar.gz: a80a8e1010ee71fd2bdded9c3c661552be8f887eb8a051711204fee0539725f19f484f1e6610224f6b9ac5ad33b4c2ea997e2bca2b3778edcdac40ddd82c4562
@@ -39,6 +39,7 @@ module Canfig
39
39
  def env(key, default=nil, &block)
40
40
  @state[key] ||= begin
41
41
  val = ENV.fetch(key.to_s.underscore.upcase, default, &block)
42
+ val = default if val.blank?
42
43
  val && ENV.key?(val.to_s) ? env(val, default, &block) : val
43
44
  end
44
45
  end
@@ -17,6 +17,7 @@ module Canfig
17
17
  key = key.to_s.underscore.upcase
18
18
  key = key.gsub(/^#{namespace}/, '') if namespace
19
19
  val = ENV.fetch("#{namespace}#{key}", default, &block)
20
+ val = default if val.blank?
20
21
  val && ENV.key?(val.to_s) ? env(val, default, &block) : val
21
22
  end
22
23
  end
@@ -1,3 +1,3 @@
1
1
  module Canfig
2
- VERSION = '0.0.12'
2
+ VERSION = '0.0.13'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canfig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rebec