Module: Webdrivers

Defined in:
lib/webdrivers/logger.rb,
lib/webdrivers/common.rb,
lib/webdrivers/system.rb,
lib/webdrivers/network.rb,
lib/webdrivers/railtie.rb,
lib/webdrivers/version.rb,
lib/webdrivers/iedriver.rb,
lib/webdrivers/edgedriver.rb,
lib/webdrivers/edge_finder.rb,
lib/webdrivers/geckodriver.rb,
lib/webdrivers/chromedriver.rb,
lib/webdrivers/chrome_finder.rb

Overview

Defined Under Namespace

Classes: BrowserNotFound, ChromeFinder, Chromedriver, Common, ConnectionError, EdgeFinder, Edgedriver, Geckodriver, IEdriver, Logger, Network, NetworkError, Railtie, System, VersionError

Constant Summary collapse

DEFAULT_CACHE_TIME =

24 hours

86_400
DEFAULT_INSTALL_DIR =
File.expand_path('~/.webdrivers')
VERSION =
'4.6.1'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.cache_timeObject

Note:

Value from the environment variable “WD_CACHE_TIME” takes precedence over Webdrivers.cache_time. If neither

Returns the amount of time (Seconds) the gem waits between two update checks. are set, it defaults to 86,400 Seconds (24 hours).



35
36
37
38
# File 'lib/webdrivers/common.rb', line 35

def cache_time
  @cache_time ||= (ENV['WD_CACHE_TIME'] || DEFAULT_CACHE_TIME)
  @cache_time.to_i
end

.install_dirString

Returns the install (download) directory path for the drivers.

Returns:

  • (String)


44
45
46
# File 'lib/webdrivers/common.rb', line 44

def install_dir
  @install_dir ||= ENV['WD_INSTALL_DIR'] || DEFAULT_INSTALL_DIR
end

.proxy_addrObject

Returns the value of attribute proxy_addr.



27
28
29
# File 'lib/webdrivers/common.rb', line 27

def proxy_addr
  @proxy_addr
end

.proxy_passObject

Returns the value of attribute proxy_pass.



27
28
29
# File 'lib/webdrivers/common.rb', line 27

def proxy_pass
  @proxy_pass
end

.proxy_portObject

Returns the value of attribute proxy_port.



27
28
29
# File 'lib/webdrivers/common.rb', line 27

def proxy_port
  @proxy_port
end

.proxy_userObject

Returns the value of attribute proxy_user.



27
28
29
# File 'lib/webdrivers/common.rb', line 27

def proxy_user
  @proxy_user
end

Class Method Details

.configure {|_self| ... } ⇒ Object

Provides a convenient way to configure the gem.

Examples:

Configure proxy and cache_time

Webdrivers.configure do |config|
  config.proxy_addr = 'myproxy_address.com'
  config.proxy_port = '8080'
  config.proxy_user = 'username'
  config.proxy_pass = 'password'
  config.cache_time = 604_800 # 7 days
end

Yields:

  • (_self)

Yield Parameters:

  • _self (Webdrivers)

    the object that the method was called on



64
65
66
# File 'lib/webdrivers/common.rb', line 64

def configure
  yield self
end

.loggerObject



48
49
50
# File 'lib/webdrivers/common.rb', line 48

def logger
  @logger ||= Webdrivers::Logger.new
end

.net_http_ssl_fixObject



68
69
70
71
# File 'lib/webdrivers/common.rb', line 68

def net_http_ssl_fix
  raise 'Webdrivers.net_http_ssl_fix is no longer available.' \
  ' Please see https://github.com/titusfortner/webdrivers#ssl_connect-errors.'
end