Module: HttpProxyPool

Defined in:
lib/http_proxy_pool.rb,
lib/http_proxy_pool/error.rb,
lib/http_proxy_pool/proxy.rb,
lib/http_proxy_pool/utils.rb,
lib/http_proxy_pool/version.rb,
lib/http_proxy_pool/basetask.rb,
lib/http_proxy_pool/proxy_pool.rb

Defined Under Namespace

Classes: BaseError, Basetask, Proxy, ProxyPool, QueryError, ScriptError, TaskError

Constant Summary collapse

VERSION =
'0.0.1'

Class Method Summary collapse

Class Method Details

.homeObject



19
20
21
# File 'lib/http_proxy_pool/utils.rb', line 19

def home
  @home
end

.init_default_scriptObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/http_proxy_pool/utils.rb', line 6

def init_default_script
  
  target_dir = Dir.new(@script_path)

  src_dir = File.join(File.dirname(__FILE__), 'example')
  Dir.entries(src_dir).each do |src|
    next unless src.end_with? '.site'

    FileUtils.cp File.join(src_dir, src),
                target_dir.path unless target_dir.include? src
  end
end

.loggerObject



27
28
29
# File 'lib/http_proxy_pool/utils.rb', line 27

def logger
  @logger
end

.script_pathObject



23
24
25
# File 'lib/http_proxy_pool/utils.rb', line 23

def script_path
  @script_path
end