garage_client 2.4.6 → 3.0.0

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
  SHA256:
3
- metadata.gz: 897dd3b0bc65c1611c55f849ea5bfdc798cbfb252aa525f19c81aaadff2aadb0
4
- data.tar.gz: 0a6def3201226a01ab1c415933ef3e4496ade096ab7e273a28694fe69cd657d2
3
+ metadata.gz: 232578511292fd92e6d04a6fb38f4e792c2c9d2ad09233f6ec3dfbe34daee964
4
+ data.tar.gz: 9abb6580e134bd6721b8c818a5c1d72063a94b487f7c3682f598f63c59717c31
5
5
  SHA512:
6
- metadata.gz: c668202336fa97610663f9f5e321f114bc2b9254beba0feb2858828460bd7686ae250ff919740fd7b6108daaadc2f8277a6970c8e360e3bb134fde8528a9c115
7
- data.tar.gz: dd21ae1aa64f9687a49a172e50b2b92e6af5f93b6dc68899b2a20d4d5c43d678dcb7f770bd65c952ba3d0eb10404c58aaf0950e9038ef9a91a6374afa66f619f
6
+ metadata.gz: dea5f8c420f3321465855b00fb24542c76916dc4d786e370d72c904447fc410ad9cd8202fb3db3ec7e6c77e30bf276cf0088d9e0509801eb9bce9c61ddd20f51
7
+ data.tar.gz: 818264a87289e2d526c9c924a744e61b21c6737c9bdd5a13aa11a28d1883e14495d3fd60ef94d700e18b0d762d8cba2ee59cac6e3b98164ac146671b6c2ded1f
@@ -11,20 +11,15 @@ jobs:
11
11
  fail-fast: true
12
12
  matrix:
13
13
  ruby:
14
- - '2.5'
15
- - '2.6'
16
- - '2.7'
17
14
  - '3.0'
15
+ - '3.1'
16
+ - '3.2'
17
+ - '3.3'
18
18
  - 'head'
19
- gemfile:
20
- - 'gemfiles/Gemfile.faraday-0.x'
21
- - 'gemfiles/Gemfile.faraday-1.x'
22
- env:
23
- BUNDLE_GEMFILE: ${{ matrix.gemfile }}
24
19
  continue-on-error: ${{ endsWith(matrix.ruby, 'head') }}
25
- name: Run test with Ruby ${{ matrix.ruby }}, ${{ matrix.gemfile }}
20
+ name: Run test with Ruby ${{ matrix.ruby }}
26
21
  steps:
27
- - uses: actions/checkout@v2
22
+ - uses: actions/checkout@v4
28
23
  - uses: ruby/setup-ruby@v1
29
24
  with:
30
25
  ruby-version: ${{ matrix.ruby }}
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.0.0
2
+ - Upgrade faraday gem to v2 and drop support for Ruby 2.6 and 2.7
3
+
1
4
  ## 2.4.6
2
5
  - Fix deprecation warning from Faraday
3
6
 
@@ -10,14 +10,15 @@ Gem::Specification.new do |s|
10
10
  s.description = s.summary
11
11
 
12
12
  s.files = `git ls-files`.split($\)
13
- s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ s.executables = s.files.grep(%r{^bin/}).map { |f| File.basename(f) }
14
14
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
15
15
  s.require_paths = ['lib']
16
16
  s.authors = ['Cookpad Inc.']
17
17
  s.email = ['kaihatsu@cookpad.com']
18
18
 
19
- s.add_dependency 'faraday', '>= 0.8.0'
20
- s.add_dependency 'faraday_middleware'
19
+ s.add_dependency 'faraday', '>= 2.0.1'
20
+ s.add_dependency 'faraday-mashify'
21
+ s.add_dependency 'faraday-multipart'
21
22
  s.add_dependency 'hashie', '>= 1.2.0'
22
23
  s.add_dependency 'link_header'
23
24
 
@@ -9,15 +9,9 @@ module GarageClient
9
9
  def call
10
10
  response = store.read(key, options) if read_from_cache?
11
11
  if response
12
- # Faraday::Response#marshal_dump is drop request object and url
13
- # https://github.com/lostisland/faraday/blob/edacd5eb57ea13accab3097649690ae5f48f421a/lib/faraday/response.rb#L74
14
- #
15
- # XXX: We can't use #merge! here because Faraday::Env does not implement
16
- # the method as same as Hash#merge! with Faraday v0.12.1.
17
- @env.each do |k, v|
18
- original = response.env[k]
19
- response.env[k] = v if !original && v
20
- end
12
+ # Faraday::Response#marshal_dump drops the request object
13
+ # https://github.com/lostisland/faraday/blob/cc5d60776645d3d341ff0f425c45b3b3d48d98e0/lib/faraday/response.rb#L70
14
+ response.env.merge!(@env)
21
15
  else
22
16
  response = yield
23
17
  store.write(key, response, options) if written_to_cache?
@@ -60,13 +60,13 @@ module GarageClient
60
60
  Faraday.new(headers: headers, url: endpoint) do |builder|
61
61
  # Response Middlewares
62
62
  builder.use Faraday::Response::Logger if verbose
63
- builder.use FaradayMiddleware::Mashify
64
- builder.use Faraday::Response::ParseJson, :content_type => /\bjson$/
63
+ builder.use Faraday::Mashify::Middleware
64
+ builder.use Faraday::Response::Json, content_type: /\bjson$/
65
65
  builder.use GarageClient::Response::Cacheable, cacher: cacher if cacher
66
66
  builder.use GarageClient::Response::RaiseHttpException
67
67
 
68
68
  # Request Middlewares
69
- builder.use Faraday::Request::Multipart
69
+ builder.use Faraday::Multipart::Middleware
70
70
  builder.use GarageClient::Request::JsonEncoded
71
71
  builder.use GarageClient::Request::PropagateRequestId
72
72
 
@@ -1,8 +1,6 @@
1
- require "faraday_middleware"
2
-
3
1
  module GarageClient
4
2
  class Response
5
- class Cacheable < Faraday::Response::Middleware
3
+ class Cacheable < Faraday::Middleware
6
4
  register_middleware cache: self
7
5
 
8
6
  def initialize(app, args)
@@ -1,9 +1,6 @@
1
- require 'garage_client/error'
2
- require 'faraday_middleware'
3
-
4
1
  module GarageClient
5
2
  class Response
6
- class RaiseHttpException < Faraday::Response::Middleware
3
+ class RaiseHttpException < Faraday::Middleware
7
4
  ClientErrorStatuses = 400...500
8
5
  ServerErrorStatuses = 500...600
9
6
 
@@ -11,11 +11,9 @@ module GarageClient
11
11
  @client = client
12
12
  @response = response
13
13
 
14
- # Faraday's Net::Http adapter returns '' if response is nil.
15
- # Changes from faraday v0.9.0. faraday/f41ffaabb72d3700338296c79a2084880e6a9843
16
- #
17
- # GarageClient::Response#body should be always a String when Faraday
18
- # became v1.0.0. Because 0.9.0 seems to be not stable.
14
+ # faraday-net_http adapter converts the response body from nil to '' to ensure the body is a string.
15
+ # https://github.com/lostisland/faraday/commit/f41ffaabb72d3700338296c79a2084880e6a9843
16
+ # https://github.com/lostisland/faraday-net_http/blob/11953160f75dd488133a74857c2b07d41be8995d/lib/faraday/adapter/net_http.rb#L186
19
17
  response.env[:body] = nil if response.env[:body] == ''
20
18
 
21
19
  unless ACCEPT_BODY_TYPES.any? {|type| type === response.body }
@@ -1,3 +1,3 @@
1
1
  module GarageClient
2
- VERSION = '2.4.6'
2
+ VERSION = '3.0.0'
3
3
  end
data/lib/garage_client.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'faraday'
2
- require 'faraday_middleware'
2
+ require 'faraday/mashify'
3
+ require 'faraday/multipart'
3
4
 
4
5
  require 'garage_client/version'
5
6
  require 'garage_client/cachers/base'
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.4.6
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cookpad Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-24 00:00:00.000000000 Z
11
+ date: 2024-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -16,16 +16,30 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.8.0
19
+ version: 2.0.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.8.0
26
+ version: 2.0.1
27
27
  - !ruby/object:Gem::Dependency
28
- name: faraday_middleware
28
+ name: faraday-mashify
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: faraday-multipart
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - ">="
@@ -194,8 +208,6 @@ files:
194
208
  - README.md
195
209
  - Rakefile
196
210
  - garage_client.gemspec
197
- - gemfiles/Gemfile.faraday-0.x
198
- - gemfiles/Gemfile.faraday-1.x
199
211
  - lib/garage_client.rb
200
212
  - lib/garage_client/cachers/base.rb
201
213
  - lib/garage_client/client.rb
@@ -247,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
259
  - !ruby/object:Gem::Version
248
260
  version: '0'
249
261
  requirements: []
250
- rubygems_version: 3.3.7
262
+ rubygems_version: 3.5.3
251
263
  signing_key:
252
264
  specification_version: 4
253
265
  summary: Ruby client library for the Garage API
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'faraday', '~> 0'
4
- gemspec path: '../'
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'faraday', '~> 1'
4
- gemspec path: '../'