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 +4 -4
- data/lib/env_inspector/configuration.rb +10 -8
- data/lib/env_inspector/inspector.rb +2 -2
- data/lib/env_inspector/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7605383980747375bf381148230e26c71b356e0
|
4
|
+
data.tar.gz: d4528b4a36722da6d0fded74358444aa4acd7ac8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8abb63e827ab45402340e4cc745837a3fc29a1f86850c4fb6104a4fe8d49d4e944c1a6546ef46018a90648625a00a286619ec66901e43b6d15712de14e86333
|
7
|
+
data.tar.gz: ab16bd4f813999ee84d6247c415d5b8e1a9a62edb3d726907cc031b9833a3f33d5962a0c03e49f0187bea2d653380468097c1f7789e975c2911c87472b8679f2
|
@@ -1,14 +1,16 @@
|
|
1
1
|
module EnvInspector
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
class << self
|
3
|
+
def configuration
|
4
|
+
@configuration ||= Configuration.new
|
5
|
+
end
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
def configuration=(configuration)
|
8
|
+
@configuration = configuration
|
9
|
+
end
|
9
10
|
|
10
|
-
|
11
|
-
|
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
|
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
|
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.
|
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-
|
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.
|
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.
|