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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +18 -0
  3. data/lib/nuva/version.rb +1 -1
  4. data/lib/nuva.rb +11 -11
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a10259a0f94a7d196b5e120a1c6c6abf3706fc19c94d8bd900655615f38d1ee0
4
- data.tar.gz: c1ab5a528fc2a790cea4652df5e60e6f60da1558ce9bf16a8cd0e3550d6d7e3a
3
+ metadata.gz: 82acd70c0a5b198a39012c92d1094224e71dfb637dceaf9fbaaf45cc25e6ef8c
4
+ data.tar.gz: c1e69015254f080bf35e83aa2ec962b1131b47d926d0b846ae598b28a184f384
5
5
  SHA512:
6
- metadata.gz: 6ac19848c06ff44bbf9d8fb81818b81dce4be08f020390e5cfb105ac053cd1e761b072819d7dda35deb5bfb0fc9cc42ae7da0a7efab6f616963852621ab3f44c
7
- data.tar.gz: 3d0656b6a11a389a3d29242ea790d034b24945e3caee911fbf99846141204ed8b490caafdac56d332febc2f26ce730347325e34cfde7356ebc724098b3e593c3
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nuva
4
- VERSION = "0.4.1"
4
+ VERSION = "0.5.2"
5
5
  end
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} diseaseCount=#{repositories.diseases.all.count} vaccineCount=#{repositories.vaccines.all.count} valenceCount=#{repositories.valences.all.count}>"
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
- CDN_URI = URI("https://cdnnuva.mesvaccins.net/")
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}_en.db")
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
- CDN_URI.host,
95
- CDN_URI.port,
96
- use_ssl: CDN_URI.scheme == "https",
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.1
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-01-21 00:00:00.000000000 Z
11
+ date: 2025-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf