hospital 0.8.3 → 0.8.4

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
  SHA256:
3
- metadata.gz: bfcbe599829bcaf2c9cb197b398f44a6571d9ab67cc50ccb0b17e35c0ee7a490
4
- data.tar.gz: de51adaacd2978a830f793346d27bebd563ed200dcc6e8e9739fe9d1695dae51
3
+ metadata.gz: a1074319a2f7179076d1ddf35612df2167dfd2ca66e6e77a488c65727090fff4
4
+ data.tar.gz: 7e1532336e49b8b73c01ee6a519698714fcff224970a5a9f4c23504272b48ba9
5
5
  SHA512:
6
- metadata.gz: 6573587d48ee9f18fbd9f4993db20872fcecff2b35533af8c0a70137b8038b4aceba4a486864c16114350ae089a4cc6e712eddc16fb50a8dcc0fd1ac8dfa0fc8
7
- data.tar.gz: cb776fcc3cce26a735e110e180900b4d137c649402d619f90f88cfcce641c1118ef937ae5cccdacf8b27bbb80e9d8318a7a41fa42f531ec80e8c4a5ed2737d1d
6
+ metadata.gz: 07633f2b838a3d8bef495212dd3da16953b29ffc94579a4cf9fe94c5ff0d8a8ff5165207eff071999810afc7ba12bf8c8b32c8d12245c6bc08c5071709369b5a
7
+ data.tar.gz: 1d70ff1ea84cfe57c6f8ee32a573105737a78189eeefa980e313d2105d585e5a32279d607afbbd125d21555f0984053754a119270f34363568a89aa3c42af5e8
@@ -13,8 +13,8 @@ module Hospital
13
13
  @buffer << "\n\n## Checking #{text}"
14
14
  end
15
15
 
16
- def put_diagnosis_skipped text
17
- @buffer << "\n\n## Skipped #{text}"
16
+ def put_diagnosis_skipped text, verbose: false
17
+ @buffer << "\n\n## Skipped #{text}" if verbose
18
18
  end
19
19
 
20
20
  def put_summary errors_count, warnings_count, infos_count
@@ -7,20 +7,24 @@ module Hospital
7
7
  class Raw < Base
8
8
 
9
9
  def initialize
10
- @data = {}
10
+ @data = {}
11
11
  @current_group = nil
12
12
  @current_diagnosis = nil
13
13
  end
14
14
 
15
15
  def put_group_header text
16
16
  @current_group = text
17
+ @data[@current_group] ||= {}
17
18
  end
18
19
 
19
20
  def put_diagnosis_header text
20
21
  @current_diagnosis = text
22
+ @data[@current_group][@current_diagnosis] ||= []
21
23
  end
22
24
 
23
- def put_diagnosis_skipped text
25
+ def put_diagnosis_skipped text, verbose: false
26
+ # don't overwrite existing entry (in case of name collision)
27
+ @data[@current_group][text] ||= { 'skipped' => true }
24
28
  end
25
29
 
26
30
  def put_summary errors_count, warnings_count, infos_count
@@ -32,8 +36,6 @@ module Hospital
32
36
  end
33
37
 
34
38
  def put_diagnosis_result result
35
- @data[@current_group] ||= {}
36
- @data[@current_group][@current_diagnosis] ||= []
37
39
  @data[@current_group][@current_diagnosis] << {
38
40
  'type' => result.type,
39
41
  'message' => result.message
@@ -13,8 +13,8 @@ module Hospital
13
13
  @buffer << "\nChecking #{text.h2.indented}"
14
14
  end
15
15
 
16
- def put_diagnosis_skipped text
17
- @buffer << "\nSkipped #{text.h2.indented}"
16
+ def put_diagnosis_skipped text, verbose: false
17
+ @buffer << "\nSkipped #{text.h2.indented}" if verbose
18
18
  end
19
19
 
20
20
  def put_summary errors_count, warnings_count, infos_count
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hospital
4
- VERSION = "0.8.3"
4
+ VERSION = "0.8.4"
5
5
  end
data/lib/hospital.rb CHANGED
@@ -115,8 +115,9 @@ module Hospital
115
115
  if !checkup.skipped && (!checkup.group.skipped || checkup.precondition)
116
116
  @out.put_diagnosis_header "#{diagnosis.name}:"
117
117
  diagnosis.put_results @out
118
- elsif verbose
119
- @out.put_diagnosis_skipped "Skipped #{diagnosis.name}."
118
+ elsif !checkup.skipped
119
+ # checkup was skipped due to group precondition failure
120
+ @out.put_diagnosis_skipped "#{diagnosis.name}:", verbose: verbose
120
121
  end
121
122
  end
122
123
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hospital
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander