hospital 0.8.4 → 0.9.0

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: a1074319a2f7179076d1ddf35612df2167dfd2ca66e6e77a488c65727090fff4
4
- data.tar.gz: 7e1532336e49b8b73c01ee6a519698714fcff224970a5a9f4c23504272b48ba9
3
+ metadata.gz: c963304ab1b5626c7215086a84406e47186499c6d96e9389b04084959a60cd83
4
+ data.tar.gz: d86541fb8461b5140472e70dbb848348c0da7ad57d2063983d3902203ca5e9c9
5
5
  SHA512:
6
- metadata.gz: 07633f2b838a3d8bef495212dd3da16953b29ffc94579a4cf9fe94c5ff0d8a8ff5165207eff071999810afc7ba12bf8c8b32c8d12245c6bc08c5071709369b5a
7
- data.tar.gz: 1d70ff1ea84cfe57c6f8ee32a573105737a78189eeefa980e313d2105d585e5a32279d607afbbd125d21555f0984053754a119270f34363568a89aa3c42af5e8
6
+ metadata.gz: 11d7061f66322aaf1df06a9ef8de14d57ca95b7913a50a8db8e369b12c6bc85c063ad7f9e44b9a4491465ff86fb6ed2deb882a4547d4141465036e5d7dc05660
7
+ data.tar.gz: 148243a5c10fb415b0b9bf58fa9f43e383420cfa161f1685169eb60ec24fff19e056c3a0dd329405dd26df64381bc4c2917079ecd16003dc23ef9155c4fe0d45
@@ -22,12 +22,22 @@ module Hospital
22
22
  end
23
23
 
24
24
  def add_checkup checkup
25
- checkup.set_group self
25
+ source_location = checkup.code.source_location
26
26
 
27
27
  if checkup.precondition
28
+ if @precondition_checkups.any? { |cu| cu.code.source_location == source_location }
29
+ warn "Hospital: Skipping duplicate precondition checkup '#{checkup.diagnosis.name}' in group '#{name}'"
30
+ return
31
+ end
32
+ checkup.set_group self
28
33
  @precondition_checkups << checkup
29
34
  else
30
- @checkups << checkup
35
+ if @checkups.any? { |cu| cu.code.source_location == source_location }
36
+ warn "Hospital: Skipping duplicate checkup '#{checkup.diagnosis.name}' in group '#{name}'"
37
+ return
38
+ end
39
+ checkup.set_group self
40
+ @checkups << checkup
31
41
  end
32
42
  end
33
43
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hospital
4
- VERSION = "0.8.4"
4
+ VERSION = "0.9.0"
5
5
  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.4
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander