Sha256: 594bd8495fe10bc63893d80d5f1ce92892491a7c54258cb99eeb1f419f432cb9

Contents?: true

Size: 387 Bytes

Versions: 8

Compression:

Stored size: 387 Bytes

Contents

require 'ruby-progressbar'

module Sufia
  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

8 entries across 8 versions & 1 rubygems

Version Path
sufia-7.4.1 lib/sufia/controlled_vocabulary/importer/downloader.rb
sufia-7.4.0 lib/sufia/controlled_vocabulary/importer/downloader.rb
sufia-7.3.1 lib/sufia/controlled_vocabulary/importer/downloader.rb
sufia-7.3.0 lib/sufia/controlled_vocabulary/importer/downloader.rb
sufia-7.3.0.rc3 lib/sufia/controlled_vocabulary/importer/downloader.rb
sufia-7.3.0.rc2 lib/sufia/controlled_vocabulary/importer/downloader.rb
sufia-7.3.0.rc1 lib/sufia/controlled_vocabulary/importer/downloader.rb
sufia-7.2.0 lib/sufia/controlled_vocabulary/importer/downloader.rb