garage_client 2.1.2 → 2.1.3

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: 394abb9093e09a4a7d79452fc44c20792d66485b
4
- data.tar.gz: 6bb87e45add606d55241e3bc90c56cb0ad176800
3
+ metadata.gz: bb9db90c3983924e416edc76b11151cac5f88607
4
+ data.tar.gz: 02feb707a136c0e0706d71ce7a1bfe3251547aaa
5
5
  SHA512:
6
- metadata.gz: 7419abf0acb63420fb45c5ac28c10f3161846159889f85568801845c3cfe56002851525f21f3df3d0d1a09355dd8aa2ac9a343f1478f4159be6a82ee7d428595
7
- data.tar.gz: da747820a31de77ee57195c2bb119e04fe30506a4f906ea05f4858b3c410bd4b08e8b832d174efc439d01139ffa223c8f9321ced332c9b1dd957f9e8e0003b33
6
+ metadata.gz: 92ab1fe88fa7f9d9d7dc5db97ccd4fa96fe341ec0973c1ea02c7bfbd4bc5a0d08f215b654809b35a3d4fadcea1bf83d993ddbe44d599f71411a314529e61be0a
7
+ data.tar.gz: be97cd43e6162bd312d80a932bd5c5402fb1cd3f5837974e13ea89eb22555f0bfa8c1576a869cafbcd215c1784f70691927b3b75ff38f3c1cf100d08e097501f
data/CHANGELOG.md CHANGED
@@ -1,40 +1,9 @@
1
- ## 2.1.0
2
- - Access token is now embedded in authorization header as a bearer token, instead of embedding in query parameter, to avoid logging and exposing access token value.
3
- Before: access token is embedded in both query parameter (`?access_token=XXX`) and in authorization header (`Authorization: Token token="XXX"`).
4
- After: access tok is embedded in authorization header as a bearer token (`Authorization: Bearer XXX`).
1
+ ## 2.1.3
2
+ - Raise GrageClient::BadRequest on 400 response as same as other http errors.
5
3
 
6
- ## 2.0.0
7
- - Remove `user_agent` configuration, use `headers` option instead.
4
+ ## 2.1.2
5
+ - Fix GarageClient::Cachers's bug.
6
+ - Lazy evaluate global configuration.
8
7
 
9
- ## 1.3.0
10
- - Provide a convenient way to cache HTTP response
11
-
12
- ## 1.2.4
13
- - Raise GarageClient::InvalidResponseType when receives invalid response (e.g. String)
14
-
15
- ## 1.2.3
16
- - Fixed response.respond_to?(:name)
17
-
18
- ## 1.2.2
19
- - GarageClient::Response supports Link header parsing
20
-
21
- ## 1.2.1
22
- - Set Content-Type with multipart/form-data when multipart params are detected
23
-
24
- ## 1.2.0
25
- - `:headers` option will overwrite the entire headers
26
- - `:default_headers` will be deprecated. Please use `:headers`
27
- - `Garage.version` was deprecated. Please use `Garage::VERSION`
28
- - `Garage.configuration` was added to configure settings
29
-
30
- ## 1.1.2
31
- - Remove needless empty module clause (7f5e13)
32
- - Change gemspec dependency (`hashie ~> 1.2.0` to `hashie >= 1.2.0`) (632ea1)
33
-
34
- ## 1.1.1
35
- - GarageClient::Error accepts no argument initialization
36
-
37
- ## 1.1.0
38
- - Add ``:default_headers`` option
39
- - Verbose exception message
40
- - Resource#links does not raise error when _links is not existed
8
+ ## 2.1.1
9
+ - First release of OSS version :tada:.
data/README.md CHANGED
@@ -123,6 +123,7 @@ GarageClient raises one of the following exceptions upon an error.
123
123
  Make sure to always look out for these in your code.
124
124
 
125
125
  ```ruby
126
+ GarageClient::BadRequest
126
127
  GarageClient::Unauthorized
127
128
  GarageClient::Forbidden
128
129
  GarageClient::NotFound
@@ -19,6 +19,7 @@ module GarageClient
19
19
  end
20
20
 
21
21
  # HTTP level
22
+ class BadRequest < Error; end
22
23
  class Unauthorized < Error; end
23
24
  class Forbidden < Error; end
24
25
  class NotFound < Error; end
@@ -8,6 +8,8 @@ module GarageClient
8
8
  @app.call(env).on_complete do |response|
9
9
  resp = response
10
10
  case response[:status].to_i
11
+ when 400
12
+ raise GarageClient::BadRequest.new(resp)
11
13
  when 401
12
14
  raise GarageClient::Unauthorized.new(resp)
13
15
  when 403
@@ -1,3 +1,3 @@
1
1
  module GarageClient
2
- VERSION = '2.1.2'
2
+ VERSION = '2.1.3'
3
3
  end
@@ -409,6 +409,7 @@ describe Faraday::Response do
409
409
 
410
410
  describe 'http errors' do
411
411
  {
412
+ 400 => GarageClient::BadRequest,
412
413
  401 => GarageClient::Unauthorized,
413
414
  403 => GarageClient::Forbidden,
414
415
  404 => GarageClient::NotFound,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: garage_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cookpad Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-23 00:00:00.000000000 Z
11
+ date: 2015-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -257,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
257
257
  version: '0'
258
258
  requirements: []
259
259
  rubyforge_project:
260
- rubygems_version: 2.4.5
260
+ rubygems_version: 2.2.2
261
261
  signing_key:
262
262
  specification_version: 4
263
263
  summary: Ruby client library for the Garage API
@@ -278,3 +278,4 @@ test_files:
278
278
  - spec/garage_client/response_spec.rb
279
279
  - spec/garage_client_spec.rb
280
280
  - spec/spec_helper.rb
281
+ has_rdoc: