canfig 0.1.0 → 0.1.1

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: ef8277d97dee3f851bbc261e27c250272de6cc7fe862391918a9edb10a99b714
4
- data.tar.gz: 85a61547bf9119ad5b31d3f1c488ac6bc7a6be8e945971444b7e3829cc2a29c7
3
+ metadata.gz: e93bb14cbee7d6538f347e414b773babf038266f19b21e2f8a84ee09c18696de
4
+ data.tar.gz: 49562f881619ae061b28b42fbc8fbb03791147ba271bf9874a66f2605534b767
5
5
  SHA512:
6
- metadata.gz: 1c5d4e0a71d5e8a3923f51229c7e925895f80cd3dce206528b6cdad4090ee548a1aad874098ecd8b5526f7bacf27d8cfae706422d64528447eaa274dba71db61
7
- data.tar.gz: 5628f2e515406cbb1362a36d54dc7b6b67118c350e2b6276ca104ac8115a2449ac4426aba2a18651112449adc7fc93a48c1ff1d6e4f2e9a1ff792e5866d96f4b
6
+ metadata.gz: 6e01a0997c25733e07ce8d6ad23e02776f45776e19fadb76dd092d8e0cfe9e4feb6105d71d5fdb443454cb848bf36b2a97574db3b35ce71988541b759505c7c7
7
+ data.tar.gz: a81749b2737652a52f9a93b7f9ad651db82e6e38f1f30e6890b4d20dfba92ed10a31ee2e1f0967f9ccf80c2aed05e983eb6ba6628f491e299b1a1ae7d7875276
data/lib/canfig/config.rb CHANGED
@@ -68,7 +68,9 @@ module Canfig
68
68
 
69
69
  def get(key, default=nil, &block)
70
70
  raise NoMethodError, "undefined method `#{key.to_s}' for #{self.to_s}" unless allowed?(key)
71
- state[key] || (block_given? ? yield : default)
71
+ state_val = state[key]
72
+ return (block_given? ? yield : default) if state_val.nil?
73
+ state_val
72
74
  end
73
75
 
74
76
  def [](key)
@@ -1,3 +1,3 @@
1
1
  module Canfig
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
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.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rebec