Class: Sufia::ControlledVocabulary::Importer::Downloader
- Inherits:
-
Object
- Object
- Sufia::ControlledVocabulary::Importer::Downloader
- Defined in:
- lib/sufia/controlled_vocabulary/importer/downloader.rb
Class Method Summary collapse
Class Method Details
.fetch(url, output) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/sufia/controlled_vocabulary/importer/downloader.rb', line 7 def self.fetch(url, output) open(url) do |io| IO.copy_stream(io, output) end rescue OpenURI::HTTPError => e raise "Unable to download from #{url}\n#{e.message}: #{e.io.read}" end |