Class: Webdrivers::Chromedriver
- Defined in:
- lib/webdrivers/chromedriver.rb
Class Method Summary collapse
-
.chrome_version ⇒ Object
Returns currently installed Chrome version.
- .current_version ⇒ Object
- .latest_version ⇒ Object
Methods inherited from Common
binary, desired_version, download, driver_path, remove, update, version, version=
Class Method Details
.chrome_version ⇒ Object
Returns currently installed Chrome version
33 34 35 36 37 38 39 40 |
# File 'lib/webdrivers/chromedriver.rb', line 33 def chrome_version ver = send("chrome_on_#{System.platform}").chomp raise VersionError, 'Failed to find Chrome binary or its version.' if ver.nil? || ver.empty? Webdrivers.logger.debug "Browser version: #{ver}" normalize_version ver[/\d+\.\d+\.\d+\.\d+/] # Google Chrome 73.0.3683.75 -> 73.0.3683.75 end |
.current_version ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/webdrivers/chromedriver.rb', line 9 def current_version Webdrivers.logger.debug 'Checking current version' return nil unless exists? version = binary_version return nil if version.nil? # Matches 2.46, 2.46.628411 and 73.0.3683.75 normalize_version version[/\d+\.\d+(\.\d+)?(\.\d+)?/] end |
.latest_version ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/webdrivers/chromedriver.rb', line 20 def latest_version @latest_version ||= begin # Versions before 70 do not have a LATEST_RELEASE file return normalize_version('2.41') if release_version < normalize_version('70') latest_applicable = with_cache(file_name) { latest_point_release(release_version) } Webdrivers.logger.debug "Latest version available: #{latest_applicable}" normalize_version(latest_applicable) end end |