nuva 0.4.1 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a10259a0f94a7d196b5e120a1c6c6abf3706fc19c94d8bd900655615f38d1ee0
4
- data.tar.gz: c1ab5a528fc2a790cea4652df5e60e6f60da1558ce9bf16a8cd0e3550d6d7e3a
3
+ metadata.gz: a5d1d66d1f5d5b9b5e770c71d441e14663dd379dcd6cf976fff239db9df601e0
4
+ data.tar.gz: 5908983a10c103910cf0505b3a60df9f918d87d60cd4bd5f1578a07da18f5ce1
5
5
  SHA512:
6
- metadata.gz: 6ac19848c06ff44bbf9d8fb81818b81dce4be08f020390e5cfb105ac053cd1e761b072819d7dda35deb5bfb0fc9cc42ae7da0a7efab6f616963852621ab3f44c
7
- data.tar.gz: 3d0656b6a11a389a3d29242ea790d034b24945e3caee911fbf99846141204ed8b490caafdac56d332febc2f26ce730347325e34cfde7356ebc724098b3e593c3
6
+ metadata.gz: 91c1bbfaef7424ad18043c051f8176eb492b56c848d6a36ca9c1701d3bd1351b798aede58c1dad50cbd36cbbe254be3dc8380e76cbe660270466e007794b4e8e
7
+ data.tar.gz: c967dfb3a4e30a95cfabe02d6a43d64d853a7b096045e17d00a657cacd2990f9641c23a4046851826066160e33e456c0df38587fd3c40666c5dc6318fbe1d892
data/Changelog.md CHANGED
@@ -5,6 +5,18 @@ 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.1] - 2025-01-21
9
+
10
+ ### Changed
11
+
12
+ - Change default URL (use Scaleway CDN instead of KeyCDN)
13
+
14
+ ## [0.5.0] - 2025-01-21
15
+
16
+ ### Added
17
+
18
+ - New kwarg `cdn_uri` enables fetching nuva data from a custom cdn
19
+
8
20
  ## [0.4.1] - 2025-01-21
9
21
 
10
22
  ### 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.1"
5
5
  end
data/lib/nuva.rb CHANGED
@@ -60,10 +60,10 @@ module Nuva
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
 
@@ -72,9 +72,9 @@ module Nuva
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,7 +1,7 @@
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Syadem