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 +4 -4
- data/Gemfile.lock +1 -1
- data/History.txt +3 -0
- data/lib/oddb2xml/extractor.rb +4 -1
- data/lib/oddb2xml/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1c80413abe4bd24c2c3555aa6eb4407c7464e381275a118c7929c686fe73f494
|
|
4
|
+
data.tar.gz: 7bf43ba8cf901d4d2de42d0e21e95bf2e25e4f1a88360b5cc4451427c52adccb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b20195b2d9b1d6ddd0e51b7e8062f71e2bc8c2c7b2d74c817b058c1c56f18ef203b119a39cf80e55310bd9c6d06204f15bb3c0e7d2d988837967fa1381a10735
|
|
7
|
+
data.tar.gz: 26b6d78eddd658b8dbed3949b0df277639636a66b8ed86a3a54f9478a19dfbdc81874b88afdafc3221114a41f59f7184c271206f14b6c1f5135f93b895ef3fa3
|
data/Gemfile.lock
CHANGED
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
|
|
data/lib/oddb2xml/extractor.rb
CHANGED
|
@@ -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
|
|
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] = {
|
data/lib/oddb2xml/version.rb
CHANGED