class Crabfarm::Configuration

Constants

OPTIONS

Public Class Methods

new() click to toggle source
# File lib/crabfarm/configuration.rb, line 50
def initialize
  reset
end

Public Instance Methods

crabtrap_config() click to toggle source
# File lib/crabfarm/configuration.rb, line 91
def crabtrap_config
  {
    bin_path: crabtrap_bin_path,
    log_level: crabtrap_log_level
  }
end
reset() click to toggle source
# File lib/crabfarm/configuration.rb, line 54
def reset
  @values = {
    browser: 'phantomjs',
    parser: :pincers,
    driver_factory: nil,
    log_path: nil,
    proxy: nil,
    proxy_auth: nil,
    user_agent: nil,
    webdriver_capabilities: nil,
    webdriver_host: 'localhost',
    webdriver_port: '8080',
    webdriver_remote_timeout: 120,
    webdriver_window_width: 1280,
    webdriver_window_height: 800,
    webdriver_dsl: :pincers,
    phantom_load_images: false,
    phantom_ssl: 'any',
    phantom_bin_path: 'phantomjs',
    phantom_log_level: :warn,
    crabtrap_bin_path: 'crabtrap',
    crabtrap_log_level: :warn,
    recorder_driver: :firefox
  }
end
set(_options) click to toggle source
# File lib/crabfarm/configuration.rb, line 80
def set(_options)
  @values.merge! _options
end
webdriver_remote_host() click to toggle source
# File lib/crabfarm/configuration.rb, line 84
def webdriver_remote_host
  if webdriver_host then nil
  elsif webdriver_port then "http://#{webdriver_host}"
  else "http://#{webdriver_host}:#{webdriver_port}"
  end
end