nuva 0.3.1 → 0.4.1
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/.devcontainer/devcontainer.json +20 -16
- data/.rubocop.yml +1 -1
- data/Changelog.md +13 -0
- data/lib/nuva/version.rb +1 -1
- data/lib/nuva.rb +34 -27
- 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: a10259a0f94a7d196b5e120a1c6c6abf3706fc19c94d8bd900655615f38d1ee0
|
4
|
+
data.tar.gz: c1ab5a528fc2a790cea4652df5e60e6f60da1558ce9bf16a8cd0e3550d6d7e3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ac19848c06ff44bbf9d8fb81818b81dce4be08f020390e5cfb105ac053cd1e761b072819d7dda35deb5bfb0fc9cc42ae7da0a7efab6f616963852621ab3f44c
|
7
|
+
data.tar.gz: 3d0656b6a11a389a3d29242ea790d034b24945e3caee911fbf99846141204ed8b490caafdac56d332febc2f26ce730347325e34cfde7356ebc724098b3e593c3
|
@@ -1,25 +1,29 @@
|
|
1
1
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
2
2
|
// README at: https://github.com/devcontainers/templates/tree/main/src/ruby
|
3
3
|
{
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
"name": "nuva-ruby",
|
5
|
+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
6
|
+
"image": "mcr.microsoft.com/devcontainers/ruby:1-3.3-bullseye",
|
7
|
+
"features": {
|
8
|
+
"ghcr.io/devcontainers/features/common-utils:2": {}
|
9
|
+
},
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
"containerEnv": {
|
12
|
+
"APP_ENV": "development"
|
13
|
+
}
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
// Features to add to the dev container. More info: https://containers.dev/features.
|
16
|
+
// "features": {},
|
16
17
|
|
17
|
-
|
18
|
-
|
18
|
+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
19
|
+
// "forwardPorts": [],
|
19
20
|
|
20
|
-
|
21
|
-
|
21
|
+
// Use 'postCreateCommand' to run commands after the container is created.
|
22
|
+
// "postCreateCommand": "ruby --version",
|
22
23
|
|
23
|
-
|
24
|
-
|
24
|
+
// Configure tool-specific properties.
|
25
|
+
// "customizations": {},
|
26
|
+
|
27
|
+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
28
|
+
// "remoteUser": "root"
|
25
29
|
}
|
data/.rubocop.yml
CHANGED
data/Changelog.md
CHANGED
@@ -5,6 +5,19 @@ 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.4.1] - 2025-01-21
|
9
|
+
|
10
|
+
### Changed
|
11
|
+
|
12
|
+
- Fix `Nuva.fetch_latest_version_hash` (http error)
|
13
|
+
|
14
|
+
## [0.4.0] - 2025-01-21
|
15
|
+
|
16
|
+
### Added
|
17
|
+
|
18
|
+
- Add method `Nuva.fetch_latest_version_hash`
|
19
|
+
- Support fetching specific nuva version with `Nuva.load`
|
20
|
+
|
8
21
|
## [0.3.1] - 2025-01-17
|
9
22
|
|
10
23
|
### Changed
|
data/lib/nuva/version.rb
CHANGED
data/lib/nuva.rb
CHANGED
@@ -55,41 +55,48 @@ module Nuva
|
|
55
55
|
@db.version
|
56
56
|
end
|
57
57
|
|
58
|
-
def
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
::Net::HTTP.start(
|
63
|
-
latest_version_uri.host,
|
64
|
-
latest_version_uri.port,
|
65
|
-
use_ssl: latest_version_uri.scheme == "https"
|
66
|
-
) do |http|
|
67
|
-
# Fetch version manifest
|
68
|
-
req = ::Net::HTTP::Get.new latest_version_uri
|
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}>"
|
60
|
+
end
|
69
61
|
|
70
|
-
|
71
|
-
|
62
|
+
class << self
|
63
|
+
CDN_URI = URI("https://cdnnuva.mesvaccins.net/")
|
72
64
|
|
73
|
-
|
65
|
+
def load(lang: "en", hash: nil)
|
66
|
+
init_http do |http|
|
67
|
+
# Fetch version manifest if necessary
|
68
|
+
hash ||= fetch_latest_version_hash(http:)
|
74
69
|
|
75
|
-
|
70
|
+
response = http.get("/proto/#{hash}_en.db")
|
71
|
+
::Nuva::Nuva.new(::Nuva::NuvaDatabase.decode(response.body))
|
72
|
+
end
|
73
|
+
end
|
76
74
|
|
77
|
-
|
78
|
-
|
79
|
-
|
75
|
+
def fetch_latest_version_hash(http: nil)
|
76
|
+
if http.nil?
|
77
|
+
http = init_http
|
78
|
+
passed_http = false
|
79
|
+
end
|
80
|
+
response = http.get("/versions/last.json")
|
81
|
+
hash = JSON.parse(response.body)["dump_hash"]
|
82
|
+
http.finish unless passed_http
|
83
|
+
hash
|
84
|
+
end
|
80
85
|
|
81
|
-
|
86
|
+
def load_from_file(path)
|
87
|
+
Nuva.new(NuvaDatabase.decode(File.read(path)))
|
88
|
+
end
|
82
89
|
|
83
|
-
|
84
|
-
res.value
|
90
|
+
private
|
85
91
|
|
86
|
-
|
87
|
-
::
|
92
|
+
def init_http(&block)
|
93
|
+
Net::HTTP.start(
|
94
|
+
CDN_URI.host,
|
95
|
+
CDN_URI.port,
|
96
|
+
use_ssl: CDN_URI.scheme == "https",
|
97
|
+
&block
|
98
|
+
)
|
88
99
|
end
|
89
100
|
end
|
90
|
-
|
91
|
-
def self.load_from_file(path)
|
92
|
-
Nuva.new(NuvaDatabase.decode(File.read(path)))
|
93
|
-
end
|
94
101
|
end
|
95
102
|
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.4.1
|
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-
|
11
|
+
date: 2025-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|