api_client 0.5.26 → 0.6.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65b639c41de486bf27f118c1d6d3860b77e582d1fd03213801744e5e985938af
|
4
|
+
data.tar.gz: 7c774f56f8d550c49586ab2a1237db52bf052c0122058393566cc4f36cb8636a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f2fb5535e7b62aae77d2947a7e97cf1ea58506ed7348b839864194a6d6ac4aac5222011cedb095fa16a972be3e0835bae5e6269d29f1836f02edc6ffbe3a7be
|
7
|
+
data.tar.gz: 1d85041923882d0713a2f065e25484ac4ad8992f68085a9f24296b11b6b92bdc791b3de5b44a5ed6e5dc2be520d5b5a7c9d3c5f441466fc2d082ea3ac6ffeb9f
|
data/CHANGELOG.md
CHANGED
@@ -88,7 +88,7 @@ module ApiClient
|
|
88
88
|
response = @handler.send(method, path, data, headers)
|
89
89
|
request = { :method => method, :path => path, :data => data}
|
90
90
|
handle_response(request, response)
|
91
|
-
rescue Faraday::
|
91
|
+
rescue Faraday::ConnectionFailed => e
|
92
92
|
raise ApiClient::Errors::ConnectionFailed.new(e.message, request, response)
|
93
93
|
end
|
94
94
|
|
data/lib/api_client/version.rb
CHANGED
@@ -7,21 +7,21 @@ describe ApiClient::Connection::Basic do
|
|
7
7
|
instance.inspect.should == '#<ApiClient::Connection::Basic endpoint: "http://google.com">'
|
8
8
|
end
|
9
9
|
|
10
|
+
it "uses correct adapter" do
|
11
|
+
instance = ApiClient::Connection::Basic.new("http://google.com")
|
12
|
+
expect(instance.handler.builder.adapter.name).to eq("Faraday::Adapter::NetHttp")
|
13
|
+
end
|
14
|
+
|
10
15
|
it "adds basic middlewares to faraday" do
|
11
16
|
instance = ApiClient::Connection::Basic.new("http://google.com")
|
12
|
-
instance.handler.builder.handlers.collect(&:name).
|
17
|
+
expect(instance.handler.builder.handlers.collect(&:name)).to include("Faraday::Request::UrlEncoded")
|
13
18
|
end
|
14
19
|
|
15
20
|
it "adds the logger middlewares to faraday if ApiClient.logger is available" do
|
16
21
|
logger = double
|
17
22
|
ApiClient.stub(:logger).and_return(logger)
|
18
23
|
instance = ApiClient::Connection::Basic.new("http://google.com")
|
19
|
-
instance.handler.builder.handlers.collect(&:name).
|
20
|
-
"ApiClient::Connection::Middlewares::Request::Logger",
|
21
|
-
"Faraday::Request::UrlEncoded",
|
22
|
-
"Faraday::Adapter::NetHttp"
|
23
|
-
]
|
24
|
-
|
24
|
+
expect(instance.handler.builder.handlers.collect(&:name)).to include("ApiClient::Connection::Middlewares::Request::Logger", "Faraday::Request::UrlEncoded")
|
25
25
|
end
|
26
26
|
|
27
27
|
it "creates a Faraday object on initialize" do
|
@@ -2,26 +2,22 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe ApiClient::Connection::Oauth do
|
4
4
|
|
5
|
+
it "uses correct adapter" do
|
6
|
+
instance = ApiClient::Connection::Oauth.new("http://google.com")
|
7
|
+
expect(instance.handler.builder.adapter.name).to eq("Faraday::Adapter::NetHttp")
|
8
|
+
end
|
9
|
+
|
5
10
|
it "adds basic middlewares to faraday" do
|
6
11
|
instance = ApiClient::Connection::Oauth.new("http://google.com")
|
7
|
-
instance.handler.builder.handlers.collect(&:name)
|
8
|
-
"ApiClient::Connection::Middlewares::Request::OAuth",
|
9
|
-
"Faraday::Request::UrlEncoded",
|
10
|
-
"Faraday::Adapter::NetHttp"
|
11
|
-
]
|
12
|
+
expect(instance.handler.builder.handlers.collect(&:name))
|
13
|
+
.to include("ApiClient::Connection::Middlewares::Request::OAuth", "Faraday::Request::UrlEncoded")
|
12
14
|
end
|
13
15
|
|
14
16
|
it "adds the logger middlewares to faraday if ApiClient.logger is available" do
|
15
17
|
logger = double
|
16
18
|
ApiClient.stub(:logger).and_return(logger)
|
17
19
|
instance = ApiClient::Connection::Oauth.new("http://google.com")
|
18
|
-
instance.handler.builder.handlers.collect(&:name)
|
19
|
-
"ApiClient::Connection::Middlewares::Request::Logger",
|
20
|
-
"ApiClient::Connection::Middlewares::Request::OAuth",
|
21
|
-
"Faraday::Request::UrlEncoded",
|
22
|
-
"Faraday::Adapter::NetHttp"
|
23
|
-
]
|
24
|
-
|
20
|
+
expect(instance.handler.builder.handlers.collect(&:name))
|
21
|
+
.to include("ApiClient::Connection::Middlewares::Request::Logger", "ApiClient::Connection::Middlewares::Request::OAuth", "Faraday::Request::UrlEncoded")
|
25
22
|
end
|
26
|
-
|
27
23
|
end
|
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.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zendesk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -61,7 +61,7 @@ dependencies:
|
|
61
61
|
version: 0.8.1
|
62
62
|
- - "<"
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version:
|
64
|
+
version: 2.0.0
|
65
65
|
type: :runtime
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -71,7 +71,7 @@ dependencies:
|
|
71
71
|
version: 0.8.1
|
72
72
|
- - "<"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
74
|
+
version: 2.0.0
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: multi_json
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -154,14 +154,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
154
154
|
requirements:
|
155
155
|
- - ">="
|
156
156
|
- !ruby/object:Gem::Version
|
157
|
-
version: 2.
|
157
|
+
version: 2.3.8
|
158
158
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
159
|
requirements:
|
160
160
|
- - ">="
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: '0'
|
163
163
|
requirements: []
|
164
|
-
rubygems_version: 3.
|
164
|
+
rubygems_version: 3.4.0.dev
|
165
165
|
signing_key:
|
166
166
|
specification_version: 3
|
167
167
|
summary: API client builder
|