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.
- data/README +4 -4
- data/lib/configatron/rails.rb +7 -7
- 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
|
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
|
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
|
147
|
+
if Rails.env == 'production'
|
148
148
|
configatron.memcached.servers = ['192.168.0.1:11211']
|
149
|
-
elsif
|
149
|
+
elsif Rails.env == 'staging'
|
150
150
|
configatron.memcached.servers = ['192.168.0.2:11211']
|
151
151
|
end
|
152
152
|
|
data/lib/configatron/rails.rb
CHANGED
@@ -10,21 +10,21 @@ class Configatron
|
|
10
10
|
# Loads configatron files in the following order:
|
11
11
|
#
|
12
12
|
# Example:
|
13
|
-
# <
|
14
|
-
# <
|
13
|
+
# <Rails.root>/config/configatron/defaults.rb
|
14
|
+
# <Rails.root>/config/configatron/<Rails.env>.rb
|
15
15
|
# # optional:
|
16
|
-
# <
|
17
|
-
# <
|
18
|
-
# <
|
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?(
|
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?(
|
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
|
-
-
|
9
|
-
version: 2.6.
|
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-
|
17
|
+
date: 2010-04-27 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|