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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3e2cdd947c31a0a97e4679da3b987d008a240c1
4
- data.tar.gz: 40cb38781d815e54008e917667ea22de595fc755
3
+ metadata.gz: 2aa8499f7225e17c17d4653cfcdbb5d0387805fa
4
+ data.tar.gz: 8036fcb9040fc3852a04f6d4ec0dc688fa6ce8ff
5
5
  SHA512:
6
- metadata.gz: d73bd319ce124e487211a5150406c219e2572b2cf6eb9e836492c81e9d7270a7324d0d04b7e6a924499e8610ce87a5476c155df410635749916c916637d92e63
7
- data.tar.gz: f83caf1cecc3f29b55c84f20edcc53115327d1e6197d52f5159cd8b3a0bf8eee42f7d897635a382bfff5fdf190669fd49a9c94ad6469c61a8055325beea2d7a0
6
+ metadata.gz: 3b87bb262f00d419f4eb347582dc93d689484ccabc189433b2631d0d21b4a0e419ba2a6b4f7b94b38ce6b181f95b952c92064cea96128d2500ccac204893c8bd
7
+ data.tar.gz: 036b3660764a74fc2daa9cf5162c0d6f5aeda2c154a9cf59d675448c73b982d22316f5ecb2b9242a32edaf11c836b01651f6d1867903ae4f18deb1323b7106d2
@@ -1,3 +1,7 @@
1
+ ### 3.2.0 (2017-08-21)
2
+
3
+ * Implemented Proxy support
4
+
1
5
  ### 3.1.0 (2017-08-21)
2
6
 
3
7
  * Implemented Logging functionality
@@ -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|
@@ -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
- File.open(filename, "wb") do |saved_file|
34
- URI.parse(url).open("rb") do |read_file|
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)}
@@ -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|
@@ -1,6 +1,3 @@
1
- require 'nokogiri'
2
- require 'open-uri'
3
-
4
1
  module Webdrivers
5
2
  class MSWebdriver < Common
6
3
  class << self
@@ -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.1.0"
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"
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.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Titus Fortner