env_lint 0.0.3 → 0.0.4

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: 6fd240de9e5e9e0ac7af95569c5b53be92d3e053
4
- data.tar.gz: d6a635c729e9f4204bbb55becd4285867ae8e6ab
3
+ metadata.gz: de03a4e6877d1f5417a25364a2e9de97122d2089
4
+ data.tar.gz: bc38119bb9c5e3978a326c3c012873c54a10cdf3
5
5
  SHA512:
6
- metadata.gz: e0fc2ab83fd65c552e272c1a100cedb9af0ede1b7136fb84d00856b2b7196331c88a7c6bceb5ab81dc69afcc5b3915998f304b470e77c7aac9fc2c6a4c789dea
7
- data.tar.gz: e674ab0cd397ddc9b8a671f72467545c9043ef86f5d711be393f029171af623a29083323cadc092527527b61458a9d7c1a875447e0c6656fb77b14a4c15c0ca5
6
+ metadata.gz: a33bd418378fbc2ef3e08a9f0e1eb9455a9860976f566909fc4094e8776a67d6f4be5d5514a9657bf3394ace78df14318230b805921438e6a0a983c065efdd3f
7
+ data.tar.gz: f759459f8455d6fac91731c9e254610f66412af508bd388a4da9f5985892be3b4d9faf5a286792c13ccd51b3dcfeb275e8964c289155f0eae7258ce2f6ba664f
@@ -16,7 +16,7 @@ module EnvLint
16
16
  end
17
17
 
18
18
  block ||= lambda do |i|
19
- args.any? ? args.first : raise(MissingVariable.new(name))
19
+ args.empty? ? raise(MissingVariable.new(name)) : args.first
20
20
  end
21
21
 
22
22
  @env.fetch(name, &block)
@@ -1,3 +1,3 @@
1
1
  module EnvLint
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -47,6 +47,14 @@ module EnvLint
47
47
  expect(linted_env.fetch('APP', 'default')).to eq('default')
48
48
  end
49
49
 
50
+ it 'allows default value to be false' do
51
+ env = {}
52
+ dot_env_file = DotEnvFile.new('.env.example', [Variable.new('APP')])
53
+ linted_env = LintedEnv.new(env, dot_env_file)
54
+
55
+ expect(linted_env.fetch('APP', false)).to eq(false)
56
+ end
57
+
50
58
  it 'returns default from block for undefined variable' do
51
59
  env = {}
52
60
  dot_env_file = DotEnvFile.new('.env.example', [Variable.new('APP')])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: env_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Fischbach