Sha256: 349cddc401be8619f97cca45c71b4ff7149ba63e5db1200ef84ca2e1beaa3e18

Contents?: true

Size: 417 Bytes

Versions: 29

Compression:

Stored size: 417 Bytes

Contents

# frozen_string_literal: true
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

29 entries across 29 versions & 1 rubygems

Version Path
hyrax-5.1.0.pre.beta1 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-5.0.4 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-5.0.3 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-5.0.2 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-5.0.1 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-5.0.0 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-5.0.0.rc3 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-5.0.0.rc2 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-5.0.0.rc1 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-3.6.0 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-4.0.0 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-4.0.0.rc3 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-4.0.0.rc2 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-4.0.0.rc1 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-3.5.0 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-4.0.0.beta2 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-3.4.2 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-4.0.0.beta1 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-3.4.1 lib/hyrax/controlled_vocabulary/importer/downloader.rb
hyrax-3.4.0 lib/hyrax/controlled_vocabulary/importer/downloader.rb