Sha256: 7f1dd3fdea3253325d3fd4687bece4d0abe50c9650d8e59a3808cd89f8398e9c

Contents?: true

Size: 397 Bytes

Versions: 24

Compression:

Stored size: 397 Bytes

Contents

# frozen_string_literal: true
require 'excon'

# ProxyRb
module ProxyRb
  # Download Content via proxy
  class HttpDownloader
    private

    attr_reader :downloader, :proxy

    public

    def initialize(proxy)
      @downloader = Excon
      @proxy      = proxy
    end

    def process(resource)
      resource.content = downloader.get(resource.to_uri, proxy: proxy.to_uri)
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
proxy_rb-1.0.0 lib/proxy_rb/http_downloader.rb
proxy_rb-0.10.6 lib/proxy_rb/http_downloader.rb
proxy_rb-0.10.5 lib/proxy_rb/http_downloader.rb
proxy_rb-0.10.4 lib/proxy_rb/http_downloader.rb
proxy_rb-0.10.3 lib/proxy_rb/http_downloader.rb
proxy_rb-0.10.2 lib/proxy_rb/http_downloader.rb
proxy_rb-0.10.1 lib/proxy_rb/http_downloader.rb
proxy_rb-0.10.0 lib/proxy_rb/http_downloader.rb
proxy_rb-0.9.3 lib/proxy_rb/http_downloader.rb
proxy_rb-0.9.2 lib/proxy_rb/http_downloader.rb
proxy_rb-0.9.1 lib/proxy_rb/http_downloader.rb
proxy_rb-0.9.0 lib/proxy_rb/http_downloader.rb
proxy_rb-0.8.3 lib/proxy_rb/http_downloader.rb
proxy_rb-0.8.2 lib/proxy_rb/http_downloader.rb
proxy_rb-0.8.1 lib/proxy_rb/http_downloader.rb
proxy_rb-0.8.0 lib/proxy_rb/http_downloader.rb
proxy_rb-0.7.1 lib/proxy_rb/http_downloader.rb
proxy_rb-0.7.0 lib/proxy_rb/http_downloader.rb
proxy_rb-0.6.0 lib/proxy_rb/http_downloader.rb
proxy_rb-0.5.0 lib/proxy_rb/http_downloader.rb