oddb2xml 3.0.1 → 3.0.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: c0521593bc12b423a74628f04973dcaf43241ce674c415c4e3a82da3ad34a134
4
- data.tar.gz: a7b8fe9076dd737105696b525e3c4c0e17e3174ea4d86d0bab9f948324229c05
3
+ metadata.gz: 55725f8e11fa91216b5f7189f9339a6bacf6fd69af78c633421abc8c573a2326
4
+ data.tar.gz: acd34c442ef756f43aeac9e2551df614fff4bad81894a87add521e4c7efab8cd
5
5
  SHA512:
6
- metadata.gz: 1f0c6275adc2b60930eb961b1745013f81c167a49c035347c49b40af8f59ead028f884981aeb9aa0ce809b7007a1b4c78993d2adfa5c3e31e3ed56e8866ac035
7
- data.tar.gz: c02f68d34884adbabe1465cf7180e6ef51cbb84049a71a931880bcb383abb4c3dc8196f92e21932b3529a68e5211f546fb053112f27037434313517de4d22961
6
+ metadata.gz: 273f80bb691ae1d0e86db41d9215456c48822f4a764163c3675d87ca6f975f11cd8d2dce89f4bf71abd9b8e320b61babd45c73d0683faafbeb25adf56f2d12b6
7
+ data.tar.gz: c0014b66c15ebddcff17cf1435d24faab68ab856faa5d198208f94d9d6925540d4939ce4ff82f4f4d38c1fc319156dbaecf49415f56e8fce1d676d3e06b179fc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oddb2xml (3.0.0)
4
+ oddb2xml (3.0.2)
5
5
  htmlentities
6
6
  httpi
7
7
  mechanize (>= 2.8.5)
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 3.0.2 / 09.03.2026
2
+ * Use raw.githubusercontent.com URL for ATC CSV to avoid 429 Too Many Requests errors
3
+ * Add retry logic with exponential backoff for HTTP 429 errors in uri_open
4
+ * Remove obsolete Ruby version check in uri_open (Ruby >= 2.5 already required)
5
+
1
6
  === 2.7.9 / 19.09.22
2
7
  * Remove newly generated DSCRI when not running --artikelstamm and
3
8
  generate always (as before 2.7.8) a DSCRF fiele
data/README.md CHANGED
@@ -284,6 +284,7 @@ We use the following files:
284
284
  * http://download.swissmedicinfo.ch/ (AipsDownload)
285
285
  * https://raw.githubusercontent.com/zdavatz/oddb2xml_files/master/LPPV.txt
286
286
  * https://raw.githubusercontent.com/epha/robot/master/data/manual/swissmedic/atc.csv
287
+ * https://raw.githubusercontent.com/zdavatz/cpp2sqlite/master/input/atc_codes_multi_lingual.txt
287
288
 
288
289
  ## Rules for matching GTIN (aka EAN13), product number and IKSNR
289
290
 
data/lib/oddb2xml/util.rb CHANGED
@@ -7,12 +7,20 @@ module Oddb2xml
7
7
  sprintf("%05d", iksnr) + sprintf("%02d", seqnr)
8
8
  end
9
9
 
10
- def self.uri_open(url)
11
- version = RUBY_VERSION.split(".").map { |x| x.to_i }
12
- if (version <=> [2, 5, 0]) >= 0
10
+ def self.uri_open(url, max_retries: 3)
11
+ retries = 0
12
+ begin
13
13
  URI.parse(url).open
14
- else
15
- IO.popen(url)
14
+ rescue OpenURI::HTTPError => e
15
+ if e.message.start_with?("429") && retries < max_retries
16
+ retries += 1
17
+ delay = 2**retries
18
+ $stderr.puts "429 Too Many Requests for #{url}, retrying in #{delay}s (attempt #{retries}/#{max_retries})"
19
+ sleep delay
20
+ retry
21
+ else
22
+ raise
23
+ end
16
24
  end
17
25
  end
18
26
 
@@ -32,7 +40,7 @@ module Oddb2xml
32
40
  DOWNLOADS = "#{Dir.pwd}/downloads"
33
41
  end
34
42
  @options = {}
35
- @atc_csv_origin = "https://github.com/zdavatz/cpp2sqlite/blob/master/input/atc_codes_multi_lingual.txt"
43
+ @atc_csv_origin = "https://raw.githubusercontent.com/zdavatz/cpp2sqlite/master/input/atc_codes_multi_lingual.txt"
36
44
  @atc_csv_content = {}
37
45
 
38
46
  def self.html_decode(string)
@@ -1,3 +1,3 @@
1
1
  module Oddb2xml
2
- VERSION = "3.0.1"
2
+ VERSION = "3.0.2"
3
3
  end
data/oddb2xml.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.description = "oddb2xml creates xml files using swissINDEX, BAG-XML and Swissmedic."
11
11
  spec.summary = "oddb2xml creates xml files."
12
12
  spec.homepage = "https://github.com/zdavatz/oddb2xml"
13
- spec.license = "GPL-3.0"
13
+ spec.license = "GPL-3.0-only"
14
14
  spec.files = `git ls-files -z`.split("\x0")
15
15
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
16
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oddb2xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasuhiro Asaka, Zeno R.R. Davatz, Niklaus Giger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-27 00:00:00.000000000 Z
11
+ date: 2026-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -550,7 +550,7 @@ files:
550
550
  - tools/win_fetch_cacerts.rb
551
551
  homepage: https://github.com/zdavatz/oddb2xml
552
552
  licenses:
553
- - GPL-3.0
553
+ - GPL-3.0-only
554
554
  metadata: {}
555
555
  post_install_message:
556
556
  rdoc_options: []