Class: Geordi::ChromedriverUpdater

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

Instance Method Summary collapse

Instance Method Details

#runObject



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

def run
  chrome_version = determine_chrome_version
  chromedriver_version = determine_chromedriver_version

  if skip_update?(chrome_version, chromedriver_version)
    Interaction.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
    Interaction.note "Chromedriver updated to version #{determine_chromedriver_version}"
  end
end