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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 63aae1d8878cbe6e4d5f09c34dcc18ecb499e2f9
4
- data.tar.gz: f6d2bda882b8536b8cae8cd28e2675e3341b63fc
3
+ metadata.gz: b97132adaed0144f56e5fd294aeff6346d2a9e6b
4
+ data.tar.gz: e8a6488828ee9923f258a5b74d3e0329ede4fbcb
5
5
  SHA512:
6
- metadata.gz: 9639ee0edcc66ff8811851e52f68885b473eeb6f67042b0859a6e6af27b6f4e036b54be94e1e4061684113f27f82952f7e5105d0e714a225cba1fc90dd43c7e5
7
- data.tar.gz: 6a89fdba345053101e40e54585fbfaf000479132656438c24df9bf0f676d940357989cef74b0932796f95c52c99d314cd71a231242374b76f795b3b0dc49ba0e
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
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "conf_conf"
7
- s.version = "1.0.0"
7
+ s.version = "1.0.1"
8
8
  s.licenses = ["MIT"]
9
9
  s.authors = ["James Kassemi"]
10
10
  s.email = ["jkassemi@gmail.com"]
data/lib/conf_conf.rb CHANGED
@@ -56,7 +56,7 @@ module ConfConf
56
56
  end
57
57
 
58
58
  def environment_key
59
- key.to_s.upcase
59
+ options[:from] || key.to_s.upcase
60
60
  end
61
61
  end
62
62
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conf_conf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Kassemi