webdrivers 3.1.0 → 3.2.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 +4 -0
- data/lib/webdrivers/chromedriver.rb +1 -3
- data/lib/webdrivers/common.rb +16 -4
- data/lib/webdrivers/geckodriver.rb +1 -2
- data/lib/webdrivers/iedriver.rb +1 -2
- data/lib/webdrivers/mswebdriver.rb +0 -3
- data/webdrivers.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2aa8499f7225e17c17d4653cfcdbb5d0387805fa
|
4
|
+
data.tar.gz: 8036fcb9040fc3852a04f6d4ec0dc688fa6ce8ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b87bb262f00d419f4eb347582dc93d689484ccabc189433b2631d0d21b4a0e419ba2a6b4f7b94b38ce6b181f95b952c92064cea96128d2500ccac204893c8bd
|
7
|
+
data.tar.gz: 036b3660764a74fc2daa9cf5162c0d6f5aeda2c154a9cf59d675448c73b982d22316f5ecb2b9242a32edaf11c836b01651f6d1867903ae4f18deb1323b7106d2
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
require 'nokogiri'
|
2
|
-
require 'open-uri'
|
3
|
-
require 'zip'
|
4
2
|
|
5
3
|
module Webdrivers
|
6
4
|
class Chromedriver < Common
|
@@ -33,7 +31,7 @@ module Webdrivers
|
|
33
31
|
Webdrivers.logger.debug "Versions previously located on downloads site: #{@downloads.keys}" if @downloads
|
34
32
|
|
35
33
|
@downloads ||= begin
|
36
|
-
doc = Nokogiri::XML.parse(OpenURI.open_uri(base_url))
|
34
|
+
doc = Nokogiri::XML.parse(OpenURI.open_uri(base_url, proxy_opt))
|
37
35
|
items = doc.css("Contents Key").collect(&:text)
|
38
36
|
items.select! {|item| item.include?(platform)}
|
39
37
|
ds = items.each_with_object({}) do |item, hash|
|
data/lib/webdrivers/common.rb
CHANGED
@@ -30,10 +30,8 @@ module Webdrivers
|
|
30
30
|
Dir.mkdir(install_dir) unless File.exists?(install_dir)
|
31
31
|
Dir.chdir install_dir do
|
32
32
|
FileUtils.rm_f filename
|
33
|
-
|
34
|
-
|
35
|
-
saved_file.write(read_file.read)
|
36
|
-
end
|
33
|
+
open(filename, "wb") do |file|
|
34
|
+
file.print open(url, proxy_opt, &:read)
|
37
35
|
end
|
38
36
|
raise "Could not download #{url}" unless File.exists? filename
|
39
37
|
Webdrivers.logger.debug "Successfully downloaded #{filename}"
|
@@ -56,6 +54,20 @@ module Webdrivers
|
|
56
54
|
|
57
55
|
private
|
58
56
|
|
57
|
+
def proxy_opt
|
58
|
+
proxy_uri = ENV['WD_PROXY_URI']
|
59
|
+
proxy_user = ENV['WD_PROXY_USER']
|
60
|
+
proxy_pass = ENV['WD_PROXY_PASS']
|
61
|
+
|
62
|
+
if proxy_uri && proxy_user
|
63
|
+
{proxy_http_basic_authentication: [proxy_uri, proxy_user, proxy_pass]}
|
64
|
+
elsif proxy_uri
|
65
|
+
{proxy: proxy_uri}
|
66
|
+
else
|
67
|
+
{}
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
59
71
|
def download_url(version)
|
60
72
|
downloads[version || latest]
|
61
73
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'nokogiri'
|
2
|
-
require 'open-uri'
|
3
2
|
|
4
3
|
module Webdrivers
|
5
4
|
class Geckodriver < Common
|
@@ -24,7 +23,7 @@ module Webdrivers
|
|
24
23
|
Webdrivers.logger.debug "Versions previously located on downloads site: #{@downloads.keys}" if @downloads
|
25
24
|
|
26
25
|
@downloads ||= begin
|
27
|
-
doc = Nokogiri::XML.parse(OpenURI.open_uri(base_url))
|
26
|
+
doc = Nokogiri::XML.parse(OpenURI.open_uri(base_url, proxy_opt))
|
28
27
|
items = doc.css(".release-downloads a").collect {|item| item["href"]}
|
29
28
|
items.reject! {|item| item.include?('archive')}
|
30
29
|
items.select! {|item| item.include?(platform)}
|
data/lib/webdrivers/iedriver.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'nokogiri'
|
2
|
-
require 'open-uri'
|
3
2
|
|
4
3
|
module Webdrivers
|
5
4
|
class IEdriver < Common
|
@@ -32,7 +31,7 @@ module Webdrivers
|
|
32
31
|
Webdrivers.logger.debug "Versions previously located on downloads site: #{@downloads.keys}" if @downloads
|
33
32
|
|
34
33
|
@downloads ||= begin
|
35
|
-
doc = Nokogiri::XML.parse(OpenURI.open_uri(base_url))
|
34
|
+
doc = Nokogiri::XML.parse(OpenURI.open_uri(base_url, proxy_opt))
|
36
35
|
items = doc.css("Key").collect(&:text)
|
37
36
|
items.select! { |item| item.include?('IEDriverServer_Win32') }
|
38
37
|
ds = items.each_with_object({}) do |item, hash|
|
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.
|
6
|
+
s.version = "3.2.0"
|
7
7
|
s.authors = ["Titus Fortner"]
|
8
8
|
s.email = ["titusfortner@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/titusfortner/webdrivers"
|