class Webdrivers::IEdriver

Public Class Methods

base_url() click to toggle source

Returns url with domain for calls to get this driver.

@return [String]

# File lib/webdrivers/iedriver.rb, line 36
def base_url
  'https://selenium-release.storage.googleapis.com/'
end
current_version() click to toggle source

Returns current IEDriverServer.exe version.

@return [Gem::Version]

# File lib/webdrivers/iedriver.rb, line 14
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(/IEDriverServer.exe (\d\.\d+\.\d+)/)[1]
end
latest_version() click to toggle source

Returns latest available IEDriverServer.exe version.

@return [Gem::Version]

# File lib/webdrivers/iedriver.rb, line 28
def latest_version
  @latest_version ||= with_cache(file_name) { downloads.keys.max }
end

Private Class Methods

download_manifest() click to toggle source
# File lib/webdrivers/iedriver.rb, line 55
def download_manifest
  doc = Nokogiri::XML.parse(Network.get(base_url))
  items = doc.css('Key').collect(&:text)
  items.select { |item| item.include?('IEDriverServer_Win32') }
end
downloads() click to toggle source
# File lib/webdrivers/iedriver.rb, line 46
def downloads
  ds = download_manifest.each_with_object({}) do |item, hash|
    version = normalize_version item[/\.?([^_]+)\.zip/, 1]
    hash[version] = "#{base_url}#{item}"
  end
  Webdrivers.logger.debug "Versions now located on downloads site: #{ds.keys}"
  ds
end
file_name() click to toggle source
# File lib/webdrivers/iedriver.rb, line 42
def file_name
  'IEDriverServer.exe'
end