Sha256: 081a36754dc786f7786b8c0a5ad027673a7fba893688929944011b4301ff0103

Contents?: true

Size: 387 Bytes

Versions: 58

Compression:

Stored size: 387 Bytes

Contents

require 'ruby-progressbar'

module Hyrax
  module ControlledVocabulary
    module Importer
      class Downloader
        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
      end
    end
  end
end

Version data entries

58 entries across 58 versions & 2 rubygems

Version Path
hyrax-2.3.3 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-2.3.2 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-2.3.1 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-1.1.1 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-2.3.0 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-2.0.3 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-2.2.4 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-2.2.3 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-2.2.2 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-2.2.1 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-2.2.0 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-2.1.0 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-2.1.0.rc4 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-2.1.0.rc3 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-2.1.0.rc2 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-2.1.0.rc1 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-1.1.0 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-2.1.0.beta2 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-2.0.2 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-2.1.0.beta1 lib/hyrax/controlled_vocabulary/importer/downloader.rb