Class: Webdrivers::Geckodriver

Inherits:
Common
  • Object
show all
Defined in:
lib/webdrivers/geckodriver.rb

Class Method Summary collapse

Methods inherited from Common

binary, desired_version, download, driver_path, remove, update, version, version=

Class Method Details

.current_versionGem::Version

Returns current geckodriver version.

Returns:

  • (Gem::Version)

13
14
15
16
17
18
19
20
21
# File 'lib/webdrivers/geckodriver.rb', line 13

def current_version
  Webdrivers.logger.debug 'Checking current version'
  return nil unless exists?

  version = binary_version
  return nil if version.nil?

  normalize_version version.match(/geckodriver (\d+\.\d+\.\d+)/)[1]
end

.latest_versionGem::Version

Returns latest available geckodriver version.

Returns:

  • (Gem::Version)

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

def latest_version
  @latest_version ||= with_cache(file_name) { normalize_version(Network.get_url("#{base_url}/latest")[/[^v]*$/]) }
end