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 +4 -4
- data/CHANGELOG.md +4 -0
- data/garage_client.gemspec +0 -1
- data/lib/garage_client.rb +0 -1
- data/lib/garage_client/request/propagate_request_id.rb +2 -2
- data/lib/garage_client/version.rb +1 -1
- data/spec/garage_client/cacher_spec.rb +2 -6
- data/spec/garage_client/request/propagate_request_id_spec.rb +4 -4
- data/spec/spec_helper.rb +1 -1
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 580980067ed04267e85d03e5a9f0fdfef39ebac8142e9110a9bc42f622e2fb02
|
4
|
+
data.tar.gz: 59bc77a7d6499d2f22e7bb3434b0756d2315abfe104cbd883bef653fe2cda52b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a7cba1f1cba35a7bf16bb0c2f00bbcb046a759ed372bddea33878a355bef8a7e39f8b9914645d2d25e86a36e66544632122b186b966afc7f37527d469fb3518
|
7
|
+
data.tar.gz: e58414b3291d9b60dae0d7d82f516e7b587b9005facc1b2f889a6fa0f3632111109f2cac3e434c68409765f7d31a8c7f4f12bc9f0e7c4a8de45b0622581f6c43
|
data/CHANGELOG.md
CHANGED
data/garage_client.gemspec
CHANGED
@@ -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'
|
data/lib/garage_client.rb
CHANGED
@@ -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]["
|
6
|
-
env[:request_headers]["
|
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
|
@@ -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")[
|
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")[
|
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: { '
|
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?('
|
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: { '
|
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: { '
|
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
|
data/spec/spec_helper.rb
CHANGED
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.
|
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:
|
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.
|
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
|