washout_builder 1.5.4 → 1.5.5

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: 58ddc0ed8659194221302f8426799406d9d644f5
4
- data.tar.gz: 0971efe12aa954bad70eab623c26d32f5fc50437
3
+ metadata.gz: 8dc7e6ea7e195d33a0a4a362241369996d23fe3f
4
+ data.tar.gz: 64c605cb3b29d64ba668ba0402af70a9d07979dc
5
5
  SHA512:
6
- metadata.gz: eaad7cdf361ca750bb6fde10170eda3ebfa80d19f93dcf4264ef087651f78883cfda2f7ab2a633d506b699bf616283c4f9d6a53d111492ed4332e3edd8b475a6
7
- data.tar.gz: b51660e711e44f976f3b99824872d2a6ae55978f94985e5ee8b208cca0ab6a029559b318681d699f96f42b3271fa08ea4db64e5bef778ad06565740a2a919a6e
6
+ metadata.gz: 2ac880adc0793bba065b05010f03157f84386acdeac912545546bfff6293c5e9667dfa54add50b03147b472c43ec35a75c4b460240519797a1a9ff6e8e6bb0cc
7
+ data.tar.gz: 4ae8010d1307b9663a0bdb7330684de29199ed118280f85abcc375a4f3711231b2381d53278420bcf8f18c8cc55cd302903ec502b5f3383ccdc3786c57fa342e
@@ -1,12 +1,11 @@
1
1
  module WashoutBuilder
2
2
  class EnvChecker
3
3
 
4
- attr_reader :whitelist, :blacklist
5
- attr_writer :whitelist, :blacklist
4
+ attr_reader :app
5
+ attr_writer :app
6
6
 
7
7
  def initialize(app)
8
- self.whitelist = get_valid_data(app.config.washout_builder[:whitelisted_envs])
9
- self.blacklist = get_valid_data(app.config.washout_builder[:blacklisted_envs])
8
+ self.app = app
10
9
  end
11
10
 
12
11
  def available_for_env?(env_name)
@@ -25,12 +24,24 @@ module WashoutBuilder
25
24
 
26
25
  private
27
26
 
27
+ def whitelist
28
+ get_valid_data(app_config[:whitelisted_envs])
29
+ end
30
+
31
+ def blacklist
32
+ get_valid_data(app_config[:blacklisted_envs])
33
+ end
34
+
35
+ def app_config
36
+ app.config.washout_builder
37
+ end
38
+
28
39
  def valid_for_env?(list, env_name)
29
40
  try_find_suitable_env(list, env_name).present?
30
41
  end
31
42
 
32
43
  def get_valid_data(list)
33
- list.is_a?(Array) ? list : [list].compact
44
+ (list.is_a?(Array) ? list : [list]).compact
34
45
  end
35
46
 
36
47
  def try_find_suitable_env(list, env_name)
@@ -12,7 +12,7 @@ module WashoutBuilder
12
12
  # the minor version of the gem
13
13
  MINOR = 5
14
14
  # the tiny version of the gem
15
- TINY = 4
15
+ TINY = 5
16
16
  # if the version should be a prerelease
17
17
  PRE = nil
18
18
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: washout_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada