env_inspector 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b287211fb322074488b2ccb328f6d71ca900069
4
- data.tar.gz: 1f581b8addf05af775d18069289eada211558a88
3
+ metadata.gz: e7605383980747375bf381148230e26c71b356e0
4
+ data.tar.gz: d4528b4a36722da6d0fded74358444aa4acd7ac8
5
5
  SHA512:
6
- metadata.gz: b20ead8535ba4db1e238aaebc338d7689bff353ca7d93acd79f07ac32c14fd4d0c61d503cc3f014f5647fd74c42e71ccdd24938de67da09e265a09e1516811e1
7
- data.tar.gz: 93e97b36121c63f72b1a9d01c1523db57b856830644437ea188bf016b6234428022b17ac67ecf16a3b5aea53cb91b3ddf45c48d468c5ce74c0c5b0a5ada61721
6
+ metadata.gz: e8abb63e827ab45402340e4cc745837a3fc29a1f86850c4fb6104a4fe8d49d4e944c1a6546ef46018a90648625a00a286619ec66901e43b6d15712de14e86333
7
+ data.tar.gz: ab16bd4f813999ee84d6247c415d5b8e1a9a62edb3d726907cc031b9833a3f33d5962a0c03e49f0187bea2d653380468097c1f7789e975c2911c87472b8679f2
@@ -1,14 +1,16 @@
1
1
  module EnvInspector
2
- def self.configuration
3
- @configuration ||= Configuration.new
4
- end
2
+ class << self
3
+ def configuration
4
+ @configuration ||= Configuration.new
5
+ end
5
6
 
6
- def self.configuration=(configuration)
7
- @configuration = configuration
8
- end
7
+ def configuration=(configuration)
8
+ @configuration = configuration
9
+ end
9
10
 
10
- def self.configure
11
- yield configuration
11
+ def configure
12
+ yield configuration
13
+ end
12
14
  end
13
15
 
14
16
  class Configuration
@@ -3,11 +3,11 @@ module EnvInspector
3
3
  def self.check!
4
4
  required_envs = EnvInspector.configuration.env_list
5
5
  missing_envs = required_envs.inject([]) do |memo, env|
6
- memo << env unless ENV[env.to_s]
6
+ memo << env if ENV[env.to_s].nil? || ENV[env.to_s].empty?
7
7
  memo
8
8
  end
9
9
  unless missing_envs.empty?
10
- raise EnvInspector::Errors::EnvMissing, "ENVs are not defined: #{missing_envs.join(', ')}"
10
+ raise EnvInspector::Errors::EnvMissing, "ENVs are not defined or empty: #{missing_envs.join(', ')}"
11
11
  end
12
12
  end
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module EnvInspector
2
- VERSION = "0.1.2"
2
+ VERSION = '0.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: env_inspector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Nikitashin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-08 00:00:00.000000000 Z
11
+ date: 2018-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.6.11
83
+ rubygems_version: 2.6.14
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: Don't forget to setup your ENVs.