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 +4 -4
- data/lib/canfig/config.rb +3 -1
- data/lib/canfig/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e93bb14cbee7d6538f347e414b773babf038266f19b21e2f8a84ee09c18696de
|
4
|
+
data.tar.gz: 49562f881619ae061b28b42fbc8fbb03791147ba271bf9874a66f2605534b767
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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]
|
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)
|
data/lib/canfig/version.rb
CHANGED