Class: Geordi::ChromedriverUpdater

Inherits:
Object
  • Object
show all
Includes:
Interaction
Defined in:
lib/geordi/chromedriver_updater.rb

Instance Method Summary collapse

Methods included from Interaction

#announce, #fail, #note, #note_cmd, #prompt, #strip_heredoc, #success, #warn

Instance Method Details

#runObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/geordi/chromedriver_updater.rb', line 9

def run
  chrome_version = determine_chrome_version
  chromedriver_version = determine_chromedriver_version

  if skip_update?(chrome_version, chromedriver_version)
    warn("No update required, you are using for both executables the same version #{chrome_version}!")
  else
    chromedriver_zip = download_chromedriver(chrome_version)
    unzip(chromedriver_zip, File.expand_path('~/bin'))

    chromedriver_zip.unlink

    # We need to determine the version again, as it could be nil in case no chromedriver was installed before
    note "Chromedriver updated to version #{determine_chromedriver_version}"
  end
end