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 +4 -4
- data/lib/washout_builder/env_checker.rb +16 -5
- data/lib/washout_builder/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dc7e6ea7e195d33a0a4a362241369996d23fe3f
|
4
|
+
data.tar.gz: 64c605cb3b29d64ba668ba0402af70a9d07979dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 :
|
5
|
-
attr_writer :
|
4
|
+
attr_reader :app
|
5
|
+
attr_writer :app
|
6
6
|
|
7
7
|
def initialize(app)
|
8
|
-
self.
|
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)
|