chromedriver_update 0.1.6 → 0.1.8
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 +15 -2
- 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: 1a692227e492aa71eef9d98f686af91343c55bf33ca1dd94ffc8ed676477bada
|
4
|
+
data.tar.gz: 932c93437c817f28e6aa76ce635e404af61fcffccc7c3e34a38b7cc617c2b677
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 720cb831b5a5736c388519fe97d12be36a36ce4cc78665f54149a2b7a4801709e2db7abf09dabaaf9d1c57dff957bcbb9ee3882ee709a9fe5657ea2d16c1464f
|
7
|
+
data.tar.gz: d461a29c79912443e7cf7017b8f6e1f78a871f9f4f19ad34b94c361741a30f4ec84a7cdd1d14d5d68f06759136c6937b2196afd144910bbe54aff209fdcc9c8d
|
data/lib/chromedriver_update.rb
CHANGED
@@ -24,6 +24,7 @@ class ChromedriverUpdate
|
|
24
24
|
chromedriver_zip = HTTParty.get(chromedriver_closest_link_for_version(installed_chrome_version))
|
25
25
|
end
|
26
26
|
destination_dir = File.expand_path(File.dirname(__FILE__) + "/../tmp")
|
27
|
+
FileUtils.mkdir_p destination_dir
|
27
28
|
Zip::File.open_buffer(chromedriver_zip.body) do |zip_files|
|
28
29
|
zip_files.each do |entry|
|
29
30
|
if (entry.name.end_with?("/chromedriver") || entry.name.end_with?("/chromedriver.exe"))
|
@@ -80,7 +81,7 @@ class ChromedriverUpdate
|
|
80
81
|
if OS.windows?
|
81
82
|
"https://storage.googleapis.com/chrome-for-testing-public/#{version}/win64/chromedriver-win64.zip"
|
82
83
|
elsif OS.mac?
|
83
|
-
"https://storage.googleapis.com/chrome-for-testing-public/#{version}/
|
84
|
+
"https://storage.googleapis.com/chrome-for-testing-public/#{version}/#{mac_platform}/chromedriver-mac-arm64.zip"
|
84
85
|
else
|
85
86
|
"https://storage.googleapis.com/chrome-for-testing-public/#{version}/linux64/chromedriver-linux64.zip"
|
86
87
|
end
|
@@ -96,7 +97,7 @@ class ChromedriverUpdate
|
|
96
97
|
platform = if OS.windows?
|
97
98
|
"win64"
|
98
99
|
elsif OS.mac?
|
99
|
-
|
100
|
+
mac_platform
|
100
101
|
else
|
101
102
|
"linux64"
|
102
103
|
end
|
@@ -105,6 +106,18 @@ class ChromedriverUpdate
|
|
105
106
|
latest_match['downloads']['chromedriver'].filter { |el| el['platform'] == platform }.first['url']
|
106
107
|
end
|
107
108
|
|
109
|
+
#
|
110
|
+
# Detect macOS platform
|
111
|
+
#
|
112
|
+
# @return [String] platform for macos
|
113
|
+
def self.mac_platform
|
114
|
+
if RUBY_PLATFORM.include?("x86") || RUBY_PLATFORM.include?("x64")
|
115
|
+
'mac-x64'
|
116
|
+
else
|
117
|
+
'mac-arm64'
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
108
121
|
#
|
109
122
|
# Get the path of the installed chromedriver
|
110
123
|
#
|