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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rails_env_config.rb +14 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf92f2a1ae1bdbc9c8ff5b8a41275c6e3b3d00ac
4
- data.tar.gz: bfc6d4157166f5db6a2075050f66f9d3c19b8e23
3
+ metadata.gz: 1cd99f7ecba2e012c28658b7ddcdb658d27d3bd8
4
+ data.tar.gz: 2274d0015a4ef69a80f944c6a614e29aa2f78103
5
5
  SHA512:
6
- metadata.gz: cd0da5d49909558fa14cb7bc63f17a56c46e87f337a46e8992f0438d82fc0457a1177c95ac23d359874c6391693ce79e60481ba103995c8b6b78f7dd1b282318
7
- data.tar.gz: 753bb807b813bec384e06055f6563c21f8439a4105eca65dcdb99de6690ca6d7cad1f34a6bc867a70cb7fda6c742ec2e1ad46cea7d552e2a125b450f609163ed
6
+ metadata.gz: e764430b3b26042f7ece85e28f2a0fa5d12ea8abc0da87d4c8ce4c04859ee00ff2bfb662b10450b4d4406ac408666de9bf62acab18effe8063a2de1d2b316293
7
+ data.tar.gz: 38534901179ec3aa59a343e3bf3b2c8eb99ade8e067b6dc91e4a816c9c018ae4c8ccf326e986f3eda4b6e2c9a92b53ff6161118d863ea678d955eedd292c73a5
@@ -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
- true
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_env_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke