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 +4 -4
- data/Gemfile.lock +1 -1
- data/changelog.txt +4 -0
- data/excon.gemspec +2 -2
- data/lib/excon/constants.rb +1 -1
- data/lib/excon/error.rb +4 -2
- data/tests/error_tests.rb +25 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5c097ca48adbd9359207000df88072d4642eff7
|
4
|
+
data.tar.gz: 5286fc8951d6efb9cb2395083532a155e57a0321
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5669c2d1f478f3e42f2b9d2a00d66d40c800b415b9ed0b78807b10e2954656c56fc669f500612d582888ccfb3537a96367befef6c6e70c5f37a0bf67f27362e7
|
7
|
+
data.tar.gz: 119b797537e7f9509534b4c4a5db74737b360589f4ccf2939f9bc32dbc208ed3d6cab48679bc3ca159fd0ae85af917dfd87628f9d29663e361baebcf3d0b87e4
|
data/Gemfile.lock
CHANGED
data/changelog.txt
CHANGED
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.
|
17
|
-
s.date = '2016-
|
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
|
data/lib/excon/constants.rb
CHANGED
data/lib/excon/error.rb
CHANGED
@@ -182,7 +182,7 @@ or:
|
|
182
182
|
|
183
183
|
# Legacy
|
184
184
|
module Errors
|
185
|
-
|
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
|
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
|
|
data/tests/error_tests.rb
CHANGED
@@ -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.
|
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-
|
13
|
+
date: 2016-07-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|