restful_resource 2.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +20 -0
- data/.codeclimate.yml +3 -0
- data/.rubocop.yml +5 -0
- data/.rubocop_todo.yml +203 -0
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/Rakefile +5 -5
- data/lib/restful_resource/associations.rb +10 -8
- data/lib/restful_resource/base.rb +36 -33
- data/lib/restful_resource/http_client.rb +50 -48
- data/lib/restful_resource/instrumentation.rb +17 -20
- data/lib/restful_resource/null_logger.rb +1 -2
- data/lib/restful_resource/open_object.rb +2 -2
- data/lib/restful_resource/paginated_array.rb +3 -1
- data/lib/restful_resource/rails_validations.rb +12 -12
- data/lib/restful_resource/redirections.rb +5 -6
- data/lib/restful_resource/request.rb +0 -1
- data/lib/restful_resource/resource_id_missing_error.rb +1 -1
- data/lib/restful_resource/response.rb +4 -2
- data/lib/restful_resource/version.rb +1 -1
- data/restful_resource.gemspec +26 -25
- data/spec/fixtures.rb +7 -7
- data/spec/restful_resource/associations_spec.rb +23 -21
- data/spec/restful_resource/base_authorization_spec.rb +6 -7
- data/spec/restful_resource/base_spec.rb +134 -117
- data/spec/restful_resource/http_client_configuration_spec.rb +20 -19
- data/spec/restful_resource/http_client_spec.rb +38 -38
- data/spec/restful_resource/open_object_spec.rb +8 -8
- data/spec/restful_resource/rails_validations_spec.rb +68 -68
- data/spec/restful_resource/redirections_spec.rb +26 -26
- data/spec/spec_helper.rb +3 -4
- metadata +44 -13
- data/circle.yml +0 -3
data/spec/spec_helper.rb
CHANGED
@@ -8,7 +8,6 @@ RSpec.configure do |config|
|
|
8
8
|
config.formatter = :progress
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
11
|
def expect_get(url, response, headers: {}, open_timeout: nil, timeout: nil)
|
13
12
|
expect(@mock_http).to receive(:get)
|
14
13
|
.with(url, headers: headers, open_timeout: open_timeout, timeout: timeout)
|
@@ -35,21 +34,21 @@ end
|
|
35
34
|
|
36
35
|
def expect_get_with_unprocessable_entity(url, response)
|
37
36
|
request = RestfulResource::Request.new(:get, url)
|
38
|
-
rest_client_response = OpenStruct.new(
|
37
|
+
rest_client_response = OpenStruct.new(body: response.body, headers: response.headers, code: response.status)
|
39
38
|
exception = RestfulResource::HttpClient::UnprocessableEntity.new(request, rest_client_response)
|
40
39
|
expect(@mock_http).to receive(:get).with(url, headers: {}, open_timeout: nil, timeout: nil).and_raise(exception)
|
41
40
|
end
|
42
41
|
|
43
42
|
def expect_put_with_unprocessable_entity(url, response, data: {})
|
44
43
|
request = RestfulResource::Request.new(:put, url, body: data)
|
45
|
-
rest_client_response = OpenStruct.new(
|
44
|
+
rest_client_response = OpenStruct.new(body: response.body, headers: response.headers, code: response.status)
|
46
45
|
exception = RestfulResource::HttpClient::UnprocessableEntity.new(request, rest_client_response)
|
47
46
|
expect(@mock_http).to receive(:put).with(url, data: data, headers: {}, open_timeout: nil, timeout: nil).and_raise(exception)
|
48
47
|
end
|
49
48
|
|
50
49
|
def expect_post_with_unprocessable_entity(url, response, data: {})
|
51
50
|
request = RestfulResource::Request.new(:put, url, body: data)
|
52
|
-
rest_client_response = OpenStruct.new(
|
51
|
+
rest_client_response = OpenStruct.new(body: response.body, headers: response.headers, code: response.status)
|
53
52
|
exception = RestfulResource::HttpClient::UnprocessableEntity.new(request, rest_client_response)
|
54
53
|
expect(@mock_http).to receive(:post).with(url, data: data, headers: {}, open_timeout: nil, timeout: nil).and_raise(exception)
|
55
54
|
end
|
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.4.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: 2018-
|
12
|
+
date: 2018-11-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -25,6 +25,20 @@ dependencies:
|
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '1.3'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: carwow_rubocop
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '2.0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '2.0'
|
28
42
|
- !ruby/object:Gem::Dependency
|
29
43
|
name: rake
|
30
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,6 +67,20 @@ dependencies:
|
|
53
67
|
- - "~>"
|
54
68
|
- !ruby/object:Gem::Version
|
55
69
|
version: '3.1'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rspec_junit_formatter
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
56
84
|
- !ruby/object:Gem::Dependency
|
57
85
|
name: rspec-its
|
58
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -68,7 +96,7 @@ dependencies:
|
|
68
96
|
- !ruby/object:Gem::Version
|
69
97
|
version: '0'
|
70
98
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
99
|
+
name: activesupport
|
72
100
|
requirement: !ruby/object:Gem::Requirement
|
73
101
|
requirements:
|
74
102
|
- - ">="
|
@@ -82,7 +110,7 @@ dependencies:
|
|
82
110
|
- !ruby/object:Gem::Version
|
83
111
|
version: '0'
|
84
112
|
- !ruby/object:Gem::Dependency
|
85
|
-
name:
|
113
|
+
name: faraday
|
86
114
|
requirement: !ruby/object:Gem::Requirement
|
87
115
|
requirements:
|
88
116
|
- - ">="
|
@@ -96,7 +124,7 @@ dependencies:
|
|
96
124
|
- !ruby/object:Gem::Version
|
97
125
|
version: '0'
|
98
126
|
- !ruby/object:Gem::Dependency
|
99
|
-
name: faraday-
|
127
|
+
name: faraday-cdn-metrics
|
100
128
|
requirement: !ruby/object:Gem::Requirement
|
101
129
|
requirements:
|
102
130
|
- - ">="
|
@@ -124,7 +152,7 @@ dependencies:
|
|
124
152
|
- !ruby/object:Gem::Version
|
125
153
|
version: '0'
|
126
154
|
- !ruby/object:Gem::Dependency
|
127
|
-
name:
|
155
|
+
name: faraday-http-cache
|
128
156
|
requirement: !ruby/object:Gem::Requirement
|
129
157
|
requirements:
|
130
158
|
- - ">="
|
@@ -138,7 +166,7 @@ dependencies:
|
|
138
166
|
- !ruby/object:Gem::Version
|
139
167
|
version: '0'
|
140
168
|
- !ruby/object:Gem::Dependency
|
141
|
-
name:
|
169
|
+
name: faraday_middleware
|
142
170
|
requirement: !ruby/object:Gem::Requirement
|
143
171
|
requirements:
|
144
172
|
- - ">="
|
@@ -152,7 +180,7 @@ dependencies:
|
|
152
180
|
- !ruby/object:Gem::Version
|
153
181
|
version: '0'
|
154
182
|
- !ruby/object:Gem::Dependency
|
155
|
-
name:
|
183
|
+
name: link_header
|
156
184
|
requirement: !ruby/object:Gem::Requirement
|
157
185
|
requirements:
|
158
186
|
- - ">="
|
@@ -166,7 +194,7 @@ dependencies:
|
|
166
194
|
- !ruby/object:Gem::Version
|
167
195
|
version: '0'
|
168
196
|
- !ruby/object:Gem::Dependency
|
169
|
-
name:
|
197
|
+
name: rack
|
170
198
|
requirement: !ruby/object:Gem::Requirement
|
171
199
|
requirements:
|
172
200
|
- - ">="
|
@@ -180,7 +208,7 @@ dependencies:
|
|
180
208
|
- !ruby/object:Gem::Version
|
181
209
|
version: '0'
|
182
210
|
- !ruby/object:Gem::Dependency
|
183
|
-
name:
|
211
|
+
name: typhoeus
|
184
212
|
requirement: !ruby/object:Gem::Requirement
|
185
213
|
requirements:
|
186
214
|
- - ">="
|
@@ -202,14 +230,17 @@ executables:
|
|
202
230
|
extensions: []
|
203
231
|
extra_rdoc_files: []
|
204
232
|
files:
|
233
|
+
- ".circleci/config.yml"
|
234
|
+
- ".codeclimate.yml"
|
205
235
|
- ".gitignore"
|
236
|
+
- ".rubocop.yml"
|
237
|
+
- ".rubocop_todo.yml"
|
206
238
|
- CHANGELOG.md
|
207
239
|
- Gemfile
|
208
240
|
- LICENSE.txt
|
209
241
|
- README.md
|
210
242
|
- Rakefile
|
211
243
|
- bin/console
|
212
|
-
- circle.yml
|
213
244
|
- lib/restful_resource.rb
|
214
245
|
- lib/restful_resource/associations.rb
|
215
246
|
- lib/restful_resource/authorization.rb
|
@@ -250,7 +281,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
250
281
|
requirements:
|
251
282
|
- - ">="
|
252
283
|
- !ruby/object:Gem::Version
|
253
|
-
version: '2.
|
284
|
+
version: '2.4'
|
254
285
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
255
286
|
requirements:
|
256
287
|
- - ">="
|
@@ -258,7 +289,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
258
289
|
version: '0'
|
259
290
|
requirements: []
|
260
291
|
rubyforge_project:
|
261
|
-
rubygems_version: 2.7.
|
292
|
+
rubygems_version: 2.7.6
|
262
293
|
signing_key:
|
263
294
|
specification_version: 4
|
264
295
|
summary: A simple activerecord inspired rest resource base class implemented using
|
data/circle.yml
DELETED