revolutionhealth-config_loader 2.0.0 → 2.0.40655071

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/Rakefile CHANGED
@@ -4,7 +4,7 @@ require 'rubygems/specification'
4
4
  require 'date'
5
5
 
6
6
  GEM = "config_loader"
7
- GEM_VERSION = "2.0.0"
7
+ GEM_VERSION = "2.0." + `git rev-parse --short HEAD`.to_s.hex.to_s
8
8
  AUTHOR = "Revolution Health"
9
9
  EMAIL = "rails-trunk@revolutionhealth.com"
10
10
  HOMEPAGE = %q{http://github.com/revolutionhealth/config_loader}
data/lib/config_loader.rb CHANGED
@@ -45,9 +45,15 @@ require File.join(File.dirname(__FILE__), 'service_config')
45
45
 
46
46
  class ConfigurationLoader
47
47
 
48
- def initialize(cache_option = :force_cache, base_path = nil)
48
+ def initialize(cache_option = :defer_cache, base_path = nil)
49
49
  @caching = (cache_option == :force_cache)
50
50
  @base_path = base_path
51
+ # defer caching until rails has finished initializing and thus all gems are loaded
52
+ if cache_option == :defer_cache && Object.const_defined?(:Rails)
53
+ Rails::configuration.after_initialize do
54
+ self.instance_eval { @caching = true }
55
+ end
56
+ end
51
57
  end
52
58
 
53
59
  def load_file(file, use_env = false)
@@ -246,4 +252,4 @@ private
246
252
 
247
253
  end
248
254
 
249
- ::ConfigLoader = ConfigurationLoader.new unless defined?(ConfigLoader)
255
+ ::ConfigLoader = ConfigurationLoader.new unless defined?(ConfigLoader)
@@ -0,0 +1,6 @@
1
+ test:
2
+ adapter: mysql
3
+ database: trunk_test
4
+ username: root
5
+ password:
6
+ host: localhost
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: revolutionhealth-config_loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.40655071
5
5
  platform: ruby
6
6
  authors:
7
7
  - Revolution Health
@@ -9,7 +9,7 @@ autorequire: config_loader
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-06-25 00:00:00 -07:00
12
+ date: 2008-07-23 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -31,12 +31,12 @@ files:
31
31
  - lib/config_loader.rb
32
32
  - lib/service_config.rb
33
33
  - test/config
34
- - test/test_config_reload.rb
35
- - test/test_helper.rb
36
- - test/test_service_config.rb
37
34
  - test/config/database.yml
38
35
  - test/config/service.yml
39
36
  - test/config/test_reload.yml
37
+ - test/test_config_reload.rb
38
+ - test/test_helper.rb
39
+ - test/test_service_config.rb
40
40
  has_rdoc: true
41
41
  homepage: http://github.com/revolutionhealth/config_loader
42
42
  post_install_message: