excon 0.42.1 → 0.43.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of excon might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b684746ccebdb53136049cd54cba9ebf0744af4
4
- data.tar.gz: 465cf9dd32177506553a7edf2b401dbadfaa1c6a
3
+ metadata.gz: 77a0da513895a3cba30b16145e7bea66033973cb
4
+ data.tar.gz: c573a10ec3c2f569628b1c605dc6d47a25caecf5
5
5
  SHA512:
6
- metadata.gz: 32b65518b5c0b201baf63c8528cf640655d741e778bbcf35a45fc1cf0529eda1ecbb9ed7800665a2fb124f17acef8808871ad38e88ff045192755e1f7d6ed7a6
7
- data.tar.gz: 258fcc17aae09ce9243ad7ed5849458947018de60cf06efb53f1abd14ed447d4b3ffc0863c6925368706d90c2187c45fcf32b2ef6f186d3ec2cae104761df201
6
+ metadata.gz: 740736aa1390923d0ce8d30b4739b149509cdfe445e5ea90ef21e2f1f69e1df2603d22d722b9d4ac835c349e503d03349fbfcdc978104057edcc1310d130c654
7
+ data.tar.gz: fa08c954a4fcb5bc746d3ab32194b7bb41fef491b86b8ac3d5e0436d6c816f3074232e4ee807b132fc450d53f2f84ffe3a770738e5130c7ec65818faa5feea76
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- excon (0.42.1)
4
+ excon (0.43.0)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/changelog.txt CHANGED
@@ -1,3 +1,10 @@
1
+ 0.43.0 01/09/2015
2
+ =================
3
+
4
+ use basic error instead of nil as default for socket error
5
+ allow setup_proxy to accept uri
6
+ add disable_proxy and proxy: false to disable proxy settings
7
+
1
8
  0.42.1 12/04/2014
2
9
  =================
3
10
 
data/excon.gemspec CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'excon'
16
- s.version = '0.42.1'
17
- s.date = '2014-12-04'
16
+ s.version = '0.43.0'
17
+ s.date = '2015-01-09'
18
18
  s.rubyforge_project = 'excon'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -392,6 +392,13 @@ module Excon
392
392
  end
393
393
 
394
394
  def setup_proxy
395
+ if @data[:disable_proxy]
396
+ if @data[:proxy]
397
+ raise ArgumentError, "`:disable_proxy` parameter and `:proxy` parameter cannot both be set at the same time."
398
+ end
399
+ return
400
+ end
401
+
395
402
  unless @data[:scheme] == UNIX
396
403
  if no_proxy_env = ENV["no_proxy"] || ENV["NO_PROXY"]
397
404
  no_proxy_list = no_proxy_env.scan(/\*?\.?([^\s,:]+)(?::(\d+))?/i).map { |s| [s[0], s[1]] }
@@ -410,8 +417,8 @@ module Excon
410
417
  @data.delete(:proxy)
411
418
  when Hash
412
419
  # no processing needed
413
- when String
414
- uri = URI.parse(@data[:proxy])
420
+ when String, URI
421
+ uri = @data[:proxy].is_a?(String) ? URI.parse(@data[:proxy]) : @data[:proxy]
415
422
  @data[:proxy] = {
416
423
  :host => uri.host,
417
424
  # path is only sensible for a Unix socket proxy
@@ -1,6 +1,6 @@
1
1
  module Excon
2
2
 
3
- VERSION = '0.42.1'
3
+ VERSION = '0.43.0'
4
4
 
5
5
  CR_NL = "\r\n"
6
6
 
@@ -67,6 +67,7 @@ module Excon
67
67
  :client_cert,
68
68
  :certificate,
69
69
  :certificate_path,
70
+ :disable_proxy,
70
71
  :private_key,
71
72
  :private_key_path,
72
73
  :connect_timeout,
data/lib/excon/errors.rb CHANGED
@@ -8,7 +8,7 @@ module Excon
8
8
  class SocketError < Error
9
9
  attr_reader :socket_error
10
10
 
11
- def initialize(socket_error=nil)
11
+ def initialize(socket_error=Excon::Error.new)
12
12
  if socket_error.message =~ /certificate verify failed/
13
13
  super("Unable to verify certificate, please set `Excon.defaults[:ssl_ca_path] = path_to_certs`, `ENV['SSL_CERT_DIR'] = path_to_certs`, `Excon.defaults[:ssl_ca_file] = path_to_file`, `ENV['SSL_CERT_FILE'] = path_to_file`, `Excon.defaults[:ssl_verify_callback] = callback` (see OpenSSL::SSL::SSLContext#verify_callback), or `Excon.defaults[:ssl_verify_peer] = false` (less secure).")
14
14
  else
data/tests/proxy_tests.rb CHANGED
@@ -66,6 +66,15 @@ Shindo.tests('Excon proxy support') do
66
66
  tests('connection.data[:proxy][:scheme]').returns('http') do
67
67
  connection.data[:proxy][:scheme]
68
68
  end
69
+
70
+ tests('with disable_proxy set') do
71
+ connection = nil
72
+
73
+ tests('connection.data[:proxy]').returns(nil) do
74
+ connection = Excon.new('http://foo.com', :disable_proxy => true)
75
+ connection.data[:proxy]
76
+ end
77
+ end
69
78
  end
70
79
 
71
80
  tests('an https connection') do
@@ -83,6 +92,15 @@ Shindo.tests('Excon proxy support') do
83
92
  tests('connection.data[:proxy][:scheme]').returns('http') do
84
93
  connection.data[:proxy][:scheme]
85
94
  end
95
+
96
+ tests('with disable_proxy set') do
97
+ connection = nil
98
+
99
+ tests('connection.data[:proxy]').returns(nil) do
100
+ connection = Excon.new('https://foo.com', :disable_proxy => true)
101
+ connection.data[:proxy]
102
+ end
103
+ end
86
104
  end
87
105
 
88
106
  tests('http proxy from the environment overrides config') do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.42.1
4
+ version: 0.43.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - dpiddy (Dan Peterson)
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-12-04 00:00:00.000000000 Z
13
+ date: 2015-01-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport