async-rest 0.12.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -2
- data/lib/async/rest/error.rb +14 -0
- data/lib/async/rest/representation.rb +1 -1
- data/lib/async/rest/resource.rb +1 -1
- data/lib/async/rest/version.rb +1 -1
- data/lib/async/rest/wrapper/form.rb +3 -1
- data/lib/async/rest/wrapper/generic.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a4bf59de34f8a513da719adecb09b3f82d8d5dfe29ef4e3c3b992368abcf03b
|
4
|
+
data.tar.gz: 6a579ab8c70d1d0619cce37b1192b258ed03ff1adc0db36a334199b3da485fb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0efb171429e1267c867c54ce3a3c1534f359f6e3e11d9a22752e1566da5af595369825f729d005a670867fe5d9de869beea5b31d701462a0429886e06226c43
|
7
|
+
data.tar.gz: 3c4eb83006339c58a15432a87d7ddd9d9d0c6b1f638c4599dd9aa02e0a7e9660768f83f55e46723673e2f6e7c9eca68fff94c81b65228a2ab03548d5f3d82dd1
|
data/.travis.yml
CHANGED
data/lib/async/rest/error.rb
CHANGED
@@ -26,7 +26,21 @@ module Async
|
|
26
26
|
class RequestError < Error
|
27
27
|
end
|
28
28
|
|
29
|
+
class UnsupportedError < Error
|
30
|
+
end
|
31
|
+
|
29
32
|
class ResponseError < Error
|
33
|
+
def initialize(response)
|
34
|
+
super(response.read)
|
35
|
+
|
36
|
+
@response = response
|
37
|
+
end
|
38
|
+
|
39
|
+
def to_s
|
40
|
+
"#{@response}: #{super}"
|
41
|
+
end
|
42
|
+
|
43
|
+
attr :response
|
30
44
|
end
|
31
45
|
end
|
32
46
|
end
|
data/lib/async/rest/resource.rb
CHANGED
data/lib/async/rest/version.rb
CHANGED
@@ -35,7 +35,9 @@ module Async
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def prepare_request(payload, headers)
|
38
|
-
|
38
|
+
@content_types.each_key do |key|
|
39
|
+
headers.add('accept', key)
|
40
|
+
end
|
39
41
|
|
40
42
|
if payload
|
41
43
|
headers['content-type'] = URLEncoded::APPLICATION_FORM_URLENCODED
|
@@ -36,6 +36,7 @@ module Async
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def parser_for(response)
|
39
|
+
# It's not always clear why this error is being thrown.
|
39
40
|
return Unsupported
|
40
41
|
end
|
41
42
|
|
@@ -50,7 +51,7 @@ module Async
|
|
50
51
|
|
51
52
|
class Unsupported < HTTP::Body::Wrapper
|
52
53
|
def join
|
53
|
-
raise
|
54
|
+
raise UnsupportedError, super
|
54
55
|
end
|
55
56
|
end
|
56
57
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http
|