configatron 2.6.0 → 2.6.2

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.
Files changed (3) hide show
  1. data/README +4 -4
  2. data/lib/configatron/rails.rb +7 -7
  3. metadata +3 -3
data/README CHANGED
@@ -124,11 +124,11 @@ There are times when you want to refer to one configuration setting in another c
124
124
  configatron.page_caching.servers = configatron.memcached.servers
125
125
  configatron.object_caching.servers = configatron.memcached.servers
126
126
 
127
- if RAILS_ENV == 'production'
127
+ if Rails.env == 'production'
128
128
  configatron.memcached.servers = ['192.168.0.1:11211']
129
129
  configatron.page_caching.servers = configatron.memcached.servers
130
130
  configatron.object_caching.servers = configatron.memcached.servers
131
- elsif RAILS_ENV == 'staging'
131
+ elsif Rails.env == 'staging'
132
132
  configatron.memcached.servers = ['192.168.0.2:11211']
133
133
  configatron.page_caching.servers = configatron.memcached.servers
134
134
  configatron.object_caching.servers = configatron.memcached.servers
@@ -144,9 +144,9 @@ With <code>Delayed</code> settings execution of the setting doesn't happen until
144
144
  configatron.page_caching.servers = Configatron::Delayed.new {configatron.memcached.servers}
145
145
  configatron.object_caching.servers = Configatron::Delayed.new {configatron.memcached.servers}
146
146
 
147
- if RAILS_ENV == 'production'
147
+ if Rails.env == 'production'
148
148
  configatron.memcached.servers = ['192.168.0.1:11211']
149
- elsif RAILS_ENV == 'staging'
149
+ elsif Rails.env == 'staging'
150
150
  configatron.memcached.servers = ['192.168.0.2:11211']
151
151
  end
152
152
 
@@ -10,21 +10,21 @@ class Configatron
10
10
  # Loads configatron files in the following order:
11
11
  #
12
12
  # Example:
13
- # <RAILS_ROOT>/config/configatron/defaults.rb
14
- # <RAILS_ROOT>/config/configatron/<RAILS_ENV>.rb
13
+ # <Rails.root>/config/configatron/defaults.rb
14
+ # <Rails.root>/config/configatron/<Rails.env>.rb
15
15
  # # optional:
16
- # <RAILS_ROOT>/config/configatron/<RAILS_ENV>/defaults.rb
17
- # <RAILS_ROOT>/config/configatron/<RAILS_ENV>/bar.rb
18
- # <RAILS_ROOT>/config/configatron/<RAILS_ENV>/foo.rb
16
+ # <Rails.root>/config/configatron/<Rails.env>/defaults.rb
17
+ # <Rails.root>/config/configatron/<Rails.env>/bar.rb
18
+ # <Rails.root>/config/configatron/<Rails.env>/foo.rb
19
19
  def self.init(root = nil, env = nil)
20
20
  base_dir = root
21
21
  if root.nil?
22
- root = defined?(RAILS_ROOT) ? RAILS_ROOT : FileUtils.pwd
22
+ root = defined?(Rails) ? ::Rails.root : FileUtils.pwd
23
23
  base_dir = File.expand_path(File.join(root, 'config', 'configatron'))
24
24
  end
25
25
 
26
26
  if env.nil?
27
- env = defined?(RAILS_ENV) ? RAILS_ENV : 'development'
27
+ env = defined?(Rails) ? ::Rails.env : 'development'
28
28
  end
29
29
 
30
30
  config_files = []
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 6
8
- - 0
9
- version: 2.6.0
8
+ - 2
9
+ version: 2.6.2
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-03-09 00:00:00 -05:00
17
+ date: 2010-04-27 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency