api_client 0.5.20 → 0.5.21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 115713a025a66cc43367f8c0d17e933e4d330bd0
4
- data.tar.gz: ddb8e08252352b270cb13f7642951ed57b71bf9c
3
+ metadata.gz: 740df514af720a036b09ab2fdf1ccf1bbd3a8067
4
+ data.tar.gz: 6e9a48595d5242e14a2c676ffaed756882a4e65c
5
5
  SHA512:
6
- metadata.gz: 839fe8a5e151abff2066f5758bfc0de7d98dfb94a3119ee71d6d27371e61b9d86fb8e02ddd675d7dd76adb517943dc279ce572ff30f7d185f433baa11a522e7b
7
- data.tar.gz: 31ea81e599aff3db33896fcf4fce0b29f6efe9c10fcc92b986c9ebd1acaf9a94c37982600c44af3934525ab5d35cf09119f4a6d63e9254c98be698227d4cdba4
6
+ metadata.gz: dc07d971fa5c4c35499ba037789c2c0a6f9ec96a850b20493dfd3d1dc810e44378fd2ee94fc130f2dc4bf65dbc129256576e9c148d15d4ec9ff2dec85b9207b6
7
+ data.tar.gz: 2bdae8df28fd038473debd05eca7c8b7b02d710c7c56259698b97444b56379f3371a4ab361e078389fcf40d9612f2e92873d9386af4d49803f0f440c694ed736
@@ -1,3 +1,7 @@
1
+ # 0.5.21
2
+
3
+ * add support for http 410 status code
4
+
1
5
  # 0.5.20
2
6
 
3
7
  * brought back jruby support
@@ -107,6 +107,8 @@ module ApiClient
107
107
  raise ApiClient::Errors::Unsupported.new(nil, request, response)
108
108
  when 409
109
109
  raise ApiClient::Errors::Conflict.new(nil, request, response)
110
+ when 410
111
+ raise ApiClient::Errors::Gone.new(nil, request, response)
110
112
  when 422
111
113
  raise ApiClient::Errors::UnprocessableEntity.new(response.body, request, response)
112
114
  when 429
@@ -21,6 +21,7 @@ module ApiClient
21
21
  class BadRequest < ApiClientError; end
22
22
  class Unsupported < ApiClientError; end
23
23
  class Conflict < ApiClientError; end
24
+ class Gone < ApiClientError; end
24
25
  class ServerError < ApiClientError; end
25
26
  class UnprocessableEntity < ApiClientError; end
26
27
  class TooManyRequests < ApiClientError; end
@@ -1,3 +1,3 @@
1
1
  module ApiClient
2
- VERSION = '0.5.20'
2
+ VERSION = '0.5.21'
3
3
  end
@@ -142,6 +142,13 @@ describe ApiClient::Connection::Basic do
142
142
  }.should raise_error(ApiClient::Errors::Conflict, "Status code: 409")
143
143
  end
144
144
 
145
+ it "raises an ApiClient::Errors::Gone if status is 410" do
146
+ @response.env[:status] = 410
147
+ lambda {
148
+ @instance.send :handle_response, request, @response
149
+ }.should raise_error(ApiClient::Errors::Gone, "Status code: 410")
150
+ end
151
+
145
152
  it "raises an ApiClient::Errors::Unsupported if status is 422" do
146
153
  @response.env[:status] = 422
147
154
  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.20
4
+ version: 0.5.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin Bunsch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-18 00:00:00.000000000 Z
11
+ date: 2019-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec