Class: Oddb2xml::FirstbaseDownloader
- Inherits:
-
Downloader
- Object
- Downloader
- Oddb2xml::FirstbaseDownloader
- Includes:
- DownloadMethod
- Defined in:
- lib/oddb2xml/downloader.rb
Constant Summary collapse
- BASE_URL =
"http://pillbox.oddb.org"
Instance Attribute Summary
Attributes inherited from Downloader
#agent, #file2save, #type, #url
Instance Method Summary collapse
- #download ⇒ Object
-
#initialize(type = :orphan, options = {}) ⇒ FirstbaseDownloader
constructor
A new instance of FirstbaseDownloader.
Methods inherited from Downloader
Constructor Details
#initialize(type = :orphan, options = {}) ⇒ FirstbaseDownloader
Returns a new instance of FirstbaseDownloader.
388 389 390 |
# File 'lib/oddb2xml/downloader.rb', line 388 def initialize(type = :orphan, = {}) @url = BASE_URL + "/firstbase.xlsx" end |
Instance Method Details
#download ⇒ Object
392 393 394 395 396 397 398 399 400 401 402 403 404 |
# File 'lib/oddb2xml/downloader.rb', line 392 def download @file2save = File.join(DOWNLOADS, "firstbase.xlsx") report_download(@url, @file2save) begin download_as(@file2save, "w+") return File.(@file2save) rescue Timeout::Error, Errno::ETIMEDOUT retrievable? ? retry : raise ensure Oddb2xml.download_finished(@file2save, false) end File.(@file2save) end |