Class: Pacproxy::PacFile

Inherits:
Object
  • Object
show all
Includes:
Loggable
Defined in:
lib/pacproxy/pac_file.rb

Overview

Pacproxy::PacFile represent proxy.pac file

Class Attribute Summary collapse

Instance Method Summary collapse

Methods included from Loggable

#access_logger, #accesslog, #debug, #error, #fatal, #general_logger, #info, #lwarn

Constructor Details

#initialize(file_location, update_interval = 1800) ⇒ PacFile



16
17
18
19
# File 'lib/pacproxy/pac_file.rb', line 16

def initialize(file_location, update_interval = 1800)
  @pac = nil
  begin_update(file_location, update_interval)
end

Class Attribute Details

.js_lockObject (readonly)

Returns the value of attribute js_lock.



13
14
15
# File 'lib/pacproxy/pac_file.rb', line 13

def js_lock
  @js_lock
end

Instance Method Details

#find(uri) ⇒ Object



21
22
23
24
25
26
# File 'lib/pacproxy/pac_file.rb', line 21

def find(uri)
  return 'DIRECT' unless @pac
  PacFile.js_lock.synchronize do
    @pac.find(uri)
  end
end