Module: ProxyManager

Defined in:
lib/proxy_manager.rb,
lib/proxy_manager/main.rb

Defined Under Namespace

Classes: Main

Class Method Summary (collapse)

Class Method Details

+ (Class) load(proxies, bad_proxies = nil)

Create main object

Examples:

# from array
proxy = ProxyManager.load(['1.2.3.4:567', '9.8.7.6:543'])

# or from file
proxy = ProxyManager.load('proxies.txt', 'bad_proxies.txt')

Parameters:

  • proxies (Array, String)

    array of proxies or file with proxies

  • bad_proxies (String, nil) (defaults to: nil)

    optional file for save bad proxies

Returns:

  • (Class)

    Main object

See Also:



22
23
24
# File 'lib/proxy_manager.rb', line 22

def self.load(proxies, bad_proxies = nil)
  Main.new(proxies, bad_proxies)
end

+ (String) root

Define gem's root path

Returns:

  • (String)

    string path



7
8
9
# File 'lib/proxy_manager.rb', line 7

def self.root
  File.expand_path '../..', __FILE__
end