conf_conf 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/conf_conf.gemspec +1 -1
- data/lib/conf_conf.rb +1 -1
- data/spec/conf_conf_spec.rb +9 -0
- 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: b97132adaed0144f56e5fd294aeff6346d2a9e6b
|
4
|
+
data.tar.gz: e8a6488828ee9923f258a5b74d3e0329ede4fbcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5061abb3d321fc3cc58bd7d60a12d57cffcbb4b3a6b348fb54fa00d5c30d80aa12fa9ab1910ecdec122c8ff98656d2812e6b6250658b1bdebbaa7b7535dd6187
|
7
|
+
data.tar.gz: c0dc60294413944698ba812d936d00a187ac922eba19f1285f54855a66d4a2fc35e41caa2f000ec73d724ede71ee989bbd3cb68939640aad27aa301e87278257
|
data/README.md
CHANGED
@@ -30,6 +30,9 @@ ConfConf.rails_configuration do
|
|
30
30
|
|
31
31
|
# Sets Rails.configuration.admin to a boolean value of true or false, app fails to boot if not present
|
32
32
|
config :admin, { |admin| admin ? true : false }
|
33
|
+
|
34
|
+
# Sets Rails.configuration.public_key from ENV["PUBLIC_KEY_WITH_ALT_NAME"]
|
35
|
+
config :public_key, from: "PUBLIC_KEY_WITH_ALT_NAME"
|
33
36
|
end
|
34
37
|
```
|
35
38
|
|
data/conf_conf.gemspec
CHANGED
data/lib/conf_conf.rb
CHANGED
data/spec/conf_conf_spec.rb
CHANGED
@@ -23,6 +23,15 @@ describe ConfConf do
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
+
it "sets value from specified environment key" do
|
27
|
+
ENV["TEST_KEY"] = "hey"
|
28
|
+
expect(configuration).to receive(:other_key=).with("hey")
|
29
|
+
|
30
|
+
ConfConf.rails_configuration do
|
31
|
+
config :other_key, from: "TEST_KEY"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
26
35
|
it "throws an exception when required key not present" do
|
27
36
|
expect {
|
28
37
|
ConfConf.rails_configuration do
|