chromedriver_update 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -0
- data/.rspec +0 -0
- data/.travis.yml +0 -0
- data/CODE_OF_CONDUCT.md +0 -0
- data/Gemfile +0 -0
- data/LICENSE +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/bin/chromedriver_update +0 -0
- data/bin/console +0 -0
- data/bin/setup +0 -0
- data/chromedriver_update.gemspec +0 -0
- data/lib/chromedriver_update/version.rb +1 -1
- data/lib/chromedriver_update.rb +22 -15
- data/lib/custom_errors/chrome_not_found_error.rb +0 -0
- data/lib/custom_errors/chromedriver_not_found_error.rb +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 416da0c5fd34295e5c7c248743c7b2ba30c7c1412a2223f3fd2784447283893b
|
4
|
+
data.tar.gz: 3834bf54921a8aa790bfdb7d81845e4541f7a233e7cf3ce3e7f77c61b356c50a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14e38fc43435f98e38f495e234ff0a2217967994c6175f36c72a3fe106036d6536e23acd18536dda16a618bb2be9db26b819c4438669800d3a01852cc729bcf0
|
7
|
+
data.tar.gz: 1faf56f89eb4cc745f0bf4b50586abe1064519a4f4710d4603ef0cb00f3cc3f94243cb1a7ff54d13a7a151cc4b25e0723889fd59e7cc4b5f308ecfdff040a41d
|
data/.gitignore
CHANGED
File without changes
|
data/.rspec
CHANGED
File without changes
|
data/.travis.yml
CHANGED
File without changes
|
data/CODE_OF_CONDUCT.md
CHANGED
File without changes
|
data/Gemfile
CHANGED
File without changes
|
data/LICENSE
CHANGED
File without changes
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
data/bin/chromedriver_update
CHANGED
File without changes
|
data/bin/console
CHANGED
File without changes
|
data/bin/setup
CHANGED
File without changes
|
data/chromedriver_update.gemspec
CHANGED
File without changes
|
data/lib/chromedriver_update.rb
CHANGED
@@ -22,29 +22,36 @@ class ChromedriverUpdate
|
|
22
22
|
if installed_chrome_version.split(".").first != installed_chromedriver_version.split(".").first || force
|
23
23
|
original_chromedriver_version = installed_chromedriver_version
|
24
24
|
original_chromedriver_path = chromedriver_path
|
25
|
+
puts "Downloading chromedriver ..."
|
25
26
|
chromedriver_zip = HTTParty.get(chromedriver_link_for_version(installed_chrome_version))
|
26
27
|
if chromedriver_zip.code == 404 # fallback to latest lower version
|
27
|
-
chromedriver_zip = HTTParty.get(chromedriver_closest_link_for_version(installed_chrome_version))
|
28
28
|
puts "Could not find same chromedriver version for chrome version '#{installed_chrome_version}'. Fallback to closest version '#{installed_chrome_version}'"
|
29
|
+
puts "-> #{chromedriver_closest_link_for_version(installed_chrome_version)}"
|
30
|
+
chromedriver_zip = HTTParty.get(chromedriver_closest_link_for_version(installed_chrome_version))
|
29
31
|
else
|
30
32
|
puts "Found same chromedriver version '#{installed_chrome_version}' for chrome version '#{installed_chrome_version}'"
|
33
|
+
puts "-> #{chromedriver_link_for_version(installed_chrome_version)}"
|
31
34
|
end
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
35
|
+
Dir.mktmpdir do |destination_dir|
|
36
|
+
Zip::File.open_buffer(chromedriver_zip.body) do |zip_files|
|
37
|
+
zip_files.each do |entry|
|
38
|
+
if (entry.name.end_with?("/chromedriver") || entry.name.end_with?("/chromedriver.exe"))
|
39
|
+
download_path = File.join(destination_dir, File.basename(entry.name))
|
40
|
+
entry.extract(download_path)
|
41
|
+
FileUtils.chmod("+x", download_path)
|
42
|
+
unless File.writable?(original_chromedriver_path)
|
43
|
+
puts "Permission denied to overwrite current chromedriver. Please run the script as admin or change the file permissions of the current chromedriver."
|
44
|
+
exit 1
|
45
|
+
end
|
46
|
+
FileUtils.mv(download_path, chromedriver_path, force: true)
|
47
|
+
unless OS.windows?
|
45
48
|
begin
|
46
|
-
|
49
|
+
FileUtils.chmod("+x", original_chromedriver_path)
|
47
50
|
rescue
|
51
|
+
begin
|
52
|
+
`sudo chmod +x "#{original_chromedriver_path}"`
|
53
|
+
rescue
|
54
|
+
end
|
48
55
|
end
|
49
56
|
end
|
50
57
|
end
|
File without changes
|
File without changes
|
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.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthäus Beyrle
|
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
139
|
- !ruby/object:Gem::Version
|
140
140
|
version: '0'
|
141
141
|
requirements: []
|
142
|
-
rubygems_version: 3.
|
142
|
+
rubygems_version: 3.4.10
|
143
143
|
signing_key:
|
144
144
|
specification_version: 4
|
145
145
|
summary: Update an existing installation of chromedriver fitting to the current installed
|