class IedriverDownloader

IEDriver specific functions for driver downloading.

Constants

IEDRIVER_URL

Public Class Methods

new(verbose = true) click to toggle source
Calls superclass method DriverDownloader::new
# File lib/chauffeur/downloaders/iedriver_downloader.rb, line 5
def initialize(verbose = true)
  @all_driver_versions = all_driver_versions
  super(verbose)
end

Public Instance Methods

all_driver_versions() click to toggle source

Returns all available versions of iedriver

# File lib/chauffeur/downloaders/iedriver_downloader.rb, line 32
def all_driver_versions
  resp = HTTParty.get(IEDRIVER_URL).parsed_response
  contents = resp['ListBucketResult']['Contents']
  contents.map { |c| c['Key'] }.select { |url| url.include?('IEDriverServer') }
end
all_platforms() click to toggle source
# File lib/chauffeur/downloaders/iedriver_downloader.rb, line 18
def all_platforms
  %w[Win32 x64]
end
browser_name() click to toggle source
# File lib/chauffeur/downloaders/iedriver_downloader.rb, line 10
def browser_name
  'iedriver'
end
driver_download_url(version, platform) click to toggle source

Returns the url for the desired version of iedriver version: string - must match exactly the version in the download URL platform: string - must be one of: linux32, linux64, mac32, win32

# File lib/chauffeur/downloaders/iedriver_downloader.rb, line 41
def driver_download_url(version, platform)
  raise unknown_platform_error(platform) unless valid_platform?(platform)
  rel_path = @all_driver_versions.find do |v|
    v =~ %r{#{version}/IEDriverServer_#{platform}_#{version}\.\d+\.zip}
  end
  raise unknown_version_error(version) unless rel_path
  "#{IEDRIVER_URL}#{rel_path}"
end
driver_url() click to toggle source
# File lib/chauffeur/downloaders/iedriver_downloader.rb, line 14
def driver_url
  IEDRIVER_URL
end
latest_driver_version(platform) click to toggle source

Returns the most recent version of iedriver for the desired platform. platform must be one of: linux32, linux64, mac32, win32

# File lib/chauffeur/downloaders/iedriver_downloader.rb, line 25
def latest_driver_version(platform)
  raise unknown_platform_error(platform) unless valid_platform?(platform)
  platform_drivers = @all_driver_versions.select { |v| v.include?(platform) }
  platform_drivers.map { |v| version_of(v.split('/')[0]) }.max
end