checkability 0.4.0 → 0.4.1
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/checkability/checkable.rb +8 -8
- data/lib/checkability/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: ae846f196e0b6d2648429f824e02205b9a3fe04d
|
4
|
+
data.tar.gz: 10156c70279d72817146d19fceaef9cbba3f116d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 990b1575b7ebfb0e667aa1ab2e6a0601e3388ea1b2ecd7f4808d843d1341085f454477804fa8f0edeb743fd2508fdb16d2b7a9eb2d8451a20a212791f67f411d
|
7
|
+
data.tar.gz: 445c267c33c75d63188d6ec04767409afed7734292a369e880d8e1d1cc03b5b8a9af80339b076968d60816ec9834901ab9ed6a7299606b9d3fe496276e869af3
|
@@ -17,21 +17,21 @@ module Checkability
|
|
17
17
|
# e.g. [storage_checker, external_api_checker]
|
18
18
|
def check(opts = {})
|
19
19
|
results = []
|
20
|
-
opts[:
|
21
|
-
results << (res = _checker_to_check_value(
|
22
|
-
break if res &&
|
23
|
-
break if res == false &&
|
20
|
+
opts[:checker_confs].each do |checker_conf|
|
21
|
+
results << (res = _checker_to_check_value(checker_conf))
|
22
|
+
break if res && checker_conf[:stop_process_if_success]
|
23
|
+
break if res == false && checker_conf[:stop_process_if_failure]
|
24
24
|
end
|
25
25
|
opts[:strategy].call(results)
|
26
26
|
end
|
27
27
|
|
28
28
|
private
|
29
29
|
|
30
|
-
def _checker_to_check_value(
|
31
|
-
k = "Checkability::#{
|
32
|
-
k.new(
|
30
|
+
def _checker_to_check_value(checker_conf)
|
31
|
+
k = "Checkability::#{checker_conf[:name].to_s.camelize}".constantize
|
32
|
+
k.new(checker_conf).check_value(checkable)
|
33
33
|
rescue NameError => e
|
34
|
-
checkable.messages << "#{e}: #{
|
34
|
+
checkable.messages << "#{e}: #{checker_conf[:name]}."
|
35
35
|
false
|
36
36
|
end
|
37
37
|
end
|
data/lib/checkability/version.rb
CHANGED