excon 0.50.1 → 0.51.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: 8ad86c2bc0fbc1b875364cddb935c775c4d338ee
4
- data.tar.gz: b227030c3ce5cf131e2ec703b409a44acf468990
3
+ metadata.gz: a5c097ca48adbd9359207000df88072d4642eff7
4
+ data.tar.gz: 5286fc8951d6efb9cb2395083532a155e57a0321
5
5
  SHA512:
6
- metadata.gz: f111143f3c135480fdb73446451366508cb96495ff7914ccd9ef227143637f3c4c3273caabb3a59f593a4c72c0a0951b5adafb03c2c25131e44c1088807c8c73
7
- data.tar.gz: cc064575f70baa1b4acbd6ccff381a493dd50cfbada4a86158c128d8a8a690ea75869a0c8f11c246061b8f182bf5374d04dbec437558379a388e97fbec53777a
6
+ metadata.gz: 5669c2d1f478f3e42f2b9d2a00d66d40c800b415b9ed0b78807b10e2954656c56fc669f500612d582888ccfb3537a96367befef6c6e70c5f37a0bf67f27362e7
7
+ data.tar.gz: 119b797537e7f9509534b4c4a5db74737b360589f4ccf2939f9bc32dbc208ed3d6cab48679bc3ca159fd0ae85af917dfd87628f9d29663e361baebcf3d0b87e4
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- excon (0.50.1)
4
+ excon (0.51.0)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -1,3 +1,7 @@
1
+ 0.51.0 07/08/2016
2
+
3
+ tweak new errors to be an alias rather than inherit
4
+
1
5
  0.50.1 06/28/2016
2
6
  =================
3
7
 
@@ -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.50.1'
17
- s.date = '2016-06-28'
16
+ s.version = '0.51.0'
17
+ s.date = '2016-07-08'
18
18
  s.rubyforge_project = 'excon'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -1,6 +1,6 @@
1
1
  module Excon
2
2
 
3
- VERSION = '0.50.1'
3
+ VERSION = '0.51.0'
4
4
 
5
5
  CR_NL = "\r\n"
6
6
 
@@ -182,7 +182,7 @@ or:
182
182
 
183
183
  # Legacy
184
184
  module Errors
185
- class Error < Excon::Error; end
185
+ Excon::Errors::Error = Excon::Error
186
186
 
187
187
  legacy_re = /
188
188
  \A
@@ -201,7 +201,9 @@ or:
201
201
 
202
202
  klasses.each do |klass|
203
203
  class_name = klass.to_s
204
- class_name = klass.to_s + 'Error' if class_name =~ legacy_re
204
+ unless class_name =~ /Error\Z/
205
+ class_name = klass.to_s + 'Error' if class_name =~ legacy_re
206
+ end
205
207
  Excon::Errors.const_set(class_name, Excon::Error.const_get(klass))
206
208
  end
207
209
 
@@ -1,5 +1,22 @@
1
+
2
+
1
3
  Shindo.tests('HTTPStatusError request/response debugging') do
2
4
 
5
+ # Regression against e300458f2d9330cb265baeb8973120d08c665d9
6
+ tests('Excon::Error knows about pertinent errors') do
7
+ expected = [
8
+ 100,
9
+ 101,
10
+ (200..206).to_a,
11
+ (300..307).to_a,
12
+ (400..417).to_a,
13
+ 422,
14
+ 429,
15
+ (500..504).to_a
16
+ ]
17
+ expected.flatten == Excon::Error.status_errors.keys
18
+ end
19
+
3
20
  tests('new returns an Error').returns(true) do
4
21
  Excon::Error.new('bar').class == Excon::Error
5
22
  end
@@ -38,6 +55,14 @@ Shindo.tests('HTTPStatusError request/response debugging') do
38
55
  end
39
56
  end
40
57
 
58
+ tests('can raise standard error and catch legacy errors').returns(true) do
59
+ begin
60
+ raise Excon::Error::NotFound.new('bar')
61
+ rescue Excon::Errors::Error => e
62
+ true
63
+ end
64
+ end
65
+
41
66
  tests('can raise with status_error() and catch with standard error').returns(true) do
42
67
  begin
43
68
  raise Excon::Error.status_error({expects: 200}, {status: 400})
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.50.1
4
+ version: 0.51.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: 2016-06-28 00:00:00.000000000 Z
13
+ date: 2016-07-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport