chromedriver_update 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chromedriver_update/version.rb +1 -1
- data/lib/chromedriver_update.rb +11 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f80bc896506e0820d75a9ce024aea0a0069141ec9c5abc7f3dc91f79f227d9f
|
4
|
+
data.tar.gz: af1b2b07f17b299ea4e06be84ca09a5ecd5d6a19a56235d8fa5892c1a8e6ca9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4be72e197c5cea4742c6d3978f2519c4fcffc448349d90edc71b736fece56e0f0f2f2c1e13d5710d4b838ec8ffa6c7f9eb1183eb6fc87f636a66cfef0569669a
|
7
|
+
data.tar.gz: 5ab81ae391c125c1188368b3b4c67063c5c2e9e7088a493a00cc20c09180a7a09fa40c4a4d6d6249b2b60f9bc03f3915add5d51fe8b6704967f5529ebe1d8ab9
|
data/lib/chromedriver_update.rb
CHANGED
@@ -19,6 +19,7 @@ class ChromedriverUpdate
|
|
19
19
|
def self.auto_update_chromedriver(force: false)
|
20
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,13 +33,18 @@ 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)
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
unless OS.windows?
|
37
|
+
begin
|
38
|
+
FileUtils.chmod("+x", original_chromedriver_path)
|
39
|
+
`chmod +x "#{original_chromedriver_path}"`
|
40
|
+
rescue
|
39
41
|
begin
|
40
|
-
`
|
42
|
+
`chmod +x "#{original_chromedriver_path}"`
|
41
43
|
rescue
|
44
|
+
begin
|
45
|
+
`sudo chmod +x "#{original_chromedriver_path}"`
|
46
|
+
rescue
|
47
|
+
end
|
42
48
|
end
|
43
49
|
end
|
44
50
|
end
|