Sha256: 61c8ad9eb3c7a106a6162b5466212810dc9e69dcd61eb37e231002b49f7bee40

Contents?: true

Size: 436 Bytes

Versions: 2

Compression:

Stored size: 436 Bytes

Contents

module ProxyPacRb
  # Proxy pac file
  class ProxyPac
    private

    attr_reader :javascript

    public

    attr_reader :file

    def initialize(javascript:, file:)
      @javascript = javascript
      @file       = file
    end

    def find(url)
      uri = Addressable::URI.heuristic_parse(url)
      fail UrlInvalidError, 'url is missing host' unless uri.host

      javascript.FindProxyForURL(url, uri.host)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
proxy_pac_rb-0.4.2 lib/proxy_pac_rb/proxy_pac.rb
proxy_pac_rb-0.4.0 lib/proxy_pac_rb/proxy_pac.rb