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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f292b9f00d51fa84cf046500d96f6e974756f4822bea030b04f020a221912e45
4
- data.tar.gz: bca6951770b45c20b275eceb2339e77cdaa6089a63b9ce232264c91690a2e2f7
3
+ metadata.gz: ddc5e44a53b52ce88415b480985d2311a80f05503458781ac7e7304d3a18e604
4
+ data.tar.gz: '091a196ecafe8884afb8aa622af317f870a6863632af1d7eba496fdb1c4bf312'
5
5
  SHA512:
6
- metadata.gz: 23bd4cbf655e4983b70f5405d2e2f1229b9f61743e1cfa81971a62f5e71920a07e557a6341842d9d5a44eda718c6cb79741c1b260561d5563bd2519b5abb3c9b
7
- data.tar.gz: 37be287a21d845cbc09a7e98d524275167dd7af804a7e5a7577082e43bcfe3daaccaadf65b637dac7929a70c28561f937719b957bc45796301c4460f417ae3b7
6
+ metadata.gz: bbe539d47bdc43515eeeedb2a31f098255498f7d1fa2506587fad44ec44fd703aab8566693eea35833de3f60f954a110532dbc45d579a574f8aeed3f813830dc
7
+ data.tar.gz: ff60fc0f3367ea39306625cffc766066528f97fefede0bb9bed2c6097306000b2a50ab38b2865c7eef07ba36088883ffab6c6d590338a3acfabd0c7f02d564c1
@@ -1,3 +1,5 @@
1
+ ### 3.5.0 (2018-12-15)
2
+
1
3
  ### 3.5.0.beta1 (2018-12-15)
2
4
 
3
5
  * Allow version to be specified
@@ -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
@@ -12,9 +12,11 @@ module Webdrivers
12
12
  return current_version.nil? ? nil : binary
13
13
  end
14
14
 
15
- return binary if desired_version.nil? && File.exists?(binary) # Newer not found, keep current
15
+ # Newer not specified or latest not found, so use existing
16
+ return binary if desired_version.nil? && File.exists?(binary)
16
17
 
17
- if desired_version.nil? # Can't find latest and no existing binary
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
- return Net::HTTP.Proxy(Webdrivers.proxy_addr, Webdrivers.proxy_port,
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
@@ -15,7 +15,6 @@ module Webdrivers
15
15
  private
16
16
 
17
17
  def downloads
18
- raise StandardError, "Can not reach site" unless site_available?
19
18
  Webdrivers.logger.debug "Versions previously located on downloads site: #{@downloads.keys}" if @downloads
20
19
 
21
20
  @downloads ||= begin
@@ -24,7 +24,6 @@ module Webdrivers
24
24
  end
25
25
 
26
26
  def downloads
27
- raise StandardError, "Can not reach site" unless site_available?
28
27
  Webdrivers.logger.debug "Versions previously located on downloads site: #{@downloads.keys}" if @downloads
29
28
 
30
29
  @downloads ||= begin
@@ -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
- hash[link.text.scan(/\d+/).first.to_i] = link['href']
41
+ key = normalize link.text.scan(/\d+/).first.to_i
42
+ hash[key] = link['href']
39
43
  end
40
44
  end
41
45
 
@@ -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
- xit 'raises exception finding latest version' do
53
- expect {chromedriver.latest_version}.to raise_error(StandardError, "Can not download from website")
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 download from website")
57
+ expect {chromedriver.download}.to raise_error(StandardError, "Can not reach site")
58
58
  end
59
59
  end
60
60
 
@@ -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.beta1"
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.beta1
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-15 00:00:00.000000000 Z
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: 1.3.1
130
+ version: '0'
131
131
  requirements: []
132
132
  rubyforge_project:
133
133
  rubygems_version: 2.7.6