king_konf 0.1.9 → 0.1.10

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: b0c23bc3d4817221bb928e5bfeb5dd541ab32eb9
4
- data.tar.gz: fd4479967b814bd2de1783c56032a580b353af86
3
+ metadata.gz: 1720918d95b599552ba22661add4aebf7066bd13
4
+ data.tar.gz: 0bea3bcfc51e38894f83d8f221e88c3482d5373e
5
5
  SHA512:
6
- metadata.gz: ec19bb02a4ca10a9378c920fd4504f30ad24021b9dfb2246dac75be3b2cc870b4d31a224fae615223e969d7b88e3713749b02c860b41ca6b6f1c1269b51d09e7
7
- data.tar.gz: 77d6cf59417d004d5bf6ed432fce4c21f513db410a8ef785050754096ebc670de4df29d7245e0bfdf97a80b9395282cdbb321b2f4d8c12de4dd640c9fb3d7ce0
6
+ metadata.gz: a8509516768a5a9e84ffef2ae63ffeba5760e0f4e1fbaab6674c29cda12378c89c95f59e7b5dc92717d775847a5f22b3c8b5968d10446d62b090c9b74aab86db
7
+ data.tar.gz: 3825943e70cfc28c67f7e2718c158b4531b57092bc7403c5864e677cb24cdc63133d0dbc83532ac89a2e92735f7e8e9cab691bd62e8962cf19b756b5156bf10f
@@ -11,6 +11,15 @@ module KingKonf
11
11
  @env_prefix
12
12
  end
13
13
 
14
+ def ignore_unknown_variables(should_ignore)
15
+ @ignore_unknown_variables = should_ignore
16
+ end
17
+
18
+ def ignore_unknown_variables?
19
+ # Always ignore about unknown ENV vars if there's no prefix defined.
20
+ @ignore_unknown_variables || !env_prefix
21
+ end
22
+
14
23
  def variable(name)
15
24
  @variables.fetch(name.to_s)
16
25
  end
@@ -127,8 +136,8 @@ module KingKonf
127
136
  end
128
137
  end
129
138
 
130
- # Only complain about unknown ENV vars if there's a prefix defined.
131
- if self.class.env_prefix
139
+
140
+ unless self.class.ignore_unknown_variables?
132
141
  env.keys.grep(/^#{prefix}/).each do |key|
133
142
  unless loaded_keys.include?(key)
134
143
  raise ConfigError, "unknown environment variable #{key}"
@@ -1,3 +1,3 @@
1
1
  module KingKonf
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: king_konf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Schierbeck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-28 00:00:00.000000000 Z
11
+ date: 2018-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler