class Oddb2xml::BagXmlDownloader
Public Instance Methods
download()
click to toggle source
# File lib/oddb2xml/downloader.rb, line 222 def download file = File.join(WORK_DIR, "XMLPublications.zip") download_as(file) report_download(@url, file) if defined?(RSpec) src = File.join(Oddb2xml::SpecData, "Preparations.xml") content = File.read(src) FileUtils.cp(src, File.join(DOWNLOADS, File.basename(file))) else content = read_xml_from_zip(/Preparations.xml/, File.join(DOWNLOADS, File.basename(file))) end if @options[:artikelstamm] cmd = "xmllint --format --output Preparations.xml Preparations.xml" Oddb2xml.log(cmd) system(cmd) end FileUtils.rm_f(file, verbose: true) unless defined?(RSpec) content end
init()
click to toggle source
Calls superclass method
Oddb2xml::Downloader#init
# File lib/oddb2xml/downloader.rb, line 217 def init super @url ||= "http://www.spezialitaetenliste.ch/File.axd?file=XMLPublications.zip" end