garage_client 2.4.3 → 2.4.4

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: 8c28d0f7144700d3eb5347249df282095c2b716c1e45fb7f6fb25c7cb3c3c668
4
- data.tar.gz: 9e2dd1472a2d4998cd584bdb8223373c1693346c3227af5b2ccd9f2511e6d730
3
+ metadata.gz: 580980067ed04267e85d03e5a9f0fdfef39ebac8142e9110a9bc42f622e2fb02
4
+ data.tar.gz: 59bc77a7d6499d2f22e7bb3434b0756d2315abfe104cbd883bef653fe2cda52b
5
5
  SHA512:
6
- metadata.gz: 99e68b0cb1c67c5c2ce2079a70ab6d070c4dbce710b009833fd85c7d5390b1e9e521576e98d834c97c87110a6c8f1f75d68a719b9239aa8e36dbdff5a2198d9f
7
- data.tar.gz: ec8102b0b9c423e33aea965dcf01b817d8cfb9d541f35e74d2b8e6a1f3bd6674ca851aa01acb545b8ce481073f055b0d37c7ed8283ad6149b59efa56ad0fa813
6
+ metadata.gz: 8a7cba1f1cba35a7bf16bb0c2f00bbcb046a759ed372bddea33878a355bef8a7e39f8b9914645d2d25e86a36e66544632122b186b966afc7f37527d469fb3518
7
+ data.tar.gz: e58414b3291d9b60dae0d7d82f516e7b587b9005facc1b2f889a6fa0f3632111109f2cac3e434c68409765f7d31a8c7f4f12bc9f0e7c4a8de45b0622581f6c43
@@ -1,3 +1,7 @@
1
+ ## 2.4.4
2
+ - Remove activesupport dependency
3
+ - Fix request ID not being propagated
4
+
1
5
  ## 2.4.3
2
6
  - Support query methods on GarageClient::Resource
3
7
  - Use Module#module_parent_name for Rails 6.0
@@ -16,7 +16,6 @@ Gem::Specification.new do |s|
16
16
  s.authors = ['Cookpad Inc.']
17
17
  s.email = ['kaihatsu@cookpad.com']
18
18
 
19
- s.add_dependency 'activesupport', '> 3.2.0'
20
19
  s.add_dependency 'faraday', '>= 0.8.0'
21
20
  s.add_dependency 'faraday_middleware'
22
21
  s.add_dependency 'hashie', '>= 1.2.0'
@@ -1,4 +1,3 @@
1
- require 'active_support/all'
2
1
  require 'faraday'
3
2
  require 'faraday_middleware'
4
3
 
@@ -2,8 +2,8 @@ module GarageClient
2
2
  module Request
3
3
  class PropagateRequestId < Faraday::Middleware
4
4
  def call(env)
5
- if Thread.current[:request_id] && !env[:request_headers]["HTTP_X_REQUEST_ID"]
6
- env[:request_headers]["HTTP_X_REQUEST_ID"] = Thread.current[:request_id]
5
+ if Thread.current[:request_id] && !env[:request_headers]["X-Request-Id"]
6
+ env[:request_headers]["X-Request-Id"] = Thread.current[:request_id]
7
7
  end
8
8
  @app.call(env)
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module GarageClient
2
- VERSION = '2.4.3'
2
+ VERSION = '2.4.4'
3
3
  end
@@ -64,10 +64,6 @@ describe GarageClient::Cachers::Base do
64
64
 
65
65
  # Check dump data. Because cache data not broken on the version up of faraday.
66
66
  describe "check Faraday::Response marshal" do
67
- specify do
68
- expect(Faraday::VERSION).to be < "1.0.0", "This spec is no longer needed. Delete this 'describe' section!"
69
- end
70
-
71
67
  context "v0.9.1's marshal data" do
72
68
  let(:res) do
73
69
  Marshal.load(File.read(File.expand_path('../fixtures/faraday_0.9.1_response.dump', __dir__)))
@@ -75,7 +71,7 @@ describe GarageClient::Cachers::Base do
75
71
 
76
72
  it "load data" do
77
73
  expect(res).to be_instance_of Faraday::Response
78
- expect(res.env[:body]).to eq fixture("example.yaml")[:body]
74
+ expect(res.env[:body]).to eq fixture("example.yaml")["body"]
79
75
  end
80
76
  end
81
77
 
@@ -86,7 +82,7 @@ describe GarageClient::Cachers::Base do
86
82
 
87
83
  it "load data" do
88
84
  expect(res).to be_instance_of Faraday::Response
89
- expect(res.env[:body]).to eq fixture("example.yaml")[:body]
85
+ expect(res.env[:body]).to eq fixture("example.yaml")["body"]
90
86
  end
91
87
  end
92
88
  end
@@ -13,7 +13,7 @@ describe GarageClient::Request::PropagateRequestId do
13
13
  end
14
14
 
15
15
  it 'sends request_id via header' do
16
- stub_get("/examples").with(headers: { 'HTTP_X_REQUEST_ID' => 'request_id' })
16
+ stub_get("/examples").with(headers: { 'X-Request-Id' => 'request_id' })
17
17
  expect { client.get("/examples") }.not_to raise_error
18
18
  end
19
19
 
@@ -24,7 +24,7 @@ describe GarageClient::Request::PropagateRequestId do
24
24
 
25
25
  it 'does not send request_id via header' do
26
26
  stub_get("/examples").with do |request|
27
- !request.headers.include?('HTTP_X_REQUEST_ID')
27
+ !request.headers.include?('X-Request-Id')
28
28
  end
29
29
  expect { client.get("/examples") }.not_to raise_error
30
30
  end
@@ -32,11 +32,11 @@ describe GarageClient::Request::PropagateRequestId do
32
32
 
33
33
  context 'if already has request_id' do
34
34
  let(:client) do
35
- GarageClient::Client.new(headers: { 'HTTP_X_REQUEST_ID' => 'another_id' })
35
+ GarageClient::Client.new(headers: { 'X-Request-Id' => 'another_id' })
36
36
  end
37
37
 
38
38
  it 'does not overwrite request_id' do
39
- stub_get("/examples").with(headers: { 'HTTP_X_REQUEST_ID' => 'another_id' })
39
+ stub_get("/examples").with(headers: { 'X-Request-Id' => 'another_id' })
40
40
  expect { client.get("/examples") }.not_to raise_error
41
41
  end
42
42
  end
@@ -47,7 +47,7 @@ end
47
47
  def fixture(file)
48
48
  prefix = File.expand_path('../fixtures', __FILE__)
49
49
  path = File.join(prefix, file)
50
- HashWithIndifferentAccess.new(YAML.load_file(path))
50
+ YAML.load_file(path)
51
51
  end
52
52
 
53
53
  RSpec.configure do |config|
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: garage_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.3
4
+ version: 2.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cookpad Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-07 00:00:00.000000000 Z
11
+ date: 2021-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: activesupport
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">"
18
- - !ruby/object:Gem::Version
19
- version: 3.2.0
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">"
25
- - !ruby/object:Gem::Version
26
- version: 3.2.0
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: faraday
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -260,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
260
246
  - !ruby/object:Gem::Version
261
247
  version: '0'
262
248
  requirements: []
263
- rubygems_version: 3.0.3
249
+ rubygems_version: 3.1.4
264
250
  signing_key:
265
251
  specification_version: 4
266
252
  summary: Ruby client library for the Garage API