Class: Oddb2xml::BagXmlDownloader
Instance Method Summary
collapse
Methods inherited from Downloader
#initialize
Instance Method Details
#download ⇒ Object
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
# File 'lib/oddb2xml/downloader.rb', line 150
def download
file = 'XMLPublications.zip'
begin
if @options[:debug]
FileUtils.copy(File.expand_path("../../../spec/data/#{file}", __FILE__), '.')
else
response = @agent.get(@url)
response.save_as(file)
response = nil end
return read_xml_form_zip(/^Preparation/iu, file)
rescue Timeout::Error, Errno::ETIMEDOUT
retrievable? ? retry : raise
ensure
if File.exists?(file)
File.unlink(file)
end
end
end
|
#init ⇒ Object
146
147
148
149
|
# File 'lib/oddb2xml/downloader.rb', line 146
def init
super
@url ||= 'http://bag.e-mediat.net/SL2007.Web.External/File.axd?file=XMLPublications.zip'
end
|