oddb2xml 3.0.24 → 3.0.25

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: 6c5dd43eea5580b800dcb7c1ede8f2b1b55ded474a7608471185bd0fab81f5c0
4
- data.tar.gz: 0f2b55c4a6706b4e723efbcb77bd3c40b321eb3cf2893b58230572e03b6936a5
3
+ metadata.gz: 1c80413abe4bd24c2c3555aa6eb4407c7464e381275a118c7929c686fe73f494
4
+ data.tar.gz: 7bf43ba8cf901d4d2de42d0e21e95bf2e25e4f1a88360b5cc4451427c52adccb
5
5
  SHA512:
6
- metadata.gz: a55b5366832bd577609b70baa32934119ef953a441296c76848f183565c70709f7a24541f1927c23c78ded28b6b515b802ea287f34f58b5a50228ed6bba071ba
7
- data.tar.gz: d4591b9b3e812a134e0598865d5385f0fcbe3546cc1b799e62c2c4b8d6c22ce8ee8347e32c7c967a3bd6051aa5e1d45ad8a262942a841b67a4ef22afd6a92579
6
+ metadata.gz: b20195b2d9b1d6ddd0e51b7e8062f71e2bc8c2c7b2d74c817b058c1c56f18ef203b119a39cf80e55310bd9c6d06204f15bb3c0e7d2d988837967fa1381a10735
7
+ data.tar.gz: 26b6d78eddd658b8dbed3949b0df277639636a66b8ed86a3a54f9478a19dfbdc81874b88afdafc3221114a41f59f7184c271206f14b6c1f5135f93b895ef3fa3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oddb2xml (3.0.24)
4
+ oddb2xml (3.0.25)
5
5
  csv
6
6
  htmlentities
7
7
  httpi
data/History.txt CHANGED
@@ -1,3 +1,6 @@
1
+ === 3.0.25 / 17.06.2026
2
+ * Bugfix (-b/--firstbase): the GS1 Switzerland firstbase CSV (id.gs1.ch) is served with a UTF-8 BOM. FirstbaseExtractor read it with encoding "UTF-8", so the BOM glued onto the first header ("Gtin") and row["Gtin"] returned nil for every row — every line was skipped as having an empty GTIN. The result: @firstbase came out empty and all NONPHARMA articles from the firstbase feed were silently missing, so oddb_article.xml shipped only the ~17k Refdata/Swissmedic base instead of the ~190k GS1 set. Now read with encoding "bom|utf-8", which strips the BOM (live file: all 192'807 rows parse).
3
+
1
4
  === 3.0.24 / 16.06.2026
2
5
  * Bugfix (--skip-download): cached files fetched with a write mode were silently emptied on every --skip-download run. DownloadMethod#download_as restored the file from the ./downloads cache and then re-opened it with the caller's mode (e.g. "w+"), which truncated it to zero bytes before the read — so the returned data was empty. This blanked epha_interactions.csv (oddb_interaction.xml came out with NBR_RECORD=0) and any other source pulled with a "w+"-style mode (LPPV, Weleda/WALA SL, BAG SL group prices) whenever its file was present in the cache. It surfaced in deploy scripts that download once and rebuild several price increments from the shared cache (e.g. -b -I 45/50/55): the first build was correct, every --skip-download rebuild lost the interactions. The skip branch now opens the restored file read-only, preserving any encoding suffix ("w+:iso-8859-1:utf-8" -> "r:iso-8859-1:utf-8").
3
6
 
@@ -622,7 +622,10 @@ module Oddb2xml
622
622
  def to_hash
623
623
  data = {}
624
624
  return data unless @file && File.exist?(@file)
625
- CSV.foreach(@file, headers: true, encoding: "UTF-8") do |row|
625
+ # The GS1 firstbase CSV is served with a UTF-8 BOM. Without "bom|" the BOM
626
+ # glues onto the first header ("Gtin"), so row["Gtin"] is nil and every
627
+ # row is skipped — dropping all -b/firstbase NONPHARMA articles.
628
+ CSV.foreach(@file, headers: true, encoding: "bom|utf-8") do |row|
626
629
  gtin = row["Gtin"].to_s.gsub(/^0+/, "")
627
630
  next if gtin.empty?
628
631
  data[gtin] = {
@@ -1,3 +1,3 @@
1
1
  module Oddb2xml
2
- VERSION = "3.0.24"
2
+ VERSION = "3.0.25"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oddb2xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.24
4
+ version: 3.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasuhiro Asaka, Zeno R.R. Davatz, Niklaus Giger