api_client 0.5.25 → 0.5.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c28ef0d16bb54dd8665be3a02147117c944034782c1d538697d0c5a800d81d30
4
- data.tar.gz: a46f810dacebf1933b96ba9e844075a95ccb57202ca9554be1ab135812dda52b
3
+ metadata.gz: 810d32749cc1ee8060c90cd98bfb13fe98739617043ba428f624e1203cb446d9
4
+ data.tar.gz: 90a3cb0f587a1f1bc0767080cd36d292dbd751cdd6817e6e5cc396873c3b4960
5
5
  SHA512:
6
- metadata.gz: e992f5cd23729c1d3eb2cd290cc29b4ebb301799b6ce12740f347b831d09750759638f2bb4fb92db7530b1268d1e0a6b91e863681a2daacba67101ea1fa902d9
7
- data.tar.gz: 1da3c79a1babc2dfe18a45e17e90b449d4984d829c0d0da444e69623cd2ec199c7b5f0adcf628750d3545d67aa4862f5c8ad3f370d9c8308bff45631e3b2f672
6
+ metadata.gz: 97062be5359c222fe60a142dad7a944b26cb8eb8bf572353932ee5cbe1c8b5cd5356174c689ca45557b5ee7ecab56b1a1e3fc1f9bd71e580d9c01f943d46ca4c
7
+ data.tar.gz: 99df6ebe27b699fb26a40d7069502c2e85d4afec520bfba5f202de28993631ac6198e9302c4d02b72fc5a8cd3621a3969f95be003ac139c8bfd469f4735d415f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.5.26
2
+
3
+ * Add support for HTTP status code: 412 Precondition Failed
4
+
1
5
  # 0.5.25
2
6
 
3
7
  * Fix broken gem build (gemspec files)
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module ApiClient
2
- VERSION = '0.5.25'
2
+ VERSION = '0.5.26'
3
3
  end
@@ -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.25
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: 2020-07-15 00:00:00.000000000 Z
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.2.0.pre1
164
+ rubygems_version: 3.3.0.dev
165
165
  signing_key:
166
166
  specification_version: 3
167
167
  summary: API client builder