api_client_base 1.8.0 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/lib/api_client_base/request.rb +13 -10
- data/lib/api_client_base/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b9fd36954265d22fd5c8b2ae143ccf63a54b941ffbfd4230022683501e5b674
|
4
|
+
data.tar.gz: 5bf06572c3e6c65ccc66dd6c98e650c8cd33b639f720b5cbd56a397daa8815e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4e2dcc49429d9d20a65daff58d433aeb0170e0b5b0bbf9fc2feb2121be17ea28894e8a196175e095eb8f29526042d4418e2d0822a22e1c80aecc0c8eec56638
|
7
|
+
data.tar.gz: 441e6aeeb41f95255f35522f43e558370df1cc25b6954684c5eea40b0a4d0bffb6d47e10be187b209f9fd21515f3f4559a70a7a4d557d971edbedd408a5c8491
|
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,11 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6
6
|
|
7
|
-
## [
|
7
|
+
## [1.9.0] - 2020-06-30
|
8
|
+
### Added
|
9
|
+
- Allow users to override typhoeus_options to pass any args that we haven't defined
|
10
|
+
|
11
|
+
## [1.8.0] - 2020-06-30
|
8
12
|
### Added
|
9
13
|
- Allow all Typhoeus options to be passed to BuildTyphoeusOptions. This is useful when overriding the method `typhoeus_options` in requests
|
10
14
|
|
@@ -42,7 +42,16 @@ module APIClientBase
|
|
42
42
|
def run
|
43
43
|
require "typhoeus"
|
44
44
|
if defined?(Typhoeus)
|
45
|
-
|
45
|
+
opts = BuildTyphoeusOptions.(
|
46
|
+
{
|
47
|
+
method: action,
|
48
|
+
headers: headers,
|
49
|
+
body: body,
|
50
|
+
params: params,
|
51
|
+
proxy: proxy,
|
52
|
+
}.merge(typhoeus_options)
|
53
|
+
)
|
54
|
+
request = Typhoeus::Request.new(uri, opts)
|
46
55
|
request.run
|
47
56
|
else
|
48
57
|
fail "Either override #run or make sure Typhoeus is available for use."
|
@@ -62,8 +71,8 @@ module APIClientBase
|
|
62
71
|
path = URI.parse(host).path
|
63
72
|
if path.present?
|
64
73
|
URI.join(
|
65
|
-
host,
|
66
|
-
[path, "/"].join,
|
74
|
+
host,
|
75
|
+
[path, "/"].join,
|
67
76
|
api_client_base_path[1..-1]
|
68
77
|
)
|
69
78
|
else
|
@@ -88,13 +97,7 @@ module APIClientBase
|
|
88
97
|
def before_call; end
|
89
98
|
|
90
99
|
def typhoeus_options
|
91
|
-
|
92
|
-
method: action,
|
93
|
-
headers: headers,
|
94
|
-
body: body,
|
95
|
-
params: params,
|
96
|
-
proxy: proxy,
|
97
|
-
)
|
100
|
+
{}
|
98
101
|
end
|
99
102
|
|
100
103
|
end
|