app_config 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift File.dirname(__FILE__)
4
4
  require 'core_ext/hashish'
5
5
 
6
6
  module AppConfig
7
- VERSION = '0.5.2'
7
+ VERSION = '0.5.3'
8
8
 
9
9
  autoload :Base, 'app_config/base'
10
10
  autoload :Error, 'app_config/error'
@@ -18,6 +18,11 @@ module AppConfig
18
18
  @@storage = AppConfig::Base.new(options, &block)
19
19
  end
20
20
 
21
+ # Returns +true+ if +AppConfig.setup()+ has been called.
22
+ def setup?
23
+ defined?(@@storage) && @@storage
24
+ end
25
+
21
26
  # Clears the <tt>@@storage</tt>.
22
27
  def reset!
23
28
  @@storage = nil if defined?(@@storage)
@@ -10,6 +10,10 @@ describe AppConfig do
10
10
  AppConfig.should respond_to(:setup)
11
11
  end
12
12
 
13
+ it 'responds to .setup?()' do
14
+ AppConfig.should respond_to(:setup?)
15
+ end
16
+
13
17
  it 'responds to .reset!()' do
14
18
  AppConfig.should respond_to(:reset!)
15
19
  end
@@ -43,4 +47,14 @@ describe AppConfig do
43
47
  end
44
48
  end
45
49
 
50
+ it 'should not be setup' do
51
+ AppConfig.reset!
52
+ AppConfig.should_not be_setup
53
+ end
54
+
55
+ it 'should be setup' do
56
+ config_for_yaml
57
+ AppConfig.should be_setup
58
+ end
59
+
46
60
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_config
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 2
10
- version: 0.5.2
9
+ - 3
10
+ version: 0.5.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dale Campbell
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-05 00:00:00 -04:00
18
+ date: 2010-11-07 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency