configatron 2.6.2 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/configatron/core_ext/object.rb +6 -2
- data/lib/configatron/store.rb +7 -0
- metadata +3 -3
data/lib/configatron/store.rb
CHANGED
@@ -102,6 +102,11 @@ class Configatron
|
|
102
102
|
return @_store.empty?
|
103
103
|
end
|
104
104
|
|
105
|
+
def blank?
|
106
|
+
value = retrieve(@_name)
|
107
|
+
value.respond_to?(:empty?) ? value.empty? : !value
|
108
|
+
end
|
109
|
+
|
105
110
|
# Retrieves a certain parameter and if that parameter
|
106
111
|
# doesn't exist it will return the default_value specified.
|
107
112
|
def retrieve(name, default_value = nil)
|
@@ -140,6 +145,8 @@ class Configatron
|
|
140
145
|
return res
|
141
146
|
end
|
142
147
|
return val
|
148
|
+
elsif sym.to_s.match(/(.+)\?/)
|
149
|
+
return !@_store[$1.to_sym].blank?
|
143
150
|
else
|
144
151
|
store = Configatron::Store.new({}, sym, self)
|
145
152
|
@_store[sym] = store
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 2
|
7
7
|
- 6
|
8
|
-
-
|
9
|
-
version: 2.6.
|
8
|
+
- 3
|
9
|
+
version: 2.6.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- markbates
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-05-03 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|