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.
@@ -5,5 +5,9 @@ class Object # :nodoc:
5
5
  [methods].flatten.each {|m| obj = obj.send(m, *args)}
6
6
  obj
7
7
  end
8
-
9
- end
8
+
9
+ def blank? # ported ActiveSupport method
10
+ respond_to?(:empty?) ? empty? : !self
11
+ end
12
+
13
+ end
@@ -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
- - 2
9
- version: 2.6.2
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-04-27 00:00:00 -04:00
17
+ date: 2010-05-03 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency