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: 810d32749cc1ee8060c90cd98bfb13fe98739617043ba428f624e1203cb446d9
4
- data.tar.gz: 90a3cb0f587a1f1bc0767080cd36d292dbd751cdd6817e6e5cc396873c3b4960
3
+ metadata.gz: 65b639c41de486bf27f118c1d6d3860b77e582d1fd03213801744e5e985938af
4
+ data.tar.gz: 7c774f56f8d550c49586ab2a1237db52bf052c0122058393566cc4f36cb8636a
5
5
  SHA512:
6
- metadata.gz: 97062be5359c222fe60a142dad7a944b26cb8eb8bf572353932ee5cbe1c8b5cd5356174c689ca45557b5ee7ecab56b1a1e3fc1f9bd71e580d9c01f943d46ca4c
7
- data.tar.gz: 99df6ebe27b699fb26a40d7069502c2e85d4afec520bfba5f202de28993631ac6198e9302c4d02b72fc5a8cd3621a3969f95be003ac139c8bfd469f4735d415f
6
+ metadata.gz: 3f2fb5535e7b62aae77d2947a7e97cf1ea58506ed7348b839864194a6d6ac4aac5222011cedb095fa16a972be3e0835bae5e6269d29f1836f02edc6ffbe3a7be
7
+ data.tar.gz: 1d85041923882d0713a2f065e25484ac4ad8992f68085a9f24296b11b6b92bdc791b3de5b44a5ed6e5dc2be520d5b5a7c9d3c5f441466fc2d082ea3ac6ffeb9f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.6.0
2
+
3
+ * Add support for faraday gem version >= 1.0.0 and < 2.0.0
4
+ * Drop support for Ruby < 2.3
5
+
1
6
  # 0.5.26
2
7
 
3
8
  * Add support for HTTP status code: 412 Precondition Failed
@@ -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::Error::ConnectionFailed => e
91
+ rescue Faraday::ConnectionFailed => e
92
92
  raise ApiClient::Errors::ConnectionFailed.new(e.message, request, response)
93
93
  end
94
94
 
@@ -1,3 +1,3 @@
1
1
  module ApiClient
2
- VERSION = '0.5.26'
2
+ VERSION = '0.6.0'
3
3
  end
@@ -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).should == ["Faraday::Request::UrlEncoded", "Faraday::Adapter::NetHttp"]
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).should == [
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).should == [
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).should == [
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.5.26
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: 2021-05-05 00:00:00.000000000 Z
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: 1.0.0
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: 1.0.0
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.2.0
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.3.0.dev
164
+ rubygems_version: 3.4.0.dev
165
165
  signing_key:
166
166
  specification_version: 3
167
167
  summary: API client builder