confrater 0.0.4 → 0.0.6

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: e32d57771b474557bc23dc628c8b7568fa485d891ab8fd89386dad799f69106a
4
- data.tar.gz: dde2ef47e0ac604df0011dfce1c5ee33b2c6a4291cc5fa7ba2d489fa3f97b102
3
+ metadata.gz: 9a5e2ddbcfd6b1036dcca493cc5eb5fbb8d3b6b038c9f1e417497c2b4bb8bca4
4
+ data.tar.gz: c3ca0e68920cca805be5ceb85a91ac88d2a209a58e68314df2fd9f5e0e0088ef
5
5
  SHA512:
6
- metadata.gz: bd91d74fc584773a592b18ffbb78f81181918f291638bd5256f979e7e6254168e5b2d25f998e56e79250635f73293dcfe58cfbbcc771759520208249fd038ba9
7
- data.tar.gz: 3d6624237336b0eaa91a25f30e8ba132d60590ef2c4da26fa9a0d7f7223d4965cf8ba7139643a4d1c7dfe16e8e39cb50f8aba3ab0cf51dcf746997ea0d19f65d
6
+ metadata.gz: 3df8c95305755e8c4bc510a5d3762dad99c3942a8a9383475b1ab9fac4eefdb20d0fdbfadb4f846b5fc59fe31436e3f7c5d3b3b364740b9402258de0803d3cfb
7
+ data.tar.gz: c7460e3b74834a894b80c60374f686482cf3df792ca78fa6300cfe8482e8b49d95ebe57b6d19b471380094902456575327573f8fc6352fea358b8c03ba2ce817
data/Gemfile CHANGED
@@ -1,8 +1,3 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- platforms :rbx do
4
- gem 'rubysl'
5
- gem 'rubinius-developer_tools'
6
- end
7
-
8
3
  gemspec
@@ -116,7 +116,7 @@ module Confrater
116
116
  error_params = {}
117
117
 
118
118
  begin
119
- if error.is_a?(Faraday::Error::ClientError) && error.response
119
+ if error.is_a?(Faraday::ClientError) && error.response
120
120
  error_params[:status_code] = error.response[:status]
121
121
  error_params[:raw_body] = error.response[:body]
122
122
 
@@ -153,15 +153,14 @@ module Confrater
153
153
  end
154
154
 
155
155
  def rest_client
156
- client = Faraday.new(self.api_url, proxy: self.proxy, ssl: { version: "TLSv1_2" }) do |faraday|
156
+ Faraday.new(self.api_url, proxy: self.proxy, ssl: { version: "TLSv1_2" }) do |faraday|
157
157
  faraday.response :raise_error
158
158
  faraday.adapter adapter
159
159
  if @request_builder.debug
160
160
  faraday.response :logger, @request_builder.logger, bodies: true
161
161
  end
162
+ faraday.request :authorization, :basic, self.username, self.password
162
163
  end
163
- client.basic_auth self.username, self.password
164
- client
165
164
  end
166
165
 
167
166
  def parse_response(response)
@@ -1,3 +1,3 @@
1
1
  module Confrater
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -11,13 +11,13 @@ describe Confrater::APIRequest do
11
11
  end
12
12
 
13
13
  it "surfaces client request exceptions as a Confrater::APIError" do
14
- exception = Faraday::Error::ClientError.new("the server responded with status 503")
14
+ exception = Faraday::ClientError.new("the server responded with status 503")
15
15
  stub_request(:get, "#{@api_root}/users").with(basic_auth: [username, password]).to_raise(exception)
16
16
  expect { @confrere.users.retrieve }.to raise_error(Confrater::APIError)
17
17
  end
18
18
 
19
19
  it "surfaces an unparseable client request exception as a Confrater::APIError" do
20
- exception = Faraday::Error::ClientError.new(
20
+ exception = Faraday::ClientError.new(
21
21
  "the server responded with status 503")
22
22
  stub_request(:get, "#{@api_root}/users").with(basic_auth: [username, password]).to_raise(exception)
23
23
  expect { @confrere.users.retrieve }.to raise_error(Confrater::APIError)
@@ -25,7 +25,7 @@ describe Confrater::APIRequest do
25
25
 
26
26
  it "surfaces an unparseable response body as a Confrater::APIError" do
27
27
  response_values = {:status => 503, :headers => {}, :body => '[foo]'}
28
- exception = Faraday::Error::ClientError.new("the server responded with status 503", response_values)
28
+ exception = Faraday::ClientError.new("the server responded with status 503", response_values)
29
29
  stub_request(:get, "#{@api_root}/users").with(basic_auth: [username, password]).to_raise(exception)
30
30
  expect { @confrere.users.retrieve }.to raise_error(Confrater::APIError)
31
31
  end
@@ -33,7 +33,7 @@ describe Confrater::APIRequest do
33
33
  context "handle_error" do
34
34
  it "includes status and raw body even when json can't be parsed" do
35
35
  response_values = {:status => 503, :headers => {}, :body => 'A non JSON response'}
36
- exception = Faraday::Error::ClientError.new("the server responded with status 503", response_values)
36
+ exception = Faraday::ClientError.new("the server responded with status 503", response_values)
37
37
  api_request = Confrater::APIRequest.new(builder: Confrater::Request)
38
38
  begin
39
39
  api_request.send :handle_error, exception
@@ -46,7 +46,7 @@ describe Confrater::APIRequest do
46
46
  context "when symbolize_keys is true" do
47
47
  it "sets title and detail on the error params" do
48
48
  response_values = {:status => 422, :headers => {}, :body => '{"title": "foo", "detail": "bar"}'}
49
- exception = Faraday::Error::ClientError.new("the server responded with status 422", response_values)
49
+ exception = Faraday::ClientError.new("the server responded with status 422", response_values)
50
50
  api_request = Confrater::APIRequest.new(builder: Confrater::Request.new(symbolize_keys: true))
51
51
  begin
52
52
  api_request.send :handle_error, exception
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: confrater
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Espen Antonsen
8
8
  - Amro Mousa
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-02-04 00:00:00.000000000 Z
12
+ date: 2024-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -82,7 +82,7 @@ dependencies:
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  description: A wrapper for Confrere API
85
- email:
85
+ email:
86
86
  executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
@@ -109,7 +109,7 @@ homepage: http://github.com/espen/confrere
109
109
  licenses:
110
110
  - MIT
111
111
  metadata: {}
112
- post_install_message:
112
+ post_install_message:
113
113
  rdoc_options: []
114
114
  require_paths:
115
115
  - lib
@@ -124,8 +124,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []
127
- rubygems_version: 3.0.2
128
- signing_key:
127
+ rubygems_version: 3.5.5
128
+ signing_key:
129
129
  specification_version: 4
130
130
  summary: A wrapper for Confrere API
131
131
  test_files: