vaccination-characteristics 1.4.0 → 1.4.2

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: 8a4db6b756e272a410157d709f20d850762541932af3298cf1c57f185ea110de
4
- data.tar.gz: 50195f0bbbd3eb13f2e5e861a65d2768c022f6b99d47c82e527019345f0570de
3
+ metadata.gz: 2de8d7c92a565d6e60cedf3087cb403947dd705dc09528f0ddd857aa3c8919d2
4
+ data.tar.gz: cd8c673cddb887e6e741e8ee8da3fbfc4aa1f981539bd563efe35048a49733db
5
5
  SHA512:
6
- metadata.gz: 7449bd17a51079ad0f54f7b56cdf5cf45276fd21f78892bb4c0ac407e772e8f7ccad152f55e15cf559d94688b9d0950257ec2c598f513760b0666aaf3fff6e1f
7
- data.tar.gz: 172c683377ff8764f9c03f8760cc004fdffb9f175ab71286585270b40d8b38f1d33e48b53bf5f9df7d12175cf1af2ea0dbe460d475c2ccaa36018bdcf269b0f7
6
+ metadata.gz: '04090dd0bb92db360eff30b448837da07672b435b53b5deb6c2a18457a1fd1bf31c8801e44f7f440189dee67f76e59d5c67b4df4971ebf25137dcd865723b8ec'
7
+ data.tar.gz: bf45d057d6d7f32626710e977d39721dffd060b231268d2044df67578ef6ad5f389f62f9ad90da11de208b7399e6968a789e19562f6a470dd31d8775ce68fd39
data/Changelog.md CHANGED
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Added
11
11
 
12
- - Add the timestamp `Condition#deprecated_on` field, exposed as a `Date` using the UTC calendar day (or `nil` for active conditions). Deprecated conditions remain accessible through the repository.
12
+ - Add the boolean `Condition#deprecated` field, defaulting to `false` for older dumps. Deprecated conditions remain accessible through the repository.
13
13
 
14
14
  - Add `proxy_addr` and `proxy_port` options to `Database.load`, `Database.fetch_latest_version_hash`, and `Database.watch_latest_version` for CDN requests. Both default to `nil`, so no proxy is used unless explicitly configured.
15
15
 
@@ -4,8 +4,7 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  require_relative 'ConditionType_pb'
7
- require 'google/protobuf/timestamp_pb'
8
- descriptor_data = "\n\x0FCondition.proto\x12\evaccination_characteristics\x1A\x13ConditionType.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\">\n\x04Code\x12\"\n\fnomenclature\x18\x01 \x01(\tR\fnomenclature\x12\x12\n\x04code\x18\x02 \x01(\tR\x04code\"\xA1\x02\n\tCondition\x12\x0E\n\x02id\x18\x01 \x01(\x05R\x02id\x12\x14\n\x05label\x18\x02 \x01(\tR\x05label\x12 \n\vdescription\x18\x03 \x01(\tR\vdescription\x12>\n\x04type\x18\x04 \x01(\x0E2*.vaccination_characteristics.ConditionTypeR\x04type\x12\x12\n\x04tags\x18\x05 \x03(\tR\x04tags\x127\n\x05codes\x18\x06 \x03(\v2!.vaccination_characteristics.CodeR\x05codes\x12?\n\rdeprecated_on\x18\a \x01(\v2\x1A.google.protobuf.TimestampR\fdeprecatedOnB\x13\n\x0Fcom.syadem.sadvP\x01b\x06proto3"
7
+ descriptor_data = "\n\x0FCondition.proto\x12\evaccination_characteristics\x1A\x13ConditionType.proto\">\n\x04Code\x12\"\n\fnomenclature\x18\x01 \x01(\tR\fnomenclature\x12\x12\n\x04code\x18\x02 \x01(\tR\x04code\"\x80\x02\n\tCondition\x12\x0E\n\x02id\x18\x01 \x01(\x05R\x02id\x12\x14\n\x05label\x18\x02 \x01(\tR\x05label\x12 \n\vdescription\x18\x03 \x01(\tR\vdescription\x12>\n\x04type\x18\x04 \x01(\x0E2*.vaccination_characteristics.ConditionTypeR\x04type\x12\x12\n\x04tags\x18\x05 \x03(\tR\x04tags\x127\n\x05codes\x18\x06 \x03(\v2!.vaccination_characteristics.CodeR\x05codes\x12\x1E\n\ndeprecated\x18\a \x01(\bR\ndeprecatedB\x13\n\x0Fcom.syadem.sadvP\x01b\x06proto3"
9
8
 
10
9
  ::Google::Protobuf::DescriptorPool.generated_pool.add_serialized_file(descriptor_data)
11
10
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VaccinationCharacteristics
4
- VERSION = "1.4.0"
4
+ VERSION = "1.4.2"
5
5
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  require_relative "vaccination_characteristics/version"
4
4
  require_relative "vaccination_characteristics/VaccinationCharacteristicsDatabase_pb"
5
- require_relative "vaccination_characteristics/condition"
6
5
  require_relative "vaccination_characteristics/repository"
7
6
  require_relative "vaccination_characteristics/version_watcher"
8
7
  require "net/http"
@@ -48,14 +47,9 @@ module VaccinationCharacteristics
48
47
  end
49
48
 
50
49
  def fetch_latest_version_hash(cdn_uri: DEFAULT_CDN_URI, http: nil, proxy_addr: nil, proxy_port: nil)
51
- passed_http = !http.nil?
52
- http = init_http(cdn_uri, proxy_addr:, proxy_port:) if http.nil?
53
- response = http.get("/versions/latest.json")
54
- hash = JSON.parse(response.body)["hash"]
50
+ return init_http(cdn_uri, proxy_addr:, proxy_port:) { |h| fetch_latest_version_hash(http: h) } if http.nil?
55
51
 
56
- http.finish unless passed_http
57
-
58
- hash
52
+ JSON.parse(http.get("/versions/latest.json").body)["hash"]
59
53
  end
60
54
 
61
55
  def watch_latest_version(cdn_uri: DEFAULT_CDN_URI, polling_interval: 60, on_update:, on_error: nil, proxy_addr: nil, proxy_port: nil)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vaccination-characteristics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Syadem
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-10-05 00:00:00.000000000 Z
11
+ date: 2026-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -57,7 +57,6 @@ files:
57
57
  - lib/vaccination_characteristics/Condition_pb.rb
58
58
  - lib/vaccination_characteristics/VaccinationCharacteristicsDatabase_pb.rb
59
59
  - lib/vaccination_characteristics/Version_pb.rb
60
- - lib/vaccination_characteristics/condition.rb
61
60
  - lib/vaccination_characteristics/repositories/condition_repository.rb
62
61
  - lib/vaccination_characteristics/repository.rb
63
62
  - lib/vaccination_characteristics/version.rb
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "Condition_pb"
4
- require "date"
5
-
6
- module VaccinationCharacteristics
7
- class Condition
8
- def deprecated_on
9
- timestamp = self["deprecated_on"]
10
- Time.at(timestamp.seconds, timestamp.nanos, :nanosecond).utc.to_date if timestamp
11
- end
12
-
13
- def deprecated_on=(value)
14
- if value.nil?
15
- clear_deprecated_on
16
- else
17
- self["deprecated_on"] =
18
- if value.is_a?(Date)
19
- Google::Protobuf::Timestamp.new(seconds: Time.utc(value.year, value.month, value.day).to_i)
20
- else
21
- value
22
- end
23
- end
24
- end
25
- end
26
- end