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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 04a4622ec34d79f073ced2fe22dd338254dbafe2b45298fbb6b8fdfca7f21a9d
4
- data.tar.gz: c6204961bdb9f72f32004f4bb297e726bc29918a08cb009180792ead9ff70bbd
3
+ metadata.gz: 1a692227e492aa71eef9d98f686af91343c55bf33ca1dd94ffc8ed676477bada
4
+ data.tar.gz: 932c93437c817f28e6aa76ce635e404af61fcffccc7c3e34a38b7cc617c2b677
5
5
  SHA512:
6
- metadata.gz: 3f6283ebe5be5e92293eb9e63ddcc081d8e9eb666f42d8590ae9af4d045bad321ceaf271e41c07c47476d0b79df86a70df69976d3d68ade6e3ad4d902391bdf9
7
- data.tar.gz: ad585cdbeb39dc74e3ab4ed710957804bf62a7d73692ff4f187e9cad788b95d819d1c9ca12be71c47183ef606dba8e607f155806e8253e9abb27fe26cb493063
6
+ metadata.gz: 720cb831b5a5736c388519fe97d12be36a36ce4cc78665f54149a2b7a4801709e2db7abf09dabaaf9d1c57dff957bcbb9ee3882ee709a9fe5657ea2d16c1464f
7
+ data.tar.gz: d461a29c79912443e7cf7017b8f6e1f78a871f9f4f19ad34b94c361741a30f4ec84a7cdd1d14d5d68f06759136c6937b2196afd144910bbe54aff209fdcc9c8d
@@ -1,3 +1,3 @@
1
1
  class ChromedriverUpdate
2
- VERSION = '0.1.6'.freeze
2
+ VERSION = '0.1.8'.freeze
3
3
  end
@@ -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}/mac-arm64/chromedriver-mac-arm64.zip"
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
- "mac-arm64"
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
  #
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.6
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthäus Beyrle