vaccination-characteristics 1.2.1 → 1.3.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: 77219c35be2f1451bd17ca3364270343bf888067de19a5d2293f82e9ae1721b4
4
- data.tar.gz: 58b72e60aba221f8f17e91d37386036374a436ae52c2e94841c0456bf450c154
3
+ metadata.gz: 32b80395e901ca6b565df1c7210a3f0c2b6be079b7ee455bf2b815aecfe4cc07
4
+ data.tar.gz: c991b91ddfd57d9d2a5d3c93714b11c566d845f912f6b91d56b1bf26a5c805ff
5
5
  SHA512:
6
- metadata.gz: a797ec42d1d50ad751774187a8018cd5e900669e91811485aa0a954aa913cc450535420216b3c41123922c36cd6fdad3928b9efd641625ef431e50ee24b9a463
7
- data.tar.gz: 2fb66baacfb77d4d67920c3b0ec83e5d81d05ca1642b00d37918fc0738ef812f3299196bbda72fa49405b3ccaa4046df5fcb2ad5a366c3cd14e198155d9b4822
6
+ metadata.gz: 3b8f702fc38bc6128a8e21abf8e9d8020dbbd4567ff29c20d8e1102bf4bc148214c3a2d444897b5dbeae59daa717035ca13bbc359daa12ce1a3192da0af76bcb
7
+ data.tar.gz: 2dca68c7f7ff186d854acafe3e78d20eab93ec78f890efdacae7f5b7ce2f3412d1f797895de6810080c1668b22043c959e9d73d829611e7b53006540e1f0a927
data/Changelog.md CHANGED
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+
12
+ - Add the boolean `Condition#deprecated` field, defaulting to `false` for older dumps. Deprecated conditions remain accessible through the repository.
13
+
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
+
8
16
  ## [1.0.0] - 2026-09-18
9
17
 
10
18
  ### Changed
@@ -4,7 +4,7 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  require_relative 'ConditionType_pb'
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\"\xE0\x01\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\x05codesB\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"
8
8
 
9
9
  ::Google::Protobuf::DescriptorPool.generated_pool.add_serialized_file(descriptor_data)
10
10
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VaccinationCharacteristics
4
- VERSION = "1.2.1"
4
+ VERSION = "1.3.0"
5
5
  end
@@ -35,8 +35,8 @@ module VaccinationCharacteristics
35
35
  class << self
36
36
  DEFAULT_CDN_URI = URI("https://vrc.cdn.mesvaccins.net")
37
37
 
38
- def load(cdn_uri: DEFAULT_CDN_URI, langs:, hash: nil)
39
- init_http(cdn_uri) do |http|
38
+ def load(cdn_uri: DEFAULT_CDN_URI, langs:, hash: nil, proxy_addr: nil, proxy_port: nil)
39
+ init_http(cdn_uri, proxy_addr:, proxy_port:) do |http|
40
40
  hash ||= fetch_latest_version_hash(http:)
41
41
 
42
42
  langs.each_with_object({}) do |lang, obj|
@@ -46,9 +46,9 @@ module VaccinationCharacteristics
46
46
  end
47
47
  end
48
48
 
49
- def fetch_latest_version_hash(cdn_uri: DEFAULT_CDN_URI, http: nil)
49
+ def fetch_latest_version_hash(cdn_uri: DEFAULT_CDN_URI, http: nil, proxy_addr: nil, proxy_port: nil)
50
50
  passed_http = !http.nil?
51
- http = init_http(cdn_uri) if http.nil?
51
+ http = init_http(cdn_uri, proxy_addr:, proxy_port:) if http.nil?
52
52
  response = http.get("/versions/latest.json")
53
53
  hash = JSON.parse(response.body)["hash"]
54
54
 
@@ -57,9 +57,9 @@ module VaccinationCharacteristics
57
57
  hash
58
58
  end
59
59
 
60
- def watch_latest_version(cdn_uri: DEFAULT_CDN_URI, polling_interval: 60, on_update:, on_error: nil)
60
+ def watch_latest_version(cdn_uri: DEFAULT_CDN_URI, polling_interval: 60, on_update:, on_error: nil, proxy_addr: nil, proxy_port: nil)
61
61
  VersionWatcher.new(
62
- fetch_latest_version_hash: -> { fetch_latest_version_hash(cdn_uri:) },
62
+ fetch_latest_version_hash: -> { fetch_latest_version_hash(cdn_uri:, proxy_addr:, proxy_port:) },
63
63
  polling_interval:,
64
64
  on_update:,
65
65
  on_error:
@@ -72,10 +72,12 @@ module VaccinationCharacteristics
72
72
 
73
73
  private
74
74
 
75
- def init_http(cdn_uri, &block)
75
+ def init_http(cdn_uri, proxy_addr: nil, proxy_port: nil, &block)
76
76
  Net::HTTP.start(
77
77
  cdn_uri.host,
78
78
  cdn_uri.port,
79
+ proxy_addr,
80
+ proxy_port,
79
81
  use_ssl: cdn_uri.scheme == "https",
80
82
  &block
81
83
  )
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.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Syadem
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-09-21 00:00:00.000000000 Z
11
+ date: 2026-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf