chromedriver_update 0.1.8 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a692227e492aa71eef9d98f686af91343c55bf33ca1dd94ffc8ed676477bada
4
- data.tar.gz: 932c93437c817f28e6aa76ce635e404af61fcffccc7c3e34a38b7cc617c2b677
3
+ metadata.gz: 8f80bc896506e0820d75a9ce024aea0a0069141ec9c5abc7f3dc91f79f227d9f
4
+ data.tar.gz: af1b2b07f17b299ea4e06be84ca09a5ecd5d6a19a56235d8fa5892c1a8e6ca9a
5
5
  SHA512:
6
- metadata.gz: 720cb831b5a5736c388519fe97d12be36a36ce4cc78665f54149a2b7a4801709e2db7abf09dabaaf9d1c57dff957bcbb9ee3882ee709a9fe5657ea2d16c1464f
7
- data.tar.gz: d461a29c79912443e7cf7017b8f6e1f78a871f9f4f19ad34b94c361741a30f4ec84a7cdd1d14d5d68f06759136c6937b2196afd144910bbe54aff209fdcc9c8d
6
+ metadata.gz: 4be72e197c5cea4742c6d3978f2519c4fcffc448349d90edc71b736fece56e0f0f2f2c1e13d5710d4b838ec8ffa6c7f9eb1183eb6fc87f636a66cfef0569669a
7
+ data.tar.gz: 5ab81ae391c125c1188368b3b4c67063c5c2e9e7088a493a00cc20c09180a7a09fa40c4a4d6d6249b2b60f9bc03f3915add5d51fe8b6704967f5529ebe1d8ab9
@@ -1,3 +1,3 @@
1
1
  class ChromedriverUpdate
2
- VERSION = '0.1.8'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
@@ -16,9 +16,10 @@ class ChromedriverUpdate
16
16
  #
17
17
  # Update the installed version of chromedriver automatically fitting to the currently installed version of chrome
18
18
  #
19
- def self.auto_update_chromedriver
20
- if installed_chrome_version.split(".").first != installed_chromedriver_version.split(".").first
19
+ def self.auto_update_chromedriver(force: false)
20
+ if installed_chrome_version.split(".").first != installed_chromedriver_version.split(".").first || force
21
21
  original_chromedriver_version = installed_chromedriver_version
22
+ original_chromedriver_path = chromedriver_path
22
23
  chromedriver_zip = HTTParty.get(chromedriver_link_for_version(installed_chrome_version))
23
24
  if chromedriver_zip.code == 404 # fallback to latest lower version
24
25
  chromedriver_zip = HTTParty.get(chromedriver_closest_link_for_version(installed_chrome_version))
@@ -32,6 +33,21 @@ class ChromedriverUpdate
32
33
  FileUtils.rm_f(download_path)
33
34
  entry.extract(download_path)
34
35
  FileUtils.mv(download_path, chromedriver_path, force: true)
36
+ unless OS.windows?
37
+ begin
38
+ FileUtils.chmod("+x", original_chromedriver_path)
39
+ `chmod +x "#{original_chromedriver_path}"`
40
+ rescue
41
+ begin
42
+ `chmod +x "#{original_chromedriver_path}"`
43
+ rescue
44
+ begin
45
+ `sudo chmod +x "#{original_chromedriver_path}"`
46
+ rescue
47
+ end
48
+ end
49
+ end
50
+ end
35
51
  end
36
52
  end
37
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chromedriver_update
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthäus Beyrle