chromedriver_update 0.2.0 → 0.2.2

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: 8f80bc896506e0820d75a9ce024aea0a0069141ec9c5abc7f3dc91f79f227d9f
4
- data.tar.gz: af1b2b07f17b299ea4e06be84ca09a5ecd5d6a19a56235d8fa5892c1a8e6ca9a
3
+ metadata.gz: 0141f9db05682ab698a7ac847cb5a960fa28236225d07cb46ad2af99e466d520
4
+ data.tar.gz: c63f8be776d8f33ccd1ed90584b92ef40479e445c146625f17029ab77faff1cc
5
5
  SHA512:
6
- metadata.gz: 4be72e197c5cea4742c6d3978f2519c4fcffc448349d90edc71b736fece56e0f0f2f2c1e13d5710d4b838ec8ffa6c7f9eb1183eb6fc87f636a66cfef0569669a
7
- data.tar.gz: 5ab81ae391c125c1188368b3b4c67063c5c2e9e7088a493a00cc20c09180a7a09fa40c4a4d6d6249b2b60f9bc03f3915add5d51fe8b6704967f5529ebe1d8ab9
6
+ metadata.gz: f9c74fa3e032e40a2380c54c52e71d86f32d112304b1ec9dda99e4c0296540d00167687456c0b31fc72c38479eade4babe0cc905ef9ecd490401a121dd0b5f27
7
+ data.tar.gz: 2863caee050a8e8813d2d0b0eab83c464ed1acc661cdb3420473509a2b6394031393effb7513db08fe0f79c4e583b698a08a216cc4e0b3de253cae749ebc54a1
@@ -6,17 +6,19 @@ arg = ARGV[0]
6
6
 
7
7
  if %w[version -v --version].include?(arg)
8
8
  puts "#{ChromedriverUpdate::VERSION}"
9
- elsif arg.nil? || arg == ''
10
- ChromedriverUpdate.auto_update_chromedriver
9
+ elsif arg.nil? || arg == '' || %w[force -f --force].include?(arg)
10
+ force = %w[force -f --force].include?(arg)
11
+ ChromedriverUpdate.auto_update_chromedriver force: force
11
12
  else
12
13
  puts <<-TEXT
13
14
 
14
15
  chromedriver_update #{ChromedriverUpdate::VERSION}
15
16
  https://github.com/magynhard/chromedriver_update
16
17
 
18
+ chromedriver_update # automatically update the current chromedriver version fitting to the currently installed chrome
19
+ chromedriver_update -f --force # force automatic update, even if the latest version is already installed
17
20
  chromedriver_update -h --help # show this info
18
21
  chromedriver_update -v --version # show the libraries current version
19
- chromedriver_update # automatically update the current chromedriver version fitting to the currently installed chrome
20
22
 
21
23
  TEXT
22
24
  end
@@ -1,3 +1,3 @@
1
1
  class ChromedriverUpdate
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.2'.freeze
3
3
  end
@@ -16,6 +16,8 @@ class ChromedriverUpdate
16
16
  #
17
17
  # Update the installed version of chromedriver automatically fitting to the currently installed version of chrome
18
18
  #
19
+ # @param [Boolean] force=false force the update, even if the version is already installed
20
+ #
19
21
  def self.auto_update_chromedriver(force: false)
20
22
  if installed_chrome_version.split(".").first != installed_chromedriver_version.split(".").first || force
21
23
  original_chromedriver_version = installed_chromedriver_version
@@ -36,15 +38,10 @@ class ChromedriverUpdate
36
38
  unless OS.windows?
37
39
  begin
38
40
  FileUtils.chmod("+x", original_chromedriver_path)
39
- `chmod +x "#{original_chromedriver_path}"`
40
41
  rescue
41
42
  begin
42
- `chmod +x "#{original_chromedriver_path}"`
43
+ `sudo chmod +x "#{original_chromedriver_path}"`
43
44
  rescue
44
- begin
45
- `sudo chmod +x "#{original_chromedriver_path}"`
46
- rescue
47
- end
48
45
  end
49
46
  end
50
47
  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.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthäus Beyrle