webdrivers 3.9.0 → 3.9.1

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
  SHA1:
3
- metadata.gz: bee44be9b5854e4de983328db68fd8735a0a7587
4
- data.tar.gz: 8dede2a2bd5446c2cd58df1485fd5db8dffeedea
3
+ metadata.gz: 6403a589e0c784d0b04a94c3b108c7d44fe062c2
4
+ data.tar.gz: 7956cc9a314eba3ec964e14a531d1aa97ac15aaa
5
5
  SHA512:
6
- metadata.gz: bbbc24fb35b58c3b161f7b09d5a662f73f004f88e28bc6222ea80fa8ffb6df3cda648376462491e9e39835420ea4e057d958028701aa2529dd2bae2cd2c587ca
7
- data.tar.gz: 8f1bd1cbcbddb25e27ffc73e35c6da979fe1fa7805254782a00d70c35da3daa0a41ef42e266f8322d129634ae64aee8987e54b0dfdcee995c30514121f876e4f
6
+ metadata.gz: ce9aa170e3e2d314c0f72d0eec6067df137575979276025ab7148c73b6d9242abb2f33815e330907ee7ca00e278f07cbc4af6a3fb1bfb8331bb7d2feeacc3d8c
7
+ data.tar.gz: 5d10f4f1194ede57d231b1c0c2be18f8370d1d08a2f5a812066236ef12e8e6e77654bf361fd9d5d3ab3d19bb8b475455d40ef34389b4a75e3b02b02f6e07a055
@@ -1,3 +1,7 @@
1
+ ### 3.9.1 (2019-05-09)
2
+ * Fix bug throwing nil warnings (issue #107)
3
+ * Fix bug preventing running on older versions of Selenium
4
+
1
5
  ### 3.9.0 (2019-05-07)
2
6
  * Make public methods more obvious and deprecate unnecessary methods (issue #36)
3
7
  * Allow geckodriver binaries to be downloaded directly (issue #30)
data/README.md CHANGED
@@ -29,6 +29,8 @@ require 'webdrivers'
29
29
  The drivers will now be automatically downloaded or updated when you launch a browser
30
30
  through Selenium.
31
31
 
32
+ ### Specific Drivers
33
+
32
34
  If you want webdrivers to only manage specific drivers you can specify as follows:
33
35
  ```ruby
34
36
  require 'webdrivers/chromedriver'
@@ -68,6 +70,15 @@ You can explicitly trigger the update in your code, but this will happen automat
68
70
  Webdrivers::Chromedriver.update
69
71
  ```
70
72
 
73
+ ### Caching Drivers
74
+
75
+ You can set Webdrivers to only look for updates if the previous check was longer ago than a specified number of seconds.
76
+ ```ruby
77
+ Webdrivers.cache_time = 86_400
78
+ ```
79
+
80
+ The default in 3.9 is zero, and the default for 4.x will be 24 hours (86,400 seconds)
81
+
71
82
  ### Proxy
72
83
 
73
84
  If there is a proxy between you and the Internet then you will need to configure
@@ -67,7 +67,7 @@ module Webdrivers
67
67
  def download_url
68
68
  return @download_url if @download_url
69
69
 
70
- version = if required_version.version.empty?
70
+ version = if required_version == EMPTY_VERSION
71
71
  latest_version
72
72
  else
73
73
  normalize_version(required_version)
@@ -71,7 +71,7 @@ end
71
71
  new = "#{self.class}#required_version or #{self.class}#latest_version"
72
72
  Webdrivers.logger.deprecate(old, new)
73
73
 
74
- desired_version.version.empty? ? latest_version : normalize_version(desired_version)
74
+ desired_version == EMPTY_VERSION ? latest_version : normalize_version(desired_version)
75
75
  end
76
76
 
77
77
  def remove
@@ -98,7 +98,7 @@ end
98
98
  private
99
99
 
100
100
  def download_url
101
- @download_url ||= if required_version.version.empty?
101
+ @download_url ||= if required_version == EMPTY_VERSION
102
102
  downloads[downloads.keys.max]
103
103
  else
104
104
  downloads[normalize_version(required_version)]
@@ -110,7 +110,7 @@ end
110
110
  end
111
111
 
112
112
  def correct_binary?
113
- current_version == if required_version.version.empty?
113
+ current_version == if required_version == EMPTY_VERSION
114
114
  latest_version
115
115
  else
116
116
  normalize_version(required_version)
@@ -124,7 +124,7 @@ end
124
124
  end
125
125
 
126
126
  def normalize_version(version)
127
- Gem::Version.new(version&.to_s)
127
+ Gem::Version.new(version.to_s)
128
128
  end
129
129
 
130
130
  def binary_version
@@ -150,6 +150,8 @@ end
150
150
  normalize_version version
151
151
  end
152
152
  end
153
+
154
+ EMPTY_VERSION = Gem::Version.new('')
153
155
  end
154
156
  end
155
157
  end
@@ -31,7 +31,11 @@ module Webdrivers
31
31
  end
32
32
 
33
33
  def download_url
34
- @download_url ||= required_version.version.empty? ? direct_url(latest_version) : direct_url(required_version)
34
+ @download_url ||= if required_version == EMPTY_VERSION
35
+ direct_url(latest_version)
36
+ else
37
+ direct_url(required_version)
38
+ end
35
39
  end
36
40
 
37
41
  def direct_url(version)
@@ -13,7 +13,7 @@ end
13
13
  module Selenium
14
14
  module WebDriver
15
15
  module Edge
16
- if Selenium::WebDriver::VERSION > '3.141.0'
16
+ if defined?(Selenium::WebDriver::VERSION) && Selenium::WebDriver::VERSION > '3.141.0'
17
17
  class Service < WebDriver::Service
18
18
  class << self
19
19
  alias se_driver_path driver_path
@@ -8,7 +8,7 @@ describe Webdrivers::MSWebdriver do
8
8
  it 'gives deprecation for using it' do
9
9
  msg = /WARN Webdrivers Microsoft WebDriver for the Edge browser is no longer supported by Webdrivers gem/
10
10
 
11
- if Selenium::WebDriver::VERSION > '3.141.0'
11
+ if defined?(Selenium::WebDriver::VERSION) && Selenium::WebDriver::VERSION > '3.141.0'
12
12
  expect { Selenium::WebDriver::Edge::Service.driver_path }.to output(msg).to_stdout_from_any_process
13
13
  else
14
14
  expect { Selenium::WebDriver::Edge.driver_path }.to output(msg).to_stdout_from_any_process
@@ -4,7 +4,7 @@ $LOAD_PATH.push File.expand_path('../lib', __dir__)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'webdrivers'
7
- s.version = '3.9.0'
7
+ s.version = '3.9.1'
8
8
  s.authors = ['Titus Fortner', 'Lakshya Kapoor']
9
9
  s.email = %w[titusfortner@gmail.com kapoorlakshya@gmail.com]
10
10
  s.homepage = 'https://github.com/titusfortner/webdrivers'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webdrivers
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.0
4
+ version: 3.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Titus Fortner
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-05-08 00:00:00.000000000 Z
12
+ date: 2019-05-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi