webdrivers 3.5.0.beta1 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/lib/webdrivers/chromedriver.rb +1 -1
- data/lib/webdrivers/common.rb +12 -4
- data/lib/webdrivers/geckodriver.rb +0 -1
- data/lib/webdrivers/iedriver.rb +0 -1
- data/lib/webdrivers/mswebdriver.rb +6 -2
- data/spec/chromedriver_spec.rb +3 -3
- data/webdrivers.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddc5e44a53b52ce88415b480985d2311a80f05503458781ac7e7304d3a18e604
|
4
|
+
data.tar.gz: '091a196ecafe8884afb8aa622af317f870a6863632af1d7eba496fdb1c4bf312'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbe539d47bdc43515eeeedb2a31f098255498f7d1fa2506587fad44ec44fd703aab8566693eea35833de3f60f954a110532dbc45d579a574f8aeed3f813830dc
|
7
|
+
data.tar.gz: ff60fc0f3367ea39306625cffc766066528f97fefede0bb9bed2c6097306000b2a50ab38b2865c7eef07ba36088883ffab6c6d590338a3acfabd0c7f02d564c1
|
data/CHANGELOG.md
CHANGED
@@ -13,6 +13,7 @@ module Webdrivers
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def latest_version
|
16
|
+
raise StandardError, "Can not reach site" unless site_available?
|
16
17
|
Gem::Version.new(get(URI.join(base_url, "LATEST_RELEASE")))
|
17
18
|
end
|
18
19
|
|
@@ -27,7 +28,6 @@ module Webdrivers
|
|
27
28
|
end
|
28
29
|
|
29
30
|
def downloads
|
30
|
-
raise StandardError, "Can not download from website" unless site_available?
|
31
31
|
Webdrivers.logger.debug "Versions previously located on downloads site: #{@downloads.keys}" if @downloads
|
32
32
|
|
33
33
|
@downloads ||= begin
|
data/lib/webdrivers/common.rb
CHANGED
@@ -12,9 +12,11 @@ module Webdrivers
|
|
12
12
|
return current_version.nil? ? nil : binary
|
13
13
|
end
|
14
14
|
|
15
|
-
|
15
|
+
# Newer not specified or latest not found, so use existing
|
16
|
+
return binary if desired_version.nil? && File.exists?(binary)
|
16
17
|
|
17
|
-
|
18
|
+
# Can't find desired and no existing binary
|
19
|
+
if desired_version.nil?
|
18
20
|
msg = "Unable to find the latest version of #{file_name}; try downloading manually from #{base_url} and place in #{install_dir}"
|
19
21
|
raise StandardError, msg
|
20
22
|
end
|
@@ -39,6 +41,8 @@ module Webdrivers
|
|
39
41
|
end
|
40
42
|
|
41
43
|
def latest_version
|
44
|
+
raise StandardError, "Can not reach site" unless site_available?
|
45
|
+
|
42
46
|
downloads.keys.sort.last
|
43
47
|
end
|
44
48
|
|
@@ -48,6 +52,8 @@ module Webdrivers
|
|
48
52
|
end
|
49
53
|
|
50
54
|
def download
|
55
|
+
raise StandardError, "Can not reach site" unless site_available?
|
56
|
+
|
51
57
|
url = downloads[desired_version]
|
52
58
|
filename = File.basename url
|
53
59
|
|
@@ -105,10 +111,11 @@ module Webdrivers
|
|
105
111
|
|
106
112
|
def http
|
107
113
|
if using_proxy
|
108
|
-
|
114
|
+
Net::HTTP.Proxy(Webdrivers.proxy_addr, Webdrivers.proxy_port,
|
109
115
|
Webdrivers.proxy_user, Webdrivers.proxy_pass)
|
116
|
+
else
|
117
|
+
Net::HTTP
|
110
118
|
end
|
111
|
-
return Net::HTTP
|
112
119
|
end
|
113
120
|
|
114
121
|
private
|
@@ -124,6 +131,7 @@ module Webdrivers
|
|
124
131
|
end
|
125
132
|
|
126
133
|
def site_available?
|
134
|
+
Webdrivers.logger.debug "Looking for Site: #{base_url}"
|
127
135
|
get(base_url)
|
128
136
|
Webdrivers.logger.debug "Found Site: #{base_url}"
|
129
137
|
true
|
data/lib/webdrivers/iedriver.rb
CHANGED
@@ -24,6 +24,10 @@ module Webdrivers
|
|
24
24
|
# currently installed browser version.
|
25
25
|
alias :version :windows_version
|
26
26
|
|
27
|
+
def version=(*)
|
28
|
+
raise "Version can not be set for MSWebdriver because it is dependent on the version of Edge"
|
29
|
+
end
|
30
|
+
|
27
31
|
private
|
28
32
|
|
29
33
|
def file_name
|
@@ -31,11 +35,11 @@ module Webdrivers
|
|
31
35
|
end
|
32
36
|
|
33
37
|
def downloads
|
34
|
-
raise StandardError, "Can not reach site" unless site_available?
|
35
38
|
array = Nokogiri::HTML(get(base_url)).xpath("//li[@class='driver-download']/a")
|
36
39
|
array.each_with_object({}) do |link, hash|
|
37
40
|
next if link.text == 'Insiders'
|
38
|
-
|
41
|
+
key = normalize link.text.scan(/\d+/).first.to_i
|
42
|
+
hash[key] = link['href']
|
39
43
|
end
|
40
44
|
end
|
41
45
|
|
data/spec/chromedriver_spec.rb
CHANGED
@@ -49,12 +49,12 @@ describe Webdrivers::Chromedriver do
|
|
49
49
|
context 'when offline' do
|
50
50
|
before { allow(chromedriver).to receive(:site_available?).and_return(false) }
|
51
51
|
|
52
|
-
|
53
|
-
expect {chromedriver.latest_version}.to raise_error(StandardError, "Can not
|
52
|
+
it 'raises exception finding latest version' do
|
53
|
+
expect {chromedriver.latest_version}.to raise_error(StandardError, "Can not reach site")
|
54
54
|
end
|
55
55
|
|
56
56
|
it 'raises exception downloading' do
|
57
|
-
expect {chromedriver.download}.to raise_error(StandardError, "Can not
|
57
|
+
expect {chromedriver.download}.to raise_error(StandardError, "Can not reach site")
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
data/webdrivers.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "webdrivers"
|
6
|
-
s.version = "3.5.0
|
6
|
+
s.version = "3.5.0"
|
7
7
|
s.authors = ["Titus Fortner"]
|
8
8
|
s.email = ["titusfortner@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/titusfortner/webdrivers"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webdrivers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.0
|
4
|
+
version: 3.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Titus Fortner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -125,9 +125,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: '0'
|
126
126
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
|
-
- - "
|
128
|
+
- - ">="
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
version:
|
130
|
+
version: '0'
|
131
131
|
requirements: []
|
132
132
|
rubyforge_project:
|
133
133
|
rubygems_version: 2.7.6
|