lib/oddb2xml/cli.rb in oddb2xml-2.3.0 vs lib/oddb2xml/cli.rb in oddb2xml-2.3.1
- old
+ new
@@ -211,11 +211,11 @@
@mutex.synchronize do
@migel = MigelExtractor.new(bin).to_hash
Oddb2xml.log("MigelExtractor added #{@migel.size} migel items")
@migel
end
- end
+ end unless SkipMigelDownloader
when :package
begin # instead of Thread.new do
downloader = SwissmedicDownloader.new(:package, @options)
bin = downloader.download
Oddb2xml.log("SwissmedicDownloader package #{bin} #{File.size(bin)} bytes")
@@ -334,12 +334,16 @@
unless @options[:address]
types.each do |type|
if @refdata_types[type]
indices = @refdata_types[type].values.flatten.length
if type == :nonpharma
- migel_xls = @migel.values.compact.select{|m| !m[:pharmacode]}.map{|m| m[:pharmacode] }
nonpharmas = @refdata_types[type].keys
- indices += (migel_xls - nonpharmas).length # ignore duplicates, null
+ if SkipMigelDownloader
+ indices + nonpharmas.length
+ else
+ migel_xls = @migel.values.compact.select{|m| !m[:pharmacode]}.map{|m| m[:pharmacode] }
+ indices += (migel_xls - nonpharmas).length # ignore duplicates, null
+ end
lines << sprintf("\tNonPharma products: %i", indices)
else
lines << sprintf("\tPharma products: %i", indices)
end
end