env_inspector 0.1.1 → 0.1.2

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: 6fa8e5cdb4ed01e31cef8c5a2ac40b7094a59ec1
4
- data.tar.gz: 2979ff23a720e92ff2a6bc2774fbc74990b93e87
3
+ metadata.gz: 1b287211fb322074488b2ccb328f6d71ca900069
4
+ data.tar.gz: 1f581b8addf05af775d18069289eada211558a88
5
5
  SHA512:
6
- metadata.gz: 7541bcc2f92b7e8a571ac3bb149e055ed5aa82ddc9b6ebac03dd5e398574b1b110614d6872d3308fa2e46e0b2ef584ba2f39f522e19cd1044ca0efdadc191c6e
7
- data.tar.gz: 80f64c243c123199246db25ea4adf0a5a78c229203d03007b60508b16d5f68211a2fcd7e3f9439375b1783956248de95d2a60a58f7adb9a61115491a2df65aba
6
+ metadata.gz: b20ead8535ba4db1e238aaebc338d7689bff353ca7d93acd79f07ac32c14fd4d0c61d503cc3f014f5647fd74c42e71ccdd24938de67da09e265a09e1516811e1
7
+ data.tar.gz: 93e97b36121c63f72b1a9d01c1523db57b856830644437ea188bf016b6234428022b17ac67ecf16a3b5aea53cb91b3ddf45c48d468c5ce74c0c5b0a5ada61721
data/.gitignore CHANGED
@@ -11,3 +11,4 @@
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
13
  .idea
14
+ .byebug_history
data/README.md CHANGED
@@ -1,9 +1,5 @@
1
1
  # EnvInspector
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/env_inspector`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
3
  ## Installation
8
4
 
9
5
  Add this line to your application's Gemfile:
@@ -0,0 +1,21 @@
1
+ module EnvInspector
2
+ def self.configuration
3
+ @configuration ||= Configuration.new
4
+ end
5
+
6
+ def self.configuration=(configuration)
7
+ @configuration = configuration
8
+ end
9
+
10
+ def self.configure
11
+ yield configuration
12
+ end
13
+
14
+ class Configuration
15
+ attr_accessor :env_list
16
+
17
+ def initialize
18
+ @env_list = []
19
+ end
20
+ end
21
+ end
@@ -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 if ENV[env.to_s].empty?
6
+ memo << env unless ENV[env.to_s]
7
7
  memo
8
8
  end
9
9
  unless missing_envs.empty?
10
- raise RememberEnv::Errors::EnvMissing, "ENVs are not defined: #{missing_envs.join(', ')}"
10
+ raise EnvInspector::Errors::EnvMissing, "ENVs are not defined: #{missing_envs.join(', ')}"
11
11
  end
12
12
  end
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module EnvInspector
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/env_inspector.rb CHANGED
@@ -1,22 +1,5 @@
1
1
  require 'env_inspector/version'
2
+ require 'env_inspector/configuration'
2
3
  require 'env_inspector/errors/env_missing'
3
4
  require 'env_inspector/inspector'
4
5
 
5
- module EnvInspector
6
- class << self
7
- attr_accessor :configuration
8
- end
9
-
10
- def self.configure
11
- self.configuration ||= Configuration.new
12
- yield(configuration)
13
- end
14
-
15
- class Configuration
16
- attr_accessor :env_list
17
-
18
- def initialize
19
- @env_list = []
20
- end
21
- end
22
- end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: env_inspector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Nikitashin
@@ -56,6 +56,7 @@ files:
56
56
  - bin/setup
57
57
  - env_inspector.gemspec
58
58
  - lib/env_inspector.rb
59
+ - lib/env_inspector/configuration.rb
59
60
  - lib/env_inspector/errors/env_missing.rb
60
61
  - lib/env_inspector/inspector.rb
61
62
  - lib/env_inspector/version.rb