restful_resource 2.9.1 → 2.10.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 +20 -0
- data/Gemfile +0 -2
- data/Gemfile.lock +41 -38
- data/lib/restful_resource/http_client.rb +5 -0
- data/lib/restful_resource/version.rb +1 -1
- data/restful_resource.gemspec +9 -8
- data/spec/restful_resource/http_client_configuration_spec.rb +8 -8
- data/spec/spec_helper.rb +1 -0
- metadata +46 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88ffc05f6fe383a8d7e885b26498b3d56b18f4ed3e3011b07e01638ebd0b09ba
|
4
|
+
data.tar.gz: 9e2e99681e0b464332ec34361c17903ff54ed368974cd52f401fe51ebe011aea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f1650c811c5ddb2c0d992449e47d2e7c804e3b142963d43a803a252b61884c8e2514aed11e3fcd1123f68cdff3cd7752773471ddd5b8b26a12b9a0dc95688d6
|
7
|
+
data.tar.gz: 300be14f9ac06b762c3302f4e71901c82ffc86dc5a74bb3daabe63eb032a72a9ac19cca82b1f337dd37cda31f69d006adfc2cc078fcc42687e850e08d316954f
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,25 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
2.10.0
|
4
|
+
---
|
5
|
+
|
6
|
+
- Support Faraday v1 (#85)
|
7
|
+
|
8
|
+
2.9.0
|
9
|
+
---
|
10
|
+
|
11
|
+
- Add support for DELETE in RestfulResource::RailsValidations (#73)
|
12
|
+
|
13
|
+
2.8.1
|
14
|
+
---
|
15
|
+
|
16
|
+
- Looser Faraday requirement >= 0.15, < 1.1
|
17
|
+
|
18
|
+
2.8.0
|
19
|
+
---
|
20
|
+
|
21
|
+
- Make params hash in methods consistent, and always optional (#61)
|
22
|
+
|
3
23
|
2.7.0
|
4
24
|
---
|
5
25
|
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,63 +1,63 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
restful_resource (2.
|
5
|
-
activesupport
|
6
|
-
faraday (
|
7
|
-
faraday-cdn-metrics
|
4
|
+
restful_resource (2.10.0)
|
5
|
+
activesupport (~> 6.0)
|
6
|
+
faraday (~> 1.0)
|
7
|
+
faraday-cdn-metrics (~> 0.2)
|
8
8
|
faraday-encoding
|
9
|
-
faraday-http-cache
|
10
|
-
faraday_middleware
|
9
|
+
faraday-http-cache (~> 2.2)
|
10
|
+
faraday_middleware (~> 1.0)
|
11
11
|
link_header
|
12
|
-
rack
|
13
|
-
typhoeus
|
12
|
+
rack (~> 2.2)
|
13
|
+
typhoeus (~> 1.4)
|
14
14
|
|
15
15
|
GEM
|
16
16
|
remote: https://rubygems.org/
|
17
17
|
specs:
|
18
|
-
activesupport (6.0.
|
18
|
+
activesupport (6.0.3.1)
|
19
19
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
20
20
|
i18n (>= 0.7, < 2)
|
21
21
|
minitest (~> 5.1)
|
22
22
|
tzinfo (~> 1.1)
|
23
|
-
zeitwerk (~> 2.2)
|
23
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
24
24
|
ast (2.4.0)
|
25
|
-
carwow_rubocop (3.
|
25
|
+
carwow_rubocop (3.3.0)
|
26
26
|
rubocop (>= 0.78)
|
27
27
|
rubocop-performance
|
28
28
|
rubocop-rspec
|
29
29
|
coderay (1.1.2)
|
30
|
-
concurrent-ruby (1.1.
|
30
|
+
concurrent-ruby (1.1.6)
|
31
31
|
diff-lcs (1.3)
|
32
32
|
ethon (0.12.0)
|
33
33
|
ffi (>= 1.3.0)
|
34
|
-
faraday (0.
|
34
|
+
faraday (1.0.1)
|
35
35
|
multipart-post (>= 1.2, < 3)
|
36
|
-
faraday-cdn-metrics (0.
|
37
|
-
faraday (~>
|
36
|
+
faraday-cdn-metrics (0.2.0)
|
37
|
+
faraday (~> 1)
|
38
38
|
faraday-encoding (0.0.5)
|
39
39
|
faraday
|
40
|
-
faraday-http-cache (2.
|
41
|
-
faraday (
|
42
|
-
faraday_middleware (0.
|
43
|
-
faraday (
|
44
|
-
ffi (1.
|
45
|
-
i18n (1.8.
|
40
|
+
faraday-http-cache (2.2.0)
|
41
|
+
faraday (>= 0.8)
|
42
|
+
faraday_middleware (1.0.0)
|
43
|
+
faraday (~> 1.0)
|
44
|
+
ffi (1.13.0)
|
45
|
+
i18n (1.8.3)
|
46
46
|
concurrent-ruby (~> 1.0)
|
47
|
-
jaro_winkler (1.5.4)
|
48
47
|
link_header (0.0.8)
|
49
|
-
method_source (0.
|
50
|
-
minitest (5.14.
|
48
|
+
method_source (1.0.0)
|
49
|
+
minitest (5.14.1)
|
51
50
|
multipart-post (2.1.1)
|
52
51
|
parallel (1.19.1)
|
53
|
-
parser (2.7.
|
52
|
+
parser (2.7.1.2)
|
54
53
|
ast (~> 2.4.0)
|
55
|
-
pry (0.
|
56
|
-
coderay (~> 1.1
|
57
|
-
method_source (~>
|
58
|
-
rack (2.
|
54
|
+
pry (0.13.1)
|
55
|
+
coderay (~> 1.1)
|
56
|
+
method_source (~> 1.0)
|
57
|
+
rack (2.2.2)
|
59
58
|
rainbow (3.0.0)
|
60
59
|
rake (13.0.1)
|
60
|
+
rexml (3.2.4)
|
61
61
|
rspec (3.9.0)
|
62
62
|
rspec-core (~> 3.9.0)
|
63
63
|
rspec-expectations (~> 3.9.0)
|
@@ -76,25 +76,28 @@ GEM
|
|
76
76
|
rspec-support (3.9.0)
|
77
77
|
rspec_junit_formatter (0.4.1)
|
78
78
|
rspec-core (>= 2, < 4, != 2.12.0)
|
79
|
-
rubocop (0.
|
80
|
-
jaro_winkler (~> 1.5.1)
|
79
|
+
rubocop (0.84.0)
|
81
80
|
parallel (~> 1.10)
|
82
81
|
parser (>= 2.7.0.1)
|
83
82
|
rainbow (>= 2.2.2, < 4.0)
|
83
|
+
rexml
|
84
|
+
rubocop-ast (>= 0.0.3)
|
84
85
|
ruby-progressbar (~> 1.7)
|
85
|
-
unicode-display_width (>= 1.4.0, <
|
86
|
-
rubocop-
|
86
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
87
|
+
rubocop-ast (0.0.3)
|
88
|
+
parser (>= 2.7.0.1)
|
89
|
+
rubocop-performance (1.6.0)
|
87
90
|
rubocop (>= 0.71.0)
|
88
|
-
rubocop-rspec (1.
|
91
|
+
rubocop-rspec (1.39.0)
|
89
92
|
rubocop (>= 0.68.1)
|
90
93
|
ruby-progressbar (1.10.1)
|
91
94
|
thread_safe (0.3.6)
|
92
|
-
typhoeus (1.
|
95
|
+
typhoeus (1.4.0)
|
93
96
|
ethon (>= 0.9.0)
|
94
|
-
tzinfo (1.2.
|
97
|
+
tzinfo (1.2.7)
|
95
98
|
thread_safe (~> 0.1)
|
96
|
-
unicode-display_width (1.
|
97
|
-
zeitwerk (2.
|
99
|
+
unicode-display_width (1.7.0)
|
100
|
+
zeitwerk (2.3.0)
|
98
101
|
|
99
102
|
PLATFORMS
|
100
103
|
ruby
|
@@ -265,6 +265,11 @@ module RestfulResource
|
|
265
265
|
response = e.response
|
266
266
|
raise ClientError, request unless response
|
267
267
|
|
268
|
+
handle_error(request, response)
|
269
|
+
rescue Faraday::ServerError => e
|
270
|
+
response = e.response
|
271
|
+
raise ClientError, request unless response
|
272
|
+
|
268
273
|
handle_error(request, response)
|
269
274
|
end
|
270
275
|
|
data/restful_resource.gemspec
CHANGED
@@ -20,18 +20,19 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_development_dependency 'bundler'
|
22
22
|
spec.add_development_dependency 'carwow_rubocop'
|
23
|
+
spec.add_development_dependency 'pry'
|
23
24
|
spec.add_development_dependency 'rake'
|
24
25
|
spec.add_development_dependency 'rspec'
|
25
|
-
spec.add_development_dependency 'rspec_junit_formatter'
|
26
26
|
spec.add_development_dependency 'rspec-its'
|
27
|
+
spec.add_development_dependency 'rspec_junit_formatter'
|
27
28
|
|
28
|
-
spec.add_dependency 'activesupport'
|
29
|
-
spec.add_dependency 'faraday', '
|
30
|
-
spec.add_dependency 'faraday-cdn-metrics'
|
29
|
+
spec.add_dependency 'activesupport', '~> 6.0'
|
30
|
+
spec.add_dependency 'faraday', '~> 1.0'
|
31
|
+
spec.add_dependency 'faraday-cdn-metrics', '~> 0.2'
|
31
32
|
spec.add_dependency 'faraday-encoding'
|
32
|
-
spec.add_dependency 'faraday-http-cache'
|
33
|
-
spec.add_dependency 'faraday_middleware'
|
33
|
+
spec.add_dependency 'faraday-http-cache', '~> 2.2'
|
34
|
+
spec.add_dependency 'faraday_middleware', '~> 1.0'
|
34
35
|
spec.add_dependency 'link_header'
|
35
|
-
spec.add_dependency 'rack'
|
36
|
-
spec.add_dependency 'typhoeus'
|
36
|
+
spec.add_dependency 'rack', '~> 2.2'
|
37
|
+
spec.add_dependency 'typhoeus', '~> 1.4'
|
37
38
|
end
|
@@ -19,7 +19,7 @@ describe RestfulResource::HttpClient do
|
|
19
19
|
|
20
20
|
describe 'Builder configuration' do
|
21
21
|
it 'uses the typhoeus adapter' do
|
22
|
-
expect(
|
22
|
+
expect(connection.adapter).to eq Faraday::Adapter::Typhoeus
|
23
23
|
end
|
24
24
|
|
25
25
|
it 'url_encodes requests' do
|
@@ -81,13 +81,13 @@ describe RestfulResource::HttpClient do
|
|
81
81
|
described_class.new(instrumentation: { app_name: 'rails', api_name: 'api', metric_class: FakeMetrics })
|
82
82
|
|
83
83
|
expect(RestfulResource::Instrumentation).to have_received(:new)
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
84
|
+
.with(app_name: 'rails',
|
85
|
+
api_name: 'api',
|
86
|
+
request_instrument_name: 'http.api',
|
87
|
+
cache_instrument_name: 'http_cache.api',
|
88
|
+
server_cache_instrument_name: 'cdn_metrics.api',
|
89
|
+
metric_class: FakeMetrics
|
90
|
+
)
|
91
91
|
end
|
92
92
|
|
93
93
|
it 'subscribes to the notifications' do
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restful_resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Santoro
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-06-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
|
-
name:
|
43
|
+
name: pry
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - ">="
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
|
-
name:
|
57
|
+
name: rake
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - ">="
|
@@ -68,7 +68,7 @@ dependencies:
|
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
71
|
+
name: rspec
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - ">="
|
@@ -96,13 +96,13 @@ dependencies:
|
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
|
-
name:
|
99
|
+
name: rspec_junit_formatter
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
102
|
- - ">="
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
|
-
type: :
|
105
|
+
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
@@ -110,39 +110,47 @@ dependencies:
|
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
|
-
name:
|
113
|
+
name: activesupport
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
|
-
- - "
|
117
|
-
- !ruby/object:Gem::Version
|
118
|
-
version: '0.15'
|
119
|
-
- - "<"
|
116
|
+
- - "~>"
|
120
117
|
- !ruby/object:Gem::Version
|
121
|
-
version: '
|
118
|
+
version: '6.0'
|
122
119
|
type: :runtime
|
123
120
|
prerelease: false
|
124
121
|
version_requirements: !ruby/object:Gem::Requirement
|
125
122
|
requirements:
|
126
|
-
- - "
|
123
|
+
- - "~>"
|
127
124
|
- !ruby/object:Gem::Version
|
128
|
-
version: '0
|
129
|
-
|
125
|
+
version: '6.0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: faraday
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - "~>"
|
130
131
|
- !ruby/object:Gem::Version
|
131
|
-
version: '1.
|
132
|
+
version: '1.0'
|
133
|
+
type: :runtime
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - "~>"
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '1.0'
|
132
140
|
- !ruby/object:Gem::Dependency
|
133
141
|
name: faraday-cdn-metrics
|
134
142
|
requirement: !ruby/object:Gem::Requirement
|
135
143
|
requirements:
|
136
|
-
- - "
|
144
|
+
- - "~>"
|
137
145
|
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
146
|
+
version: '0.2'
|
139
147
|
type: :runtime
|
140
148
|
prerelease: false
|
141
149
|
version_requirements: !ruby/object:Gem::Requirement
|
142
150
|
requirements:
|
143
|
-
- - "
|
151
|
+
- - "~>"
|
144
152
|
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
153
|
+
version: '0.2'
|
146
154
|
- !ruby/object:Gem::Dependency
|
147
155
|
name: faraday-encoding
|
148
156
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,30 +169,30 @@ dependencies:
|
|
161
169
|
name: faraday-http-cache
|
162
170
|
requirement: !ruby/object:Gem::Requirement
|
163
171
|
requirements:
|
164
|
-
- - "
|
172
|
+
- - "~>"
|
165
173
|
- !ruby/object:Gem::Version
|
166
|
-
version: '
|
174
|
+
version: '2.2'
|
167
175
|
type: :runtime
|
168
176
|
prerelease: false
|
169
177
|
version_requirements: !ruby/object:Gem::Requirement
|
170
178
|
requirements:
|
171
|
-
- - "
|
179
|
+
- - "~>"
|
172
180
|
- !ruby/object:Gem::Version
|
173
|
-
version: '
|
181
|
+
version: '2.2'
|
174
182
|
- !ruby/object:Gem::Dependency
|
175
183
|
name: faraday_middleware
|
176
184
|
requirement: !ruby/object:Gem::Requirement
|
177
185
|
requirements:
|
178
|
-
- - "
|
186
|
+
- - "~>"
|
179
187
|
- !ruby/object:Gem::Version
|
180
|
-
version: '0'
|
188
|
+
version: '1.0'
|
181
189
|
type: :runtime
|
182
190
|
prerelease: false
|
183
191
|
version_requirements: !ruby/object:Gem::Requirement
|
184
192
|
requirements:
|
185
|
-
- - "
|
193
|
+
- - "~>"
|
186
194
|
- !ruby/object:Gem::Version
|
187
|
-
version: '0'
|
195
|
+
version: '1.0'
|
188
196
|
- !ruby/object:Gem::Dependency
|
189
197
|
name: link_header
|
190
198
|
requirement: !ruby/object:Gem::Requirement
|
@@ -203,30 +211,30 @@ dependencies:
|
|
203
211
|
name: rack
|
204
212
|
requirement: !ruby/object:Gem::Requirement
|
205
213
|
requirements:
|
206
|
-
- - "
|
214
|
+
- - "~>"
|
207
215
|
- !ruby/object:Gem::Version
|
208
|
-
version: '
|
216
|
+
version: '2.2'
|
209
217
|
type: :runtime
|
210
218
|
prerelease: false
|
211
219
|
version_requirements: !ruby/object:Gem::Requirement
|
212
220
|
requirements:
|
213
|
-
- - "
|
221
|
+
- - "~>"
|
214
222
|
- !ruby/object:Gem::Version
|
215
|
-
version: '
|
223
|
+
version: '2.2'
|
216
224
|
- !ruby/object:Gem::Dependency
|
217
225
|
name: typhoeus
|
218
226
|
requirement: !ruby/object:Gem::Requirement
|
219
227
|
requirements:
|
220
|
-
- - "
|
228
|
+
- - "~>"
|
221
229
|
- !ruby/object:Gem::Version
|
222
|
-
version: '
|
230
|
+
version: '1.4'
|
223
231
|
type: :runtime
|
224
232
|
prerelease: false
|
225
233
|
version_requirements: !ruby/object:Gem::Requirement
|
226
234
|
requirements:
|
227
|
-
- - "
|
235
|
+
- - "~>"
|
228
236
|
- !ruby/object:Gem::Version
|
229
|
-
version: '
|
237
|
+
version: '1.4'
|
230
238
|
description: A simple activerecord inspired rest resource base class implemented using
|
231
239
|
rest-client
|
232
240
|
email:
|
@@ -295,7 +303,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
295
303
|
- !ruby/object:Gem::Version
|
296
304
|
version: '0'
|
297
305
|
requirements: []
|
298
|
-
rubygems_version: 3.
|
306
|
+
rubygems_version: 3.1.2
|
299
307
|
signing_key:
|
300
308
|
specification_version: 4
|
301
309
|
summary: A simple activerecord inspired rest resource base class implemented using
|