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