class Quke::ProxyConfiguration

Manages all parallel configuration for Quke.

Attributes

host[R]

The host address for the proxy server

no_proxy[R]

In some cases you may also need to tell the driver not to use the proxy for local or specific connections. This returns a comma separated list of addresses of those addresses if set.

port[R]

The port number for the proxy server

Public Class Methods

new(data = {}) click to toggle source
# File lib/quke/proxy_configuration.rb, line 19
def initialize(data = {})
  @host = (data["host"] || "").downcase.strip
  @port = (data["port"] || "0").to_s.downcase.strip.to_i
  @no_proxy = (data["no_proxy"] || "").downcase.strip
end

Public Instance Methods

firefox_settings() click to toggle source

Returns a hash of settings specific to initialising a Selenium::WebDriver::Proxy instance, which will be created as part of registering the Selenium firefox driver

# File lib/quke/proxy_configuration.rb, line 37
def firefox_settings
  settings = {}
  return settings unless use_proxy?

  settings[:http] = "#{host}:#{port}"
  settings[:ssl] = settings[:http]
  settings[:no_proxy] = no_proxy unless no_proxy.empty?

  settings
end
use_proxy?() click to toggle source

Return true if the host value has been set in the .config.yml file, else false.

It is mainly used when determining whether to apply proxy server settings to the different drivers when registering them with Capybara.

# File lib/quke/proxy_configuration.rb, line 30
def use_proxy?
  @host != ""
end