api_client 0.5.25 → 0.5.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/api_client/connection/basic.rb +2 -0
- data/lib/api_client/errors.rb +1 -0
- data/lib/api_client/version.rb +1 -1
- data/spec/api_client/connection/basic_spec.rb +7 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 810d32749cc1ee8060c90cd98bfb13fe98739617043ba428f624e1203cb446d9
|
4
|
+
data.tar.gz: 90a3cb0f587a1f1bc0767080cd36d292dbd751cdd6817e6e5cc396873c3b4960
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97062be5359c222fe60a142dad7a944b26cb8eb8bf572353932ee5cbe1c8b5cd5356174c689ca45557b5ee7ecab56b1a1e3fc1f9bd71e580d9c01f943d46ca4c
|
7
|
+
data.tar.gz: 99df6ebe27b699fb26a40d7069502c2e85d4afec520bfba5f202de28993631ac6198e9302c4d02b72fc5a8cd3621a3969f95be003ac139c8bfd469f4735d415f
|
data/CHANGELOG.md
CHANGED
@@ -109,6 +109,8 @@ module ApiClient
|
|
109
109
|
raise ApiClient::Errors::Conflict.new(nil, request, response)
|
110
110
|
when 410
|
111
111
|
raise ApiClient::Errors::Gone.new(nil, request, response)
|
112
|
+
when 412
|
113
|
+
raise ApiClient::Errors::PreconditionFailed.new(nil, request, response)
|
112
114
|
when 422
|
113
115
|
raise ApiClient::Errors::UnprocessableEntity.new(response.body, request, response)
|
114
116
|
when 423
|
data/lib/api_client/errors.rb
CHANGED
@@ -24,6 +24,7 @@ module ApiClient
|
|
24
24
|
class Gone < ApiClientError; end
|
25
25
|
class ServerError < ApiClientError; end
|
26
26
|
class UnprocessableEntity < ApiClientError; end
|
27
|
+
class PreconditionFailed < ApiClientError; end
|
27
28
|
class Locked < ApiClientError; end
|
28
29
|
class TooManyRequests < ApiClientError; end
|
29
30
|
end
|
data/lib/api_client/version.rb
CHANGED
@@ -149,6 +149,13 @@ describe ApiClient::Connection::Basic do
|
|
149
149
|
}.should raise_error(ApiClient::Errors::Gone, "Status code: 410")
|
150
150
|
end
|
151
151
|
|
152
|
+
it "raises an ApiClient::Errors::PreconditionFailed if status is 412" do
|
153
|
+
@response.env[:status] = 412
|
154
|
+
lambda {
|
155
|
+
@instance.send :handle_response, request, @response
|
156
|
+
}.should raise_error(ApiClient::Errors::PreconditionFailed, "Status code: 412")
|
157
|
+
end
|
158
|
+
|
152
159
|
it "raises an ApiClient::Errors::Unsupported if status is 422" do
|
153
160
|
@response.env[:status] = 422
|
154
161
|
lambda {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zendesk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: '0'
|
163
163
|
requirements: []
|
164
|
-
rubygems_version: 3.
|
164
|
+
rubygems_version: 3.3.0.dev
|
165
165
|
signing_key:
|
166
166
|
specification_version: 3
|
167
167
|
summary: API client builder
|