Sha256: 6d0c881e79850019d24e44565adc63fb9363d095ddf388e28358d042aa92245e

Contents?: true

Size: 735 Bytes

Versions: 11

Compression:

Stored size: 735 Bytes

Contents

# encoding: utf-8
module LocalPac
  module ProxyPac
    class PACEngine
      private

      attr_reader :engine, :file

      public

      def initialize(options = {})
        @file = options.fetch(:file)
        @engine = PAC
      rescue KeyError
        fail ArgumentError, ":file-option is missing"
      end

      def find(uri)
        e = engine.source(file.content)
        e.find(uri)
      rescue V8::Error, PAC::ProgramError => err
        error_id = LocalPac.error_id
        LocalPac.ui_logger.fatal "Error id \"#{error_id}\": An V8::Error occured. This can happen if compiling a proxy.pac fails. The V8::Error-message was: #{err.message}."
        fail Exceptions::PacFileInvalid, error_id 
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
local_pac-0.6.3 lib/local_pac/proxy_pac/pac_engine.rb
local_pac-0.6.2 lib/local_pac/proxy_pac/pac_engine.rb
local_pac-0.6.1 lib/local_pac/proxy_pac/pac_engine.rb
local_pac-0.5.0 lib/local_pac/proxy_pac/pac_engine.rb
local_pac-0.4.0 lib/local_pac/proxy_pac/pac_engine.rb
local_pac-0.3.0 lib/local_pac/proxy_pac/pac_engine.rb
local_pac-0.2.3 lib/local_pac/proxy_pac/pac_engine.rb
local_pac-0.2.2 lib/local_pac/proxy_pac/pac_engine.rb
local_pac-0.2.1 lib/local_pac/proxy_pac/pac_engine.rb
local_pac-0.2.0 lib/local_pac/proxy_pac/pac_engine.rb
local_pac-0.1.13 lib/local_pac/proxy_pac/pac_engine.rb