oddb2xml 2.8.0 → 2.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69751ba3c076df58a220d7228e9cb095be71469d3bbd3b724dc3caa794b08a47
4
- data.tar.gz: d365c3755b21c38ebfb42d35b6c8104085d73020e3337a759af1406e1fe468de
3
+ metadata.gz: 7cc43d372c64564821c3594e837a93058f4b9aeb51bef7dd76036e694fed737a
4
+ data.tar.gz: 44e66c7136db33e6cbb656f070522cffe920f736a1a15ddfa2fa8363a79b3ca4
5
5
  SHA512:
6
- metadata.gz: d3cca5c33e5693ce85f6caec848e8513feead69d095834de0801dbffd55bcc25b5fbd29873acc8c1501f1d209e6c614167bf2c01f241143a25c1d885b9ae4c13
7
- data.tar.gz: f75d3211d0405487509db615fc97092017db6d24bb1cf6dc95efd2a2170b97bce6adff9958d4bbdd4e1ef4002ef7a50c8ee3995a67d2b734d879389186d0ca9b
6
+ metadata.gz: 94d01ca34a3d6d535f14f873d377c5a46ae99a28c63330fe5fe14f886f416218d75df5ab3201fd05da9c607110de05666d6297fdfb9941a3b2f61a1a87517560
7
+ data.tar.gz: 6313c7015702732aa1be35b404b2b87a4230adc0b20bc8600bfa55d4c7e93ce8f16bab9cc13b6748927ce4ba13d0d97862ceabed64d81ae9baed397c436fd0ac
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oddb2xml (2.8.0)
4
+ oddb2xml (2.8.1)
5
5
  htmlentities
6
6
  httpi
7
7
  mechanize
@@ -177,7 +177,7 @@ GEM
177
177
  webrick (~> 1.7.0)
178
178
 
179
179
  PLATFORMS
180
- x86_64-linux
180
+ ruby
181
181
 
182
182
  DEPENDENCIES
183
183
  bundler
@@ -172,15 +172,19 @@ module Oddb2xml
172
172
  end
173
173
  end
174
174
  @firstbase.each do |ean13, obj|
175
- entry = {
176
- ean13: obj[:gtin],
177
- desc_de: obj[:trade_item_description_de],
178
- desc_fr: obj[:trade_item_description_fr],
179
- atc_code: "",
180
- company_ean: obj[:gln],
181
- firstbase: true
182
- }
183
- if @refdata[obj[:gtin]].nil?
175
+ description = obj[:trade_item_description_de]
176
+ if description.empty?
177
+ description = obj[:trade_item_description_en]
178
+ end
179
+ if (!description.empty? || !obj[:trade_item_description_fr].empty?) && @refdata[obj[:gtin]].nil?
180
+ entry = {
181
+ ean13: obj[:gtin],
182
+ desc_de: description,
183
+ desc_fr: obj[:trade_item_description_fr],
184
+ atc_code: "",
185
+ company_ean: obj[:gln],
186
+ firstbase: true
187
+ }
184
188
  @articles << entry
185
189
  end
186
190
  end
@@ -595,12 +599,18 @@ module Oddb2xml
595
599
  }
596
600
  end
597
601
  @firstbase.each do |ean13, obj|
598
- xml.PRD("DT" => "") {
599
- xml.GTIN obj[:gtin]
600
- xml.CPT
601
- xml.DSCRD obj[:trade_item_description_de]
602
- xml.DSCRF obj[:trade_item_description_fr]
603
- }
602
+ description = obj[:trade_item_description_de]
603
+ if description.empty?
604
+ description = obj[:trade_item_description_en]
605
+ end
606
+ if !description.empty? || !obj[:trade_item_description_fr].empty?
607
+ xml.PRD("DT" => "") {
608
+ xml.GTIN obj[:gtin]
609
+ xml.CPT
610
+ xml.DSCRD description
611
+ xml.DSCRF obj[:trade_item_description_fr]
612
+ }
613
+ end
604
614
  end
605
615
  @products.sort.to_h.each do |ean13, obj|
606
616
  next if /^Q/i.match?(obj[:atc])
@@ -1,3 +1,3 @@
1
1
  module Oddb2xml
2
- VERSION = "2.8.0"
2
+ VERSION = "2.8.1"
3
3
  end
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: 2.8.0
4
+ version: 2.8.1
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: 2023-10-24 00:00:00.000000000 Z
11
+ date: 2023-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip