oddb2xml 2.1.9 → 2.2.0

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,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ce0958ffca26d93466fd9c05bb524d5e305f6de5
4
- data.tar.gz: 5cd6b35fbeb42f721eeb47c6b391756b54a8bc53
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YjkyNzQ2MmMwZWY1NmM3MTIzNDBjZDA4MDUzMWU2YjllYTk4ZWYwNA==
5
+ data.tar.gz: !binary |-
6
+ N2NhOTk0MWY5OTJjMGIwYjExYTUyNjQ4NzBmZTdmYmRmMDE4NGNkNw==
5
7
  SHA512:
6
- metadata.gz: 0761c887bea19b8bb187327320d18f7386cdf06234a55b4237c21117b3745747c469636694c0fe1ddc0fc29d26f5b8333e5b715881c5544a1d079dc9488e49b0
7
- data.tar.gz: 792e6333590c5ba828e1bba3a1506a0ca56304a88fecd4f7474ff3649ff4e7b8f042b296bdf06b24ab186b4bcf8828710f83e5ce53405dad583e20bfa00f0a42
8
+ metadata.gz: !binary |-
9
+ YjE0ZGU0MTlhNDhlODQ3MzU2ZGFkNDZmMTc5OTgwNzI3MTY4MDdmMjU1ZTZh
10
+ NjMyYmU3NmI2ZjQyMThkYjE3YjRkNzZkNWVmZGQ2ZTVlYjljNjY0YzM3NzNh
11
+ YTdiNmIwMmQzNjE3OWNjMjA1OTY0ZTUyODUxOTlkNzkxYmMzM2Y=
12
+ data.tar.gz: !binary |-
13
+ YWQyZTY3ZDU2ZWNhZWZkZjBkNjcyZWM2Yzg0MDViMzFhZTY0OTMyYjQ5MGNk
14
+ MzVhNTUxMzc0YzZiZjc3MDVmYTIwMWM0ZWY3MTEyNmE1MzhmNDhkOWNlODAx
15
+ MGY2ZWRkMmQ5M2ZhZjM0NTkwOWVmYTY5M2ZmOTkyNDEyMWVkOTY=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oddb2xml (2.1.9)
4
+ oddb2xml (2.2.0)
5
5
  archive-tar-minitar
6
6
  httpi (>= 2.4.1)
7
7
  mechanize
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 2.2.0 / 24.06.2015
2
+
3
+ * Use FixNum instead of String for EAN-keys into hashes
4
+ * Improved speed (oddb2xml -e takes now less than 1 hour here)
5
+
1
6
  === 2.1.9 / 24.06.2015
2
7
 
3
8
  * Force version of rubyntlm to 0.5.0. Still warning: already initialized constant Net::NTLM::VERSION::MAJOR, but no error
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # encoding: utf-8
2
2
 
3
3
  require 'nokogiri'
4
4
  require 'oddb2xml/util'
@@ -98,9 +98,9 @@ module Oddb2xml
98
98
  end
99
99
  # add
100
100
  @migel.values.compact.each do |migel|
101
- next if migel[:pharmacode].empty?
101
+ next unless migel[:pharmacode]
102
102
  entry = {
103
- :ean => migel[:ean],
103
+ :ean => migel[:ean].to_i,
104
104
  :pharmacode => migel[:pharmacode],
105
105
  :stat_date => '',
106
106
  :desc_de => migel[:desc_de],
@@ -120,7 +120,6 @@ module Oddb2xml
120
120
  @infos_zur_rose.each{
121
121
  |ean13, info|
122
122
  nrItems += 1
123
- Oddb2xml.log("prepare_articles: nrItems #{nrItems} nrAdded #{nrAdded} prices. Total #{@articles.size}") if nrItems % 100 == 0
124
123
  pharmacode = info[:pharmacode]
125
124
  if @pharmacode[pharmacode]
126
125
  @pharmacode[pharmacode][:price] = info[:price]
@@ -129,7 +128,8 @@ module Oddb2xml
129
128
  end
130
129
  obj = {}
131
130
  found = false
132
- existing = @refdata.values.find{ |x| x[:ean].eql? ean13 }
131
+ # existing = @refdata.values.find{ |x| x[:ean].eql? ean13 }
132
+ existing = @refdata[ean13]
133
133
  if existing
134
134
  found = true
135
135
  existing[:price] = info[:price]
@@ -190,7 +190,7 @@ module Oddb2xml
190
190
  end
191
191
  # ID is no longer fixed TAG (swissmedicNo8, swissmedicNo5, pharmacode)
192
192
  # limitation.xml needs all duplicate entries by this keys.
193
- limitations.uniq! {|lim| lim[:id] + lim[:code] + lim[:type] }
193
+ limitations.uniq! { |lim| lim[:id].to_s + lim[:code] + lim[:type] }
194
194
  @limitations = limitations.sort_by {|lim| lim[:code] }
195
195
  Oddb2xml.log("prepare_limitations done. Total #{@limitations.size} from #{@items.size} items")
196
196
  end
@@ -217,9 +217,10 @@ module Oddb2xml
217
217
  end
218
218
  def prepare_products
219
219
  unless @products
220
- @products = []
220
+ @products = {}
221
221
  @refdata.each_pair do |ean13, item|
222
222
  next if item and item.is_a?(Hash) and item[:atc_code] and /^Q/i.match(item[:atc_code])
223
+ next if item[:prodno] and @products[item[:prodno]]
223
224
  obj = {
224
225
  :seq => @items[ean13] ? @items[ean13] : @items[item[:ean]],
225
226
  :pac => nil,
@@ -233,13 +234,13 @@ module Oddb2xml
233
234
  :comp => '',
234
235
  }
235
236
  if obj[:ean] # via EAN-Code
236
- obj[:no8] = obj[:ean][4..11]
237
+ obj[:no8] = obj[:ean].to_s[4..11]
237
238
  end
238
239
  if obj[:no8] and ppac = @packs[obj[:no8].intern] and # Packungen.xls
239
240
  !ppac[:is_tier]
240
241
  # If RefData does not have EAN
241
- if obj[:ean].nil? or obj[:ean].empty?
242
- obj[:ean] = ppac[:ean].to_s
242
+ if obj[:ean].nil?
243
+ obj[:ean] = ppac[:ean].to_i
243
244
  end
244
245
  # If RefData dose not have ATC-Code
245
246
  if obj[:atc].nil? or obj[:atc].empty?
@@ -251,8 +252,12 @@ module Oddb2xml
251
252
  obj[:sub] = ppac[:substance_swissmedic]
252
253
  obj[:comp] = ppac[:composition_swissmedic]
253
254
  end
254
- if obj[:ean][0..3] == '7680'
255
- @products << obj
255
+ if obj[:ean].to_s[0..3] == '7680'
256
+ if item[:prodno]
257
+ @products[item[:prodno]] = obj
258
+ else
259
+ @products[ean13] = obj
260
+ end
256
261
  end
257
262
  end
258
263
  end
@@ -416,11 +421,11 @@ module Oddb2xml
416
421
  _builder.to_xml
417
422
  end
418
423
  def add_missing_products_from_swissmedic
419
- Oddb2xml.log "build_product add_missing_products_from_swissmedic. Starting"
424
+ Oddb2xml.log "build_product add_missing_products_from_swissmedic. Starting with #{@products.size} products and #{@packs.size} @packs"
420
425
  ean13_to_product = {}
421
426
  @products.each{
422
- |obj|
423
- ean13_to_product[obj[:ean].to_s] = obj
427
+ |ean13, obj|
428
+ ean13_to_product[ean13] = obj
424
429
  }
425
430
  ausgabe = File.open(File.join(WorkDir, 'missing_in_refdata.txt'), 'w+')
426
431
  size_old = ean13_to_product.size
@@ -428,12 +433,13 @@ module Oddb2xml
428
433
  Oddb2xml.log "build_product add_missing_products_from_swissmedic. Imported #{size_old} ean13_to_product from @products. Checking #{@packs.size} @packs"
429
434
  @packs.each_with_index {
430
435
  |de_idx, i|
431
- next if ean13_to_product[de_idx[1][:ean]]
436
+ ean = de_idx[1][:ean].to_i
437
+ next if @refdata[ean]
432
438
  list_code = de_idx[1][:list_code]
433
439
  next if list_code and /Tierarzneimittel/.match(list_code)
434
- ean13_to_product[de_idx[1][:ean].to_s] = de_idx[1]
440
+ ean13_to_product[ean] = de_idx[1]
435
441
  @missing << de_idx[1]
436
- ausgabe.puts "#{de_idx[1][:ean]},#{de_idx[1][:sequence_name]}"
442
+ ausgabe.puts "#{ean},#{de_idx[1][:sequence_name]}"
437
443
  }
438
444
  corrected_size = ean13_to_product.size
439
445
  Oddb2xml.log "build_product add_missing_products_from_swissmedic. Added #{(corrected_size - size_old)} corrected_size #{corrected_size} size_old #{size_old} ean13_to_product."
@@ -449,18 +455,28 @@ module Oddb2xml
449
455
  _builder = Nokogiri::XML::Builder.new(:encoding => 'utf-8') do |xml|
450
456
  xml.doc.tag_suffix = @tag_suffix
451
457
  datetime = Time.new.strftime('%FT%T%z')
458
+ emitted = []
452
459
  xml.PRODUCT(XML_OPTIONS) {
453
460
  list = []
454
461
  length = 0
455
462
  @missing.each do |obj|
456
463
  next if /^Q/i.match(obj[:atc])
464
+ if obj[:prodno]
465
+ next if emitted.index(obj[:prodno])
466
+ emitted << obj[:prodno]
467
+ end
457
468
  length += 1
458
469
  xml.PRD('DT' => obj[:last_change]) {
459
- ean = obj[:ean].to_s
470
+ ean = obj[:ean].to_i
460
471
  xml.GTIN ean
461
472
  xml.PRODNO obj[:prodno] if obj[:prodno]
462
- xml.DSCRD obj[:sequence_name] if obj[:sequence_name]
463
- xml.DSCRF obj[:sequence_name] if obj[:sequence_name]
473
+ if refdata = @refdata[ean]
474
+ xml.DSCRD refdata[:desc_de]
475
+ xml.DSCRF refdata[:desc_fr]
476
+ else
477
+ xml.DSCRD obj[:sequence_name] if obj[:sequence_name]
478
+ xml.DSCRF obj[:sequence_name] if obj[:sequence_name]
479
+ end
464
480
  xml.ATC obj[:atc_code] if obj[:atc_code] and !obj[:atc_code].empty?
465
481
  xml.IT obj[:ith_swissmedic] if obj[:ith_swissmedic]
466
482
  xml.CPT
@@ -470,30 +486,25 @@ module Oddb2xml
470
486
  xml.CompositionSwissmedic obj[:composition_swissmedic] if obj[:composition_swissmedic]
471
487
  }
472
488
  end
473
- @products.sort! { |a,b| a[:ean] <=> b[:ean] }
474
- @products.each do |obj|
489
+ # @products.sort! { |a,b| a[:ean] <=> b[:ean] }
490
+ @products.each do |ean13, obj|
475
491
  next if /^Q/i.match(obj[:atc])
476
492
  seq = obj[:seq]
477
493
  length += 1
478
494
  xml.PRD('DT' => obj[:last_change]) {
479
- ean = obj[:ean].to_s
495
+ ean = obj[:ean]
480
496
  xml.GTIN ean
481
- ppac = ((_ppac = @packs[ean[4..11].intern] and !_ppac[:is_tier]) ? _ppac : {})
497
+ ppac = ((_ppac = @packs[ean.to_s[4..11].intern] and !_ppac[:is_tier]) ? _ppac : {})
482
498
  unless ppac
483
499
  ppac = @packs.find{|pac| pac.ean == ean }.first
484
500
  end
485
501
  xml.PRODNO ppac[:prodno] if ppac[:prodno] and !ppac[:prodno].empty?
486
- if seq
487
- %w[de fr].each do |l|
488
- name = "name_#{l}".intern
489
- desc = "desc_#{l}".intern
490
- elem = "DSCR" + l[0].chr.upcase
491
- if !seq[name].empty? and !seq[desc].empty?
492
- xml.send(elem, seq[name] + ' ' + seq[desc])
493
- elsif !seq[desc].empty?
494
- xml.send(elem, [desc])
495
- end
496
- end
502
+ if refdata = @refdata[ean]
503
+ xml.DSCRD refdata[:desc_de]
504
+ xml.DSCRF refdata[:desc_fr]
505
+ else
506
+ xml.DSCRD obj[:sequence_name] if obj[:sequence_name]
507
+ xml.DSCRF obj[:sequence_name] if obj[:sequence_name]
497
508
  end
498
509
  #xml.BNAMD
499
510
  #xml.BNAMF
@@ -734,7 +745,7 @@ module Oddb2xml
734
745
  idx += 1
735
746
  Oddb2xml.log "build_article #{idx} of #{@articles.size} articles" if idx % 500 == 0
736
747
  item = @items[obj[:ean]]
737
- pac,no8 = nil,obj[:ean][4..11] # BAG-XML(SL/LS)
748
+ pac,no8 = nil,obj[:ean].to_s[4..11] # BAG-XML(SL/LS)
738
749
  pack_info = nil
739
750
  pack_info = @packs[no8.intern] if no8 # info from Packungen.xlsx from swissmedic_info
740
751
  ppac = nil # Packungen
@@ -743,7 +754,7 @@ module Oddb2xml
743
754
  next if obj[:desc_de] and /ad us vet/i.match(obj[:desc_de])
744
755
 
745
756
  pharma_code = obj[:pharmacode]
746
- ean = nil if ean.match(/^000000/)
757
+ ean = 0 if sprintf('%013d', ean).match(/^000000/)
747
758
  if obj[:seq]
748
759
  pac = obj[:seq][:packages][obj[:pharmacode]]
749
760
  pac = obj[:seq][:packages][ean] unless pac
@@ -759,7 +770,7 @@ module Oddb2xml
759
770
  end
760
771
  xml.ART('DT' => obj[:last_change] ? obj[:last_change] : '') {
761
772
  xml.REF_DATA (obj[:refdata] || @migel[pharma_code]) ? '1' : '0'
762
- xml.PHAR obj[:pharmacode] unless obj[:pharmacode].empty?
773
+ xml.PHAR sprintf('%07d', obj[:pharmacode]) if obj[:pharmacode]
763
774
  #xml.GRPCD
764
775
  #xml.CDS01
765
776
  #xml.CDS02
@@ -767,7 +778,7 @@ module Oddb2xml
767
778
  xml.SMCAT ppac[:swissmedic_category] unless ppac[:swissmedic_category].empty?
768
779
  end
769
780
  if no8 and !no8.to_s.empty?
770
- if ean and ean[0..3] == "7680"
781
+ if ean and ean.to_s[0..3] == "7680"
771
782
  xml.SMNO no8.to_s
772
783
  end
773
784
  end
@@ -793,8 +804,8 @@ module Oddb2xml
793
804
  xml.COOL 1 if @fridges.include?($1.to_s)
794
805
  end
795
806
  #xml.TEMP
796
- if ean and not ean.empty?
797
- flag = @flags[ean]
807
+ if ean
808
+ flag = @flags[ean.to_s]
798
809
  # as same flag
799
810
  xml.CDBG(flag ? 'Y' : 'N')
800
811
  xml.BG(flag ? 'Y' : 'N')
@@ -852,7 +863,7 @@ module Oddb2xml
852
863
  #xml.DEL
853
864
  xml.ARTCOMP {
854
865
  # use ean13(gln) as COMPNO
855
- xml.COMPNO obj[:company_ean] if obj[:company_ean] and not obj[:company_ean].empty?
866
+ xml.COMPNO obj[:company_ean] if obj[:company_ean] and obj[:company_ean].to_s.length > 1
856
867
  #xml.ROLE
857
868
  #xml.ARTNO1
858
869
  #xml.ARTNO2
@@ -860,10 +871,10 @@ module Oddb2xml
860
871
  }
861
872
  xml.ARTBAR {
862
873
  xml.CDTYP 'E13'
863
- xml.BC /^9999/.match(ean) ? 0 : ean
874
+ xml.BC /^9999|^0000|^0$/.match(ean.to_s) ? 0 : sprintf('%013d', ean)
864
875
  xml.BCSTAT 'A' # P is alternative
865
876
  #xml.PHAR2
866
- } if ean and not ean.empty?
877
+ } if ean
867
878
  #xml.ARTCH {
868
879
  #xml.PHAR2
869
880
  #xml.CHTYPE
@@ -981,7 +992,7 @@ module Oddb2xml
981
992
  info_index[info[:monid]] = i
982
993
  end
983
994
  # prod
984
- @products.each do |prod|
995
+ @products.each do |ean13, prod|
985
996
  next unless prod[:seq] and prod[:seq][:packages]
986
997
  seq = prod[:seq]
987
998
  prod[:seq][:packages].each {
@@ -1084,7 +1095,7 @@ module Oddb2xml
1084
1095
  # fallback via EAN
1085
1096
  bag_entry_via_ean = @items.values.select do |i|
1086
1097
  next unless i[:packages]
1087
- i[:packages].values.select {|_pac| _pac[:ean] == de_idx[:ean] }.length != 0
1098
+ i[:packages].values.select {|_pac| _pac[:ean].to_s == de_idx[:ean].to_s }.length != 0
1088
1099
  end.length
1089
1100
  if bag_entry_via_ean > 0
1090
1101
  10
@@ -1229,7 +1240,7 @@ module Oddb2xml
1229
1240
  else
1230
1241
  ('0' * DAT_LEN[:ITHE])
1231
1242
  end.to_i
1232
- row << "%0#{DAT_LEN[:CEAN]}d" % (ean.match(/^000000/) ? 0 : ean.to_i)
1243
+ row << "%0#{DAT_LEN[:CEAN]}d" % (sprintf('%013d', ean).match(/^000000/) ? 0 : ean.to_i)
1233
1244
  row << "%#{DAT_LEN[:CMWS]}s" % '2' # pharma
1234
1245
  rows << row
1235
1246
  end
data/lib/oddb2xml/cli.rb CHANGED
@@ -90,7 +90,6 @@ module Oddb2xml
90
90
  private
91
91
  def build
92
92
  Oddb2xml.log("Start build")
93
- puts "#{File.basename(__FILE__)}:#{__LINE__}: @refdata_types.keys #{@refdata_types.keys}"
94
93
  begin
95
94
  # require 'pry'; binding.pry
96
95
  @_files = {"calc"=>"oddb_calc.xml"} if @options[:calc] and not @options[:extended]
@@ -163,19 +162,24 @@ module Oddb2xml
163
162
  begin # instead of Thread.new do
164
163
  downloader = MedregbmDownloader.new(what)
165
164
  str = downloader.download
165
+ Oddb2xml.log("SwissmedicInfoDownloader #{what} str #{str.size} bytes")
166
166
  self.instance_variable_set(
167
167
  "@#{var}".intern,
168
- MedregbmExtractor.new(str, what).to_arry
168
+ items = MedregbmExtractor.new(str, what).to_arry
169
169
  )
170
+ Oddb2xml.log("MedregbmExtractor #{what} added #{items.size} fachinfo")
171
+ items
170
172
  end
171
173
  when :fachinfo
172
174
  begin # instead of Thread.new do
173
175
  downloader = SwissmedicInfoDownloader.new
174
176
  xml = downloader.download
177
+ Oddb2xml.log("SwissmedicInfoDownloader #{var} xml #{xml.size} bytes")
175
178
  @mutex.synchronize do
176
179
  hsh = SwissmedicInfoExtractor.new(xml).to_hash
177
180
  @infos = hsh
178
181
  Oddb2xml.log("SwissmedicInfoExtractor added #{@infos.size} fachinfo")
182
+ @infos
179
183
  end
180
184
  end
181
185
  when :orphan, :fridge
@@ -183,34 +187,41 @@ module Oddb2xml
183
187
  begin # instead of Thread.new do
184
188
  downloader = SwissmedicDownloader.new(what)
185
189
  bin = downloader.download
190
+ Oddb2xml.log("SwissmedicDownloader #{var} bin #{bin.size} bytes")
186
191
  self.instance_variable_set(
187
192
  "@#{var}".intern,
188
- SwissmedicExtractor.new(bin, what).to_arry
193
+ items = SwissmedicExtractor.new(bin, what).to_arry
189
194
  )
190
- # Oddb2xml.log("SwissmedicExtractor added #{self.instance_variable_get("@#{var}".intern).size} #{var}. File #{bin} was #{File.size(bin)} bytes")
195
+ Oddb2xml.log("SwissmedicExtractor added #{items.size} #{var}. File #{bin} was #{File.size(bin)} bytes")
196
+ items
191
197
  end
192
198
  when :interaction
193
199
  begin # instead of Thread.new do
194
200
  downloader = EphaDownloader.new
195
201
  str = downloader.download
202
+ Oddb2xml.log("EphaDownloader str #{str.size} bytes")
196
203
  @mutex.synchronize do
197
204
  @actions = EphaExtractor.new(str).to_arry
198
205
  Oddb2xml.log("EphaExtractor added #{@actions.size} interactions")
206
+ @actions
199
207
  end
200
208
  end
201
209
  when :migel
202
210
  begin # instead of Thread.new do
203
211
  downloader = MigelDownloader.new
204
212
  bin = downloader.download
213
+ Oddb2xml.log("MigelDownloader bin #{bin.size} bytes")
205
214
  @mutex.synchronize do
206
215
  @migel = MigelExtractor.new(bin).to_hash
207
216
  Oddb2xml.log("MigelExtractor added #{@migel.size} migel items")
217
+ @migel
208
218
  end
209
219
  end
210
220
  when :package
211
221
  begin # instead of Thread.new do
212
222
  downloader = SwissmedicDownloader.new(:package, @options)
213
223
  bin = downloader.download
224
+ Oddb2xml.log("SwissmedicDownloader bin #{bin.size} bytes")
214
225
  @mutex.synchronize do
215
226
  @packs = SwissmedicExtractor.new(bin, :package).to_hash
216
227
  Oddb2xml.log("SwissmedicExtractor added #{@packs.size} packs from #{bin}")
@@ -221,38 +232,44 @@ module Oddb2xml
221
232
  begin # instead of Thread.new do
222
233
  downloader = BMUpdateDownloader.new
223
234
  str = downloader.download
235
+ Oddb2xml.log("BMUpdateDownloader str #{str.size} bytes")
224
236
  @mutex.synchronize do
225
237
  @flags = BMUpdateExtractor.new(str).to_hash
226
238
  Oddb2xml.log("BMUpdateExtractor added #{@flags.size} flags")
239
+ @flags
227
240
  end
228
241
  end
229
242
  when :lppv
230
243
  begin # instead of Thread.new do
231
244
  downloader = LppvDownloader.new
232
245
  str = downloader.download
246
+ Oddb2xml.log("LppvDownloader str #{str.size} bytes")
233
247
  @mutex.synchronize do
234
248
  @lppvs = LppvExtractor.new(str).to_hash
235
249
  Oddb2xml.log("LppvExtractor added #{@lppvs.size} lppvs")
250
+ @lppvs
236
251
  end
237
252
  end
238
253
  when :bag
239
254
  begin # instead of Thread.new do
240
255
  downloader = BagXmlDownloader.new(@options)
241
256
  xml = downloader.download
257
+ Oddb2xml.log("BagXmlDownloader xml #{xml.size} bytes")
242
258
  @mutex.synchronize do
243
259
  hsh = BagXmlExtractor.new(xml).to_hash
244
260
  @items = hsh
245
- Oddb2xml.log("BagXmlDownloader added #{@items.size} items. #{@items.keys}")
261
+ Oddb2xml.log("BagXmlExtractor added #{@items.size} items.")
262
+ @items
246
263
  end
247
264
  end
248
265
  when :zurrose
249
266
  begin # instead of Thread.new do
250
267
  downloader = ZurroseDownloader.new(@options, @options[:transfer_dat])
251
268
  xml = downloader.download
252
- Oddb2xml.log("zurrose xml #{xml.size} bytes")
269
+ Oddb2xml.log("ZurroseDownloader xml #{xml.size} bytes")
253
270
  @mutex.synchronize do
254
271
  hsh = ZurroseExtractor.new(xml, @options[:extended]).to_hash
255
- Oddb2xml.log("zurrose added #{hsh.size} items from xml with #{xml.size} bytes")
272
+ Oddb2xml.log("ZurroseExtractor added #{hsh.size} items from xml with #{xml.size} bytes")
256
273
  @infos_zur_rose = hsh
257
274
  end
258
275
  end
@@ -261,7 +278,7 @@ module Oddb2xml
261
278
  downloader = RefdataDownloader.new(@options, type)
262
279
  begin
263
280
  xml = downloader.download
264
- Oddb2xml.log("refdata #{type} xml #{xml.size} bytes")
281
+ Oddb2xml.log("RefdataDownloader #{type} xml #{xml.size} bytes")
265
282
  xml
266
283
  rescue SystemExit
267
284
  @mutex.synchronize do
@@ -274,7 +291,8 @@ module Oddb2xml
274
291
  @mutex.synchronize do
275
292
  hsh = RefdataExtractor.new(xml, type).to_hash
276
293
  @refdata_types[type] = hsh
277
- Oddb2xml.log("refdata #{type} added #{hsh.size} keys now #{@refdata_types.keys} items from xml with #{xml.size} bytes")
294
+ Oddb2xml.log("RefdataExtractor #{type} added #{hsh.size} keys now #{@refdata_types.keys} items from xml with #{xml.size} bytes")
295
+ @refdata_types[type]
278
296
  end
279
297
  end
280
298
  end
@@ -332,7 +350,7 @@ module Oddb2xml
332
350
  if @refdata_types[type]
333
351
  indices = @refdata_types[type].values.flatten.length
334
352
  if type == :nonpharma
335
- migel_xls = @migel.values.compact.select{|m| !m[:pharmacode].empty? }.map{|m| m[:pharmacode] }
353
+ migel_xls = @migel.values.compact.select{|m| !m[:pharmacode]}.map{|m| m[:pharmacode] }
336
354
  nonpharmas = @refdata_types[type].keys
337
355
  indices += (migel_xls - nonpharmas).length # ignore duplicates, null
338
356
  lines << sprintf("\tNonPharma products: %i", indices)
@@ -202,7 +202,7 @@ module Oddb2xml
202
202
  end
203
203
  end
204
204
  content = read_xml_from_zip(/Preparations.xml/, File.join(Downloads, File.basename(file)))
205
- FileUtils.rm_f(file, :verbose => false) unless defined?(Rspec)
205
+ FileUtils.rm_f(file, :verbose => false) unless defined?(RSpec)
206
206
  content
207
207
  end
208
208
  end
@@ -27,13 +27,6 @@ module Oddb2xml
27
27
  def initialize(xml)
28
28
  @xml = xml
29
29
  end
30
- def correct_code(pharmacode, length=7)
31
- if pharmacode.length != length # restore zero at the beginnig
32
- ("%0#{length}i" % pharmacode.to_i)
33
- else
34
- pharmacode
35
- end
36
- end
37
30
  end
38
31
  class BMUpdateExtractor < Extractor
39
32
  include TxtExtractorMethods
@@ -79,11 +72,10 @@ module Oddb2xml
79
72
  item[:pharmacodes] = []
80
73
  item[:packages] = {} # pharmacode => package
81
74
  seq.Packs.Pack.each do |pac|
82
- phar = pac.Pharmacode
83
- phar = correct_code(phar.to_s, 7)
84
- ean = pac.GTIN
85
- binding.pry if pac.GTIN.to_s.eql? '7680324750190' # lansoyl
86
- search_key = phar.to_i != 0 ? phar : ean
75
+ phar = pac.Pharmacode.to_i
76
+ ean = pac.GTIN.to_i
77
+ # search_key = phar.to_i != 0 ? phar : ean
78
+ search_key = ean != 0 ? ean : phar
87
79
  # as common key with RefData Pharma/NonPharma data
88
80
  item[:pharmacodes] << phar
89
81
  # packages
@@ -141,7 +133,7 @@ module Oddb2xml
141
133
  end
142
134
  if id.empty? or id == '0'
143
135
  key = :pharmacode
144
- id = phar.to_s
136
+ id = phar.to_i
145
137
  end
146
138
  lims.each do |lim|
147
139
  limitation = {
@@ -191,16 +183,16 @@ module Oddb2xml
191
183
  item = {}
192
184
  item[:refdata] = true
193
185
  item[:_type] = (typ = pac.ATYPE.downcase.to_sym) ? typ: ''
194
- item[:ean] = (gtin = pac.GTIN) ? gtin: ''
195
- item[:pharmacode] = (phar = pac.PHAR) ? phar: ''
186
+ item[:ean] = (gtin = pac.GTIN.to_i) ? gtin: 0
187
+ item[:pharmacode] = (phar = pac.PHAR.to_i) ? phar: 0
196
188
  item[:last_change] = (date = Time.parse(pac.DT).to_s) ? date: '' # Date and time of last data change
197
189
  item[:desc_de] = (dscr = pac.NAME_DE) ? dscr: ''
198
190
  item[:desc_fr] = (dscr = pac.NAME_FR) ? dscr: ''
199
191
  item[:atc_code] = (code = pac.ATC) ? code.to_s : ''
200
192
  item[:company_name] = (nam = pac.AUTH_HOLDER_NAME) ? nam: ''
201
193
  item[:company_ean] = (gln = pac.AUTH_HOLDER_GLN) ? gln: ''
202
- unless item[:pharmacode].empty?
203
- item[:pharmacode] = correct_code(item[:pharmacode].to_s, 7)
194
+ unless item[:pharmacode]
195
+ item[:pharmacode] = phar
204
196
  unless data[item[:pharmacode]] # pharmacode => GTINs
205
197
  data[item[:ean]] = []
206
198
  end
@@ -322,18 +314,18 @@ module Oddb2xml
322
314
  data = {}
323
315
  @sheet.each_with_index do |row, i|
324
316
  next if i.zero?
325
- phar = correct_code(row[1].to_s.gsub(/[^0-9]/, ''), 7)
326
- ean = row[0].to_i.to_s
327
- ean = '9999'+phar+'99' unless ean.length == 13
317
+ phar = row[1].to_i
318
+ ean = row[0].to_i
319
+ ean = phar unless ean.to_s.length == 13
328
320
  data[ean] = {
329
321
  :refdata => true,
330
322
  :ean => ean,
331
- :pharmacode => phar,
323
+ :pharmacode => phar.to_i,
332
324
  :desc_de => row[3],
333
325
  :desc_fr => row[4],
334
326
  :quantity => row[5], # quantity
335
327
  :company_name => row[6],
336
- :company_ean => row[7].to_i.to_s,
328
+ :company_ean => row[7].to_i,
337
329
  }
338
330
  end
339
331
  data
@@ -476,12 +468,12 @@ module Oddb2xml
476
468
  else
477
469
  next unless line =~ /(7680\d{9})(\d{1})$/
478
470
  end
479
- pharma_code = line[3..9]
471
+ pharma_code = line[3..9].to_i
480
472
  if $1.to_s == '0000000000000'
481
473
  @@items_without_ean13s += 1
482
- ean13 = '000000' + pharma_code # dummy ean13
474
+ ean13 = pharma_code # dummy ean13
483
475
  else
484
- ean13 = $1.to_s
476
+ ean13 = $1.to_i
485
477
  end
486
478
  if data[ean13]
487
479
  @@error_file.puts "Duplicate ean13 #{ean13} in line \nact: #{line.chomp}\norg: #{data[ean13][:line]}"
@@ -1,3 +1,3 @@
1
1
  module Oddb2xml
2
- VERSION = "2.1.9"
2
+ VERSION = "2.2.0"
3
3
  end
data/oddb2xml.gemspec CHANGED
@@ -40,5 +40,6 @@ Gem::Specification.new do |spec|
40
40
  spec.add_development_dependency "rdoc"
41
41
  spec.add_development_dependency "vcr"
42
42
  spec.add_development_dependency "timecop"
43
+ # spec.add_development_dependency "ruby-prof"
43
44
  end
44
45
 
data/spec/builder_spec.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  require 'spec_helper'
4
4
  require "rexml/document"
5
5
  include REXML
6
- RUN_ALL = false
6
+ RUN_ALL = true
7
7
  def checkItemForRefdata(doc, pharmacode, isRefdata)
8
8
  article = XPath.match( doc, "//ART[PHAR=#{pharmacode.to_s}]").first
9
9
  name = article.elements['DSCRD'].text
@@ -113,6 +113,7 @@ end
113
113
  def checkAndGetProductWithGTIN(doc, gtin)
114
114
  products = XPath.match( doc, "//PRD[GTIN=#{gtin.to_s}]")
115
115
  gtins = XPath.match( doc, "//PRD[GTIN=#{gtin.to_s}]/GTIN")
116
+ binding.pry unless gtins.size == 1
116
117
  gtins.size.should eq 1
117
118
  gtins.first.text.should eq gtin.to_s
118
119
  # return product
@@ -176,8 +177,8 @@ def checkProductXml
176
177
  doc = REXML::Document.new IO.read(product_filename)
177
178
  desitin = checkAndGetProductWithGTIN(doc, Oddb2xml::LEVETIRACETAM_GTIN)
178
179
  desitin.elements['ATC'].text.should == 'N03AX14'
179
- desitin.elements['DSCRD'].text.should == "Levetiracetam DESITIN Minipacks mit Mini-Filmtabl 250 mg "
180
- desitin.elements['DSCRF'].text.should == 'Levetiracetam DESITIN minipacks avec cpr pell mini 250 mg '
180
+ desitin.elements['DSCRD'].text.should == "LEVETIRACETAM DESITIN Mini Filmtab 250 mg 30 Stk"
181
+ desitin.elements['DSCRF'].text.should == 'LEVETIRACETAM DESITIN mini cpr pel 250 mg 30 pce'
181
182
  desitin.elements['PRODNO'].text.should eq '620691'
182
183
  desitin.elements['IT'].text.should eq '01.07.1.'
183
184
  desitin.elements['PackGrSwissmedic'].text.should eq '30'
@@ -208,11 +209,9 @@ end
208
209
 
209
210
  describe Oddb2xml::Builder do
210
211
  NrExtendedArticles = 86
211
- NrNonPharmaArticles = 66
212
- NrPharmaArticles = 8
213
212
  NrSubstances = 12
214
- NrProdno = 20
215
- NrPackages = 21
213
+ NrProdno = 19
214
+ NrPackages = 20
216
215
  RegExpDesitin = /1125819012LEVETIRACETAM DESITIN Mini Filmtab 250 mg 30 Stk/
217
216
  include ServerMockHelper
218
217
  def common_run_init
@@ -333,7 +332,11 @@ end
333
332
  options = Oddb2xml::Options.new
334
333
  options.parser.parse!('-e'.split(' '))
335
334
  Oddb2xml::Cli.new(options.opts)
336
- @res = buildr_capture(:stdout){ Oddb2xml::Cli.new(options.opts).run }
335
+ if RUN_ALL
336
+ @res = buildr_capture(:stdout){ Oddb2xml::Cli.new(options.opts).run }
337
+ else
338
+ Oddb2xml::Cli.new(options.opts).run
339
+ end
337
340
  end
338
341
 
339
342
  it 'should emit a correct oddb_article.xml' do
@@ -345,9 +348,9 @@ end
345
348
  end
346
349
 
347
350
  it 'should report correct output on stdout' do
348
- @res.should match(/NonPharma products/)
349
- @res.should match(/NonPharma products: #{NrNonPharmaArticles}/)
350
- end
351
+ @res.should match(/\sPharma products: \d+/)
352
+ @res.should match(/\sNonPharma products: \d+/)
353
+ end if RUN_ALL
351
354
 
352
355
  it 'should contain the correct (normal) prices' do
353
356
  checkPrices(false)
@@ -359,7 +362,7 @@ end
359
362
  checkItemForRefdata(doc, "1699947", 1) # 3TC Filmtabl 150 mg SMNO 53662013 IKSNR 53‘662, 53‘663
360
363
  checkItemForRefdata(doc, "0598003", 0) # SOFRADEX Gtt Auric 8 ml
361
364
  checkItemForRefdata(doc, "5366964", 1) # 1-DAY ACUVUE moist jour
362
- novopen = checkItemForRefdata(doc, "3036984", 0) # NovoPen 4 Injektionsgerät blue In NonPharma (a MiGel product)
365
+ novopen = checkItemForRefdata(doc, "3036984", 1) # NovoPen 4 Injektionsgerät blue In NonPharma (a MiGel product)
363
366
  expect(novopen.elements['ARTBAR/BC'].text).to eq '0'
364
367
  end
365
368
 
@@ -388,6 +391,7 @@ end
388
391
  XPath.match( doc, "//PHAR" ).find_all{|x| x.text.match('5366964') }.size.should == 1
389
392
  dscrds.size.should == NrExtendedArticles
390
393
  XPath.match( doc, "//PRODNO" ).find_all{|x| true}.size.should >= 1
394
+ XPath.match( doc, "//PRODNO" ).find_all{|x| x.text.match('002771') }.size.should == 0
391
395
  XPath.match( doc, "//PRODNO" ).find_all{|x| x.text.match('620691') }.size.should == 1
392
396
  end
393
397
 
data/spec/cli_spec.rb CHANGED
@@ -44,6 +44,16 @@ describe Oddb2xml::Cli do
44
44
  cleanup_compressor
45
45
  end
46
46
 
47
+ context 'when -x address option is given' do
48
+ before(:all) do
49
+ cleanup_directories_before_run
50
+ options = Oddb2xml::Options.new
51
+ options.parser.parse!('-e --log'.split(' '))
52
+ @cli = Oddb2xml::Cli.new(options.opts)
53
+ @cli_output = buildr_capture(:stdout) { @cli.run }
54
+ end
55
+ end
56
+ if true
47
57
  context 'when -t md option is given' do
48
58
  before(:all) do
49
59
  cleanup_directories_before_run
@@ -288,3 +298,4 @@ describe Oddb2xml::Cli do
288
298
  end
289
299
  end
290
300
  end
301
+ end
@@ -140,7 +140,6 @@ if true
140
140
  puts "#{Time.now}: URI was #{i.request.uri}"
141
141
  m = /filename=.([^\d]+)/.match(i.response.headers['Content-Disposition'][0])
142
142
  puts "#{Time.now}: SwissmedicDownloader #{m[1]} (#{i.response.body.size} bytes)."
143
- # binding.pry
144
143
  if m and true
145
144
  name = m[1].chomp('_')
146
145
  swissmedic_dir = File.join(Oddb2xml::WorkDir, 'swissmedic')
@@ -41,9 +41,10 @@ describe Oddb2xml::MigelExtractor do
41
41
  after(:all) { VCR.eject_cassette }
42
42
  it "should have at some items" do
43
43
  expect(@items.size).not_to eq 0
44
- expect(@items.find{|k,v| /3248410/i.match(v[:pharmacode]) }).not_to be_nil
44
+ expect(@items.find{|k,v| 3248410 == v[:pharmacode] }).not_to be_nil
45
45
  expect(@items.find{|k,v| /Novopen/i.match(v[:desc_de]) }).not_to be_nil
46
- expect(@items.find{|k,v| /3036984/i.match(v[:pharmacode]) }).not_to be_nil
46
+ expect(@items.find{|k,v| 3036984 == v[:pharmacode] }).not_to be_nil
47
+ expect(@items.find{|k,v| /Epimineral/i.match(v[:desc_de]) }).not_to be_nil
47
48
  end
48
49
  end
49
50
 
@@ -59,12 +60,12 @@ describe Oddb2xml::RefdataExtractor do
59
60
 
60
61
  it "should have correct info for pharmacode 1699947 correctly" do
61
62
  @pharma_items = subject.to_hash
62
- pharma_code_LEVETIRACETAM = "5819012"
63
+ pharma_code_LEVETIRACETAM = 5819012
63
64
  item_found = @pharma_items.values.find{ |x| x[:pharmacode].eql?(pharma_code_LEVETIRACETAM)}
64
65
  expect(item_found).not_to be nil
65
66
  expected = { :refdata=>true,
66
67
  :_type=>:pharma,
67
- :ean=> Oddb2xml::LEVETIRACETAM_GTIN,
68
+ :ean=> Oddb2xml::LEVETIRACETAM_GTIN.to_i,
68
69
  :pharmacode=> pharma_code_LEVETIRACETAM,
69
70
  :last_change => "2015-06-04 00:00:00 +0000",
70
71
  :desc_de=>"LEVETIRACETAM DESITIN Mini Filmtab 250 mg 30 Stk",
@@ -85,12 +86,12 @@ describe Oddb2xml::RefdataExtractor do
85
86
 
86
87
  it "should have correct info for nonpharma with pharmacode 0058502 correctly" do
87
88
  @non_pharma_items = subject.to_hash
88
- pharma_code_TUBEGAZE = '0058519'
89
+ pharma_code_TUBEGAZE = 58519
89
90
  item_found = @non_pharma_items.values.find{ |x| x[:pharmacode].eql?(pharma_code_TUBEGAZE)}
90
91
  expect(item_found).not_to be nil
91
92
  expected = {:refdata=>true,
92
93
  :_type=>:nonpharma,
93
- :ean=>"7611600441020",
94
+ :ean=>7611600441020,
94
95
  :pharmacode=>pharma_code_TUBEGAZE,
95
96
  :last_change => "2015-06-04 00:00:00 +0000",
96
97
  :desc_de=>"TUBEGAZE Verband weiss Nr 12 20m Finger gross",
@@ -114,23 +115,24 @@ describe Oddb2xml::BagXmlExtractor do
114
115
  end
115
116
  it "should handle pub_price for 1699947 correctly" do
116
117
  @items = subject.to_hash
117
- with_pharma = @items['1699947']
118
+ with_pharma = @items[Oddb2xml::THREE_TC_GTIN]
118
119
  expect(with_pharma).not_to be_nil
120
+ expect(with_pharma[:name_de]).to eq '3TC'
119
121
  expect(with_pharma[:atc_code]).not_to be_nil
120
- expect(with_pharma[:pharmacodes]).not_to be_nil
122
+ expect(with_pharma[:pharmacodes]).to eq [1699947]
121
123
  expect(with_pharma[:packages].size).to eq(1)
122
- expect(with_pharma[:packages].first[0]).to eq('1699947')
124
+ expect(with_pharma[:packages].first[0]).to eq(Oddb2xml::THREE_TC_GTIN)
123
125
  expect(with_pharma[:packages].first[1][:prices][:pub_price][:price]).to eq('205.3')
124
126
  expect(@items.size).to eq(5)
125
127
  end
126
128
  it "should handle pub_price for 7680620690084 correctly" do
127
129
  @items = subject.to_hash
128
- no_pharma = @items['7680620690084']
130
+ no_pharma = @items[7680620690084]
129
131
  expect(no_pharma).not_to be_nil
130
132
  expect(no_pharma[:atc_code]).not_to be_nil
131
133
  expect(no_pharma[:pharmacodes]).not_to be_nil
132
134
  expect(no_pharma[:packages].size).to eq(1)
133
- expect(no_pharma[:packages].first[0]).to eq('7680620690084')
135
+ expect(no_pharma[:packages].first[0]).to eq(7680620690084)
134
136
  expect(no_pharma[:packages].first[1][:prices][:pub_price][:price]).to eq('27.8')
135
137
  end
136
138
  end
@@ -253,7 +255,7 @@ describe Oddb2xml::ZurroseExtractor do
253
255
  Oddb2xml::ZurroseExtractor.new(dat)
254
256
  end
255
257
  it { expect(subject.to_hash.keys.length).to eq(1) }
256
- it { expect(subject.to_hash.keys.first).to eq("7680316440115") }
258
+ it { expect(subject.to_hash.keys.first).to eq(7680316440115) }
257
259
  it { expect(subject.to_hash.values.first[:price]).to eq("8.95") }
258
260
  end
259
261
  context 'when Estradiol Creme is given' do
@@ -264,11 +266,11 @@ describe Oddb2xml::ZurroseExtractor do
264
266
  Oddb2xml::ZurroseExtractor.new(dat)
265
267
  end
266
268
  it { expect(subject.to_hash.keys.length).to eq(1) }
267
- it { expect(subject.to_hash.keys.first).to eq("7680284070840") }
269
+ it { expect(subject.to_hash.keys.first).to eq(7680284070840) }
268
270
  it { expect(subject.to_hash.values.first[:vat]).to eq("2") }
269
271
  it { expect(subject.to_hash.values.first[:price]).to eq("9.40") }
270
272
  it { expect(subject.to_hash.values.first[:pub_price]).to eq("16.30") }
271
- it { expect(subject.to_hash.values.first[:pharmacode]).to eq("0921929") }
273
+ it { expect(subject.to_hash.values.first[:pharmacode]).to eq(921929) }
272
274
  end
273
275
  context 'when SELSUN Shampoo is given' do
274
276
  subject do
@@ -278,11 +280,11 @@ describe Oddb2xml::ZurroseExtractor do
278
280
  Oddb2xml::ZurroseExtractor.new(dat)
279
281
  end
280
282
  it { expect(subject.to_hash.keys.length).to eq(1) }
281
- it { expect(subject.to_hash.keys.first).to eq("7680172330681") }
283
+ it { expect(subject.to_hash.keys.first).to eq(7680172330681) }
282
284
  it { expect(subject.to_hash.values.first[:vat]).to eq("2") }
283
285
  it { expect(subject.to_hash.values.first[:price]).to eq("15.76") }
284
286
  it { expect(subject.to_hash.values.first[:pub_price]).to eq("24.30") }
285
- it { expect(subject.to_hash.values.first[:pharmacode]).to eq("0020652") }
287
+ it { expect(subject.to_hash.values.first[:pharmacode]).to eq(20652) }
286
288
  it 'should set the correct SALECD cmut code' do expect(subject.to_hash.values.first[:cmut]).to eq("2") end
287
289
  end
288
290
  context 'when SOFRADEX is given' do
@@ -303,7 +305,7 @@ describe Oddb2xml::ZurroseExtractor do
303
305
  DAT
304
306
  Oddb2xml::ZurroseExtractor.new(dat, true)
305
307
  end
306
- it { expect(subject.to_hash.keys.first).to eq("0000008807890") }
308
+ it { expect(subject.to_hash.keys.first).to eq(8807890) }
307
309
  it "should set the correct SALECD cmut code" do expect(subject.to_hash.values.first[:cmut]).to eq("2") end
308
310
  it "should set the correct SALECD description" do expect(subject.to_hash.values.first[:description]).to match(/Ethacridin lactat 1.+ 100ml/) end
309
311
  end
data/spec/spec_helper.rb CHANGED
@@ -65,23 +65,23 @@ module Oddb2xml
65
65
  '7680555580054', # ZYVOXID
66
66
  '7680620690084', # LEVETIRACETAM DESITIN Mini Filmtab 250 mg needed for extractor_spec.rb
67
67
  ] + GTINS_CALC
68
- FERRO_GRADUMET_GTIN = '7680316440115'
69
- FIRST_DAY_ACUVUE_GTIN = '733905577161'
70
- HIRUDOID_GTIN = '7680161050583'
71
- LANSOYL_GTIN = '7680324750190'
68
+ FERRO_GRADUMET_GTIN = 7680316440115
69
+ FIRST_DAY_ACUVUE_GTIN = 733905577161
70
+ HIRUDOID_GTIN = 7680161050583
71
+ LANSOYL_GTIN = 7680324750190
72
72
  LANSOYL_PRICE_RESELLER_PUB = 18.95
73
73
  LANSOYL_PRICE_ZURROSE = 10.54
74
74
  LANSOYL_PRICE_ZURROSEPUB = 16.25
75
- LEVETIRACETAM_GTIN = '7680620690084'
75
+ LEVETIRACETAM_GTIN = 7680620690084
76
76
  LEVETIRACETAM_PRICE_PPUB = 27.8
77
77
  LEVETIRACETAM_PRICE_ZURROSE = 13.49
78
78
  LEVETIRACETAM_PRICE_RESELLER_PUB = 24.3
79
- SOFRADEX_GTIN = '7680316950157'
79
+ SOFRADEX_GTIN = 7680316950157
80
80
  SOFRADEX_PRICE_RESELLER_PUB = 12.9
81
81
  SOFRADEX_PRICE_ZURROSE = 7.18
82
82
  SOFRADEX_PRICE_ZURROSEPUB = 15.45
83
- THREE_TC_GTIN = '7680536620137'
84
- ZYVOXID_GTIN = '7680555580054'
83
+ THREE_TC_GTIN = 7680536620137
84
+ ZYVOXID_GTIN = 7680555580054
85
85
 
86
86
  GTINS_MEDREG = [
87
87
  7601001380028, # Glarus
metadata CHANGED
@@ -1,139 +1,139 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oddb2xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.9
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasuhiro Asaka, Zeno R.R. Davatz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-24 00:00:00.000000000 Z
11
+ date: 2015-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - ! '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: archive-tar-minitar
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mechanize
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: nokogiri
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - ! '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: savon
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - ! '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - ! '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: spreadsheet
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - ! '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - ! '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubyXL
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - ! '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - ! '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: sax-machine
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - ! '>='
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - ! '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: parslet
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - ! '>='
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - ! '>='
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
@@ -154,126 +154,126 @@ dependencies:
154
154
  name: multi_json
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ">="
157
+ - - ! '>='
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ">="
164
+ - - ! '>='
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: httpi
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ">="
171
+ - - ! '>='
172
172
  - !ruby/object:Gem::Version
173
173
  version: 2.4.1
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ">="
178
+ - - ! '>='
179
179
  - !ruby/object:Gem::Version
180
180
  version: 2.4.1
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: bundler
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ">="
185
+ - - ! '>='
186
186
  - !ruby/object:Gem::Version
187
187
  version: '0'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - ">="
192
+ - - ! '>='
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: rake
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - ">="
199
+ - - ! '>='
200
200
  - !ruby/object:Gem::Version
201
201
  version: '0'
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - ">="
206
+ - - ! '>='
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: rspec
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
- - - ">="
213
+ - - ! '>='
214
214
  - !ruby/object:Gem::Version
215
215
  version: '0'
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
- - - ">="
220
+ - - ! '>='
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: webmock
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
- - - ">="
227
+ - - ! '>='
228
228
  - !ruby/object:Gem::Version
229
229
  version: '0'
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
- - - ">="
234
+ - - ! '>='
235
235
  - !ruby/object:Gem::Version
236
236
  version: '0'
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: rdoc
239
239
  requirement: !ruby/object:Gem::Requirement
240
240
  requirements:
241
- - - ">="
241
+ - - ! '>='
242
242
  - !ruby/object:Gem::Version
243
243
  version: '0'
244
244
  type: :development
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
- - - ">="
248
+ - - ! '>='
249
249
  - !ruby/object:Gem::Version
250
250
  version: '0'
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: vcr
253
253
  requirement: !ruby/object:Gem::Requirement
254
254
  requirements:
255
- - - ">="
255
+ - - ! '>='
256
256
  - !ruby/object:Gem::Version
257
257
  version: '0'
258
258
  type: :development
259
259
  prerelease: false
260
260
  version_requirements: !ruby/object:Gem::Requirement
261
261
  requirements:
262
- - - ">="
262
+ - - ! '>='
263
263
  - !ruby/object:Gem::Version
264
264
  version: '0'
265
265
  - !ruby/object:Gem::Dependency
266
266
  name: timecop
267
267
  requirement: !ruby/object:Gem::Requirement
268
268
  requirements:
269
- - - ">="
269
+ - - ! '>='
270
270
  - !ruby/object:Gem::Version
271
271
  version: '0'
272
272
  type: :development
273
273
  prerelease: false
274
274
  version_requirements: !ruby/object:Gem::Requirement
275
275
  requirements:
276
- - - ">="
276
+ - - ! '>='
277
277
  - !ruby/object:Gem::Version
278
278
  version: '0'
279
279
  description: oddb2xml creates xml files using swissINDEX, BAG-XML and Swissmedic.
@@ -283,9 +283,9 @@ executables:
283
283
  extensions: []
284
284
  extra_rdoc_files: []
285
285
  files:
286
- - ".gitignore"
287
- - ".rspec"
288
- - ".travis.yml"
286
+ - .gitignore
287
+ - .rspec
288
+ - .travis.yml
289
289
  - Gemfile
290
290
  - Gemfile.lock
291
291
  - History.txt
@@ -376,17 +376,17 @@ require_paths:
376
376
  - lib
377
377
  required_ruby_version: !ruby/object:Gem::Requirement
378
378
  requirements:
379
- - - ">="
379
+ - - ! '>='
380
380
  - !ruby/object:Gem::Version
381
381
  version: '0'
382
382
  required_rubygems_version: !ruby/object:Gem::Requirement
383
383
  requirements:
384
- - - ">="
384
+ - - ! '>='
385
385
  - !ruby/object:Gem::Version
386
386
  version: '0'
387
387
  requirements: []
388
388
  rubyforge_project:
389
- rubygems_version: 2.4.5
389
+ rubygems_version: 2.3.0
390
390
  signing_key:
391
391
  specification_version: 4
392
392
  summary: oddb2xml creates xml files.