nuva 0.4.1 → 0.5.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 +4 -4
- data/Changelog.md +18 -0
- data/lib/nuva/version.rb +1 -1
- data/lib/nuva.rb +11 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82acd70c0a5b198a39012c92d1094224e71dfb637dceaf9fbaaf45cc25e6ef8c
|
4
|
+
data.tar.gz: c1e69015254f080bf35e83aa2ec962b1131b47d926d0b846ae598b28a184f384
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2591d93c4dec3b775eb61c5f19197520cda3a503d894c56adfc2dcffb8135c92b0cbd5e5c3b057cbabb83a984d3ae455000fe6c71398afab6269262fad105cc6
|
7
|
+
data.tar.gz: ecce6537ef36080c174e31983c8bee7f56157beaf3366ceb5ab629a345cdabd0bb93c41dbd4b88f750a706db715efa3317816c2226631cae339d7b2540f6a1fc
|
data/Changelog.md
CHANGED
@@ -5,6 +5,24 @@ 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
|
+
## [0.5.2] - 2025-03-12
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
|
12
|
+
- Actually use lang kwarg in `Nuva.load` method
|
13
|
+
|
14
|
+
## [0.5.1] - 2025-01-21
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
|
18
|
+
- Change default URL (use Scaleway CDN instead of KeyCDN)
|
19
|
+
|
20
|
+
## [0.5.0] - 2025-01-21
|
21
|
+
|
22
|
+
### Added
|
23
|
+
|
24
|
+
- New kwarg `cdn_uri` enables fetching nuva data from a custom cdn
|
25
|
+
|
8
26
|
## [0.4.1] - 2025-01-21
|
9
27
|
|
10
28
|
### Changed
|
data/lib/nuva/version.rb
CHANGED
data/lib/nuva.rb
CHANGED
@@ -56,25 +56,25 @@ module Nuva
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def inspect
|
59
|
-
"#<Nuva::Nuva version=#{version.major}.#{version.minor}.#{version.patch}
|
59
|
+
"#<Nuva::Nuva version=#{version.major}.#{version.minor}.#{version.patch} disease_count=#{repositories.diseases.all.count} vaccine_count=#{repositories.vaccines.all.count} valence_count=#{repositories.valences.all.count}>"
|
60
60
|
end
|
61
61
|
|
62
62
|
class << self
|
63
|
-
|
63
|
+
DEFAULT_CDN_URI = URI("https://nuva.svc.edge.scw.cloud")
|
64
64
|
|
65
|
-
def load(lang: "en", hash: nil)
|
66
|
-
init_http do |http|
|
65
|
+
def load(cdn_uri: DEFAULT_CDN_URI, lang: "en", hash: nil)
|
66
|
+
init_http(cdn_uri) do |http|
|
67
67
|
# Fetch version manifest if necessary
|
68
68
|
hash ||= fetch_latest_version_hash(http:)
|
69
69
|
|
70
|
-
response = http.get("/proto/#{hash}
|
70
|
+
response = http.get("/proto/#{hash}_#{lang}.db")
|
71
71
|
::Nuva::Nuva.new(::Nuva::NuvaDatabase.decode(response.body))
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
def fetch_latest_version_hash(http: nil)
|
75
|
+
def fetch_latest_version_hash(cdn_uri: DEFAULT_CDN_URI, http: nil)
|
76
76
|
if http.nil?
|
77
|
-
http = init_http
|
77
|
+
http = init_http(cdn_uri)
|
78
78
|
passed_http = false
|
79
79
|
end
|
80
80
|
response = http.get("/versions/last.json")
|
@@ -89,11 +89,11 @@ module Nuva
|
|
89
89
|
|
90
90
|
private
|
91
91
|
|
92
|
-
def init_http(&block)
|
92
|
+
def init_http(cdn_uri, &block)
|
93
93
|
Net::HTTP.start(
|
94
|
-
|
95
|
-
|
96
|
-
use_ssl:
|
94
|
+
cdn_uri.host,
|
95
|
+
cdn_uri.port,
|
96
|
+
use_ssl: cdn_uri.scheme == "https",
|
97
97
|
&block
|
98
98
|
)
|
99
99
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nuva
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Syadem
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|