vaccination-characteristics 1.2.0 → 1.2.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 13ced99b2de898fd8d3060d38559fe7af272a68b82d963c381ca28c4e6f28b89
|
|
4
|
+
data.tar.gz: b56083029c1da6d27f7e29b3ec0dc879ccce6bf2a2b5fc2a6dbeedf87bb586a1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 23e5dd227357085a6d1be4255051d2c5a775e9c3ecc0609cec5966177caed13297328c7a1ed3849a57400d074dd6ecc54bbc8fec4ef04b68779f001a3e1d62f3
|
|
7
|
+
data.tar.gz: c5583b03ab5584ffbaace73821ea12fcdd782ae3d20a120258489712f9252cd59879b928fb261e553aa79bfe52c906d20989d49ec26938876d14805dbd252af9
|
data/Changelog.md
CHANGED
|
@@ -5,6 +5,12 @@ 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 `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.
|
|
13
|
+
|
|
8
14
|
## [1.0.0] - 2026-09-18
|
|
9
15
|
|
|
10
16
|
### Changed
|
|
@@ -7,6 +7,7 @@ module VaccinationCharacteristics
|
|
|
7
7
|
def initialize(fetch_latest_version_hash:, polling_interval:, on_update:, on_error: nil)
|
|
8
8
|
raise ArgumentError, "polling_interval must be positive" unless polling_interval.positive?
|
|
9
9
|
raise ArgumentError, "on_update must respond to #call" unless on_update.respond_to?(:call)
|
|
10
|
+
raise ArgumentError, "on_error must respond to #call" unless on_error.nil? || on_error.respond_to?(:call)
|
|
10
11
|
|
|
11
12
|
@fetch_latest_version_hash = fetch_latest_version_hash
|
|
12
13
|
@polling_interval = polling_interval
|
|
@@ -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.
|
|
4
|
+
version: 1.2.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-
|
|
11
|
+
date: 2026-10-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: google-protobuf
|