rails_env_config 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails_env_config.rb +14 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cd99f7ecba2e012c28658b7ddcdb658d27d3bd8
|
4
|
+
data.tar.gz: 2274d0015a4ef69a80f944c6a614e29aa2f78103
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e764430b3b26042f7ece85e28f2a0fa5d12ea8abc0da87d4c8ce4c04859ee00ff2bfb662b10450b4d4406ac408666de9bf62acab18effe8063a2de1d2b316293
|
7
|
+
data.tar.gz: 38534901179ec3aa59a343e3bf3b2c8eb99ade8e067b6dc91e4a816c9c018ae4c8ccf326e986f3eda4b6e2c9a92b53ff6161118d863ea678d955eedd292c73a5
|
data/lib/rails_env_config.rb
CHANGED
@@ -11,10 +11,23 @@ module RailsEnvConfig
|
|
11
11
|
YAML.load(File.open(path)).each do |key, value|
|
12
12
|
ENV[key.to_s] = value
|
13
13
|
end
|
14
|
-
|
14
|
+
callbacks.each(&:call)
|
15
|
+
@loaded = true
|
15
16
|
else
|
16
17
|
false
|
17
18
|
end
|
18
19
|
end
|
19
20
|
|
21
|
+
def self.callbacks
|
22
|
+
@callbacks ||= []
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.callback(&block)
|
26
|
+
if @loaded
|
27
|
+
block.call
|
28
|
+
else
|
29
|
+
self.callbacks << block
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
20
33
|
end
|