Sha256: a0dc12a7a54aebacc582ee24a8bcc38f78860907e88d248f91f780fffce8cbcf

Contents?: true

Size: 374 Bytes

Versions: 11

Compression:

Stored size: 374 Bytes

Contents

module ProxyPacRb
  class File

    private

    attr_reader :javascript

    public

    def initialize(javascript)
      @javascript  = javascript
    end

    def find(url)
      uri = Addressable::URI.heuristic_parse(url)
      fail Exceptions::UrlInvalid, "url is missing host" unless uri.host

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
proxy_pac_rb-0.3.4 lib/proxy_pac_rb/file.rb
proxy_pac_rb-0.3.3 lib/proxy_pac_rb/file.rb
proxy_pac_rb-0.3.2 lib/proxy_pac_rb/file.rb
proxy_pac_rb-0.3.0 lib/proxy_pac_rb/file.rb
proxy_pac_rb-0.2.6 lib/proxy_pac_rb/file.rb
proxy_pac_rb-0.2.5 lib/proxy_pac_rb/file.rb
proxy_pac_rb-0.2.4 lib/proxy_pac_rb/file.rb
proxy_pac_rb-0.2.3 lib/proxy_pac_rb/file.rb
proxy_pac_rb-0.2.2 lib/proxy_pac_rb/file.rb
proxy_pac_rb-0.2.1 lib/proxy_pac_rb/file.rb
proxy_pac_rb-0.2.0 lib/proxy_pac_rb/file.rb