Class: Oddb2xml::BagXmlDownloader
Instance Attribute Summary
Attributes inherited from Downloader
#agent, #type, #url
Instance Method Summary
collapse
Methods inherited from Downloader
#initialize, #report_download
Instance Method Details
#download ⇒ Object
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
|
# File 'lib/oddb2xml/downloader.rb', line 202
def download
file = File.join(WorkDir, '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 => false) unless defined?(RSpec)
content
end
|
#init ⇒ Object
198
199
200
201
|
# File 'lib/oddb2xml/downloader.rb', line 198
def init
super
@url ||= 'http://bag.e-mediat.net/SL2007.Web.External/File.axd?file=XMLPublications.zip'
end
|