restful_resource 2.8.0 → 2.11.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: c511ad574a9784552504e068391cf15f73bdbbf4f89c42d725ecfd64221e772f
4
- data.tar.gz: 84ac5026baabbe9433a51f4cac7e01e79c8ce28fb9a2175d98277024de0d76b6
3
+ metadata.gz: cb7770b52ca814a51c3171c5ea4e8306183f686ac5515c0f7693e7b76b3642f3
4
+ data.tar.gz: 921c17d8e377fa82977e67819041b457735d4f331103e693b96f446b47999b75
5
5
  SHA512:
6
- metadata.gz: ab6abfd19fa1cc2466d44583741f806616d338d865139860b8d088b7a9dd2a021d70966d59d2bb10839e13cc26d8c0f715c5d87c7061c9b9c9dcbad75df28c49
7
- data.tar.gz: d2b5848f1554b203817b026141db8853b774a655d50e1a8766ab19bb2c09e735c07825a7ced98274dadb9834c9209da029eb4e0a8d6dff72b9befe074bb92765
6
+ metadata.gz: 05c7ae1b588c74b3a813827ea2ff8ca7420f645cd1fa5cfc125f224214b600d9ad5a366d5660467e1dba0a07a2961cc93488f465d1afefce0707f925fd77f8f0
7
+ data.tar.gz: '000409a57d6b9d24b414a1112a6b6fb328b265216951aeb974c8578ae650df402f0d06024eb51a959cd5bad6d6fb3e66a49af7a60a7b8eeb052831a88696c051'
data/.circleci/config.yml CHANGED
@@ -2,7 +2,7 @@ version: 2
2
2
  jobs:
3
3
  build:
4
4
  docker:
5
- - image: circleci/ruby:2.6
5
+ - image: circleci/ruby:2.7
6
6
  steps:
7
7
  - checkout
8
8
  - run:
data/.rubocop_todo.yml CHANGED
@@ -1,130 +1,132 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2018-09-11 09:24:50 +0000 using RuboCop version 0.59.0.
3
+ # on 2020-11-12 16:45:32 UTC using RuboCop version 1.3.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
+ # Offense count: 1
10
+ # Configuration parameters: Include.
11
+ # Include: **/*.gemspec
12
+ Gemspec/RequiredRubyVersion:
13
+ Exclude:
14
+ - 'restful_resource.gemspec'
15
+
16
+ # Offense count: 2
17
+ # Cop supports --auto-correct.
18
+ # Configuration parameters: Width, IgnoredPatterns.
19
+ Layout/IndentationWidth:
20
+ Exclude:
21
+ - 'lib/restful_resource/associations.rb'
22
+
9
23
  # Offense count: 2
10
24
  # Cop supports --auto-correct.
11
25
  Layout/RescueEnsureAlignment:
12
26
  Exclude:
13
27
  - 'lib/restful_resource/associations.rb'
14
28
 
15
- # Offense count: 10
16
- Lint/IneffectiveAccessModifier:
29
+ # Offense count: 2
30
+ # Cop supports --auto-correct.
31
+ # Configuration parameters: EnforcedStyleForEmptyBraces.
32
+ # SupportedStyles: space, no_space, compact
33
+ # SupportedStylesForEmptyBraces: space, no_space
34
+ Layout/SpaceInsideHashLiteralBraces:
35
+ EnforcedStyle: space
36
+
37
+ # Offense count: 6
38
+ # Configuration parameters: AllowedMethods.
39
+ Lint/ConstantDefinitionInBlock:
17
40
  Exclude:
18
- - 'lib/restful_resource/base.rb'
41
+ - 'spec/restful_resource/base_authorization_spec.rb'
42
+ - 'spec/restful_resource/http_client_configuration_spec.rb'
19
43
 
20
44
  # Offense count: 1
45
+ Lint/DuplicateBranch:
46
+ Exclude:
47
+ - 'lib/restful_resource/http_client.rb'
48
+
49
+ # Offense count: 1
50
+ # Cop supports --auto-correct.
21
51
  Lint/Loop:
22
52
  Exclude:
23
53
  - 'lib/restful_resource/base.rb'
24
54
 
25
55
  # Offense count: 2
26
- Lint/ParenthesesAsGroupedExpression:
56
+ Lint/MissingSuper:
27
57
  Exclude:
28
- - 'spec/restful_resource/base_spec.rb'
58
+ - 'lib/restful_resource/http_client.rb'
59
+ - 'lib/restful_resource/parameter_missing_error.rb'
29
60
 
30
61
  # Offense count: 2
31
62
  # Cop supports --auto-correct.
32
- # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
63
+ # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
33
64
  Lint/UnusedMethodArgument:
34
65
  Exclude:
35
66
  - 'lib/restful_resource/redirections.rb'
36
67
 
37
- # Offense count: 3
38
- # Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
39
- Lint/UselessAccessModifier:
40
- Exclude:
41
- - 'lib/restful_resource/base.rb'
42
- - 'lib/restful_resource/redirections.rb'
43
-
44
- # Offense count: 5
68
+ # Offense count: 4
45
69
  Lint/UselessAssignment:
46
70
  Exclude:
47
- - 'lib/restful_resource/rails_validations.rb'
48
71
  - 'lib/restful_resource/redirections.rb'
49
72
  - 'spec/restful_resource/base_spec.rb'
73
+ - 'spec/restful_resource/http_client_spec.rb'
50
74
  - 'spec/restful_resource/redirections_spec.rb'
51
75
 
52
76
  # Offense count: 8
77
+ # Configuration parameters: IgnoredMethods.
53
78
  Metrics/AbcSize:
54
- Max: 101
55
-
56
- # Offense count: 1
57
- # Configuration parameters: CountComments, ExcludedMethods.
58
- # ExcludedMethods: refine
59
- Metrics/BlockLength:
60
- Max: 27
79
+ Max: 102
61
80
 
62
81
  # Offense count: 2
63
- # Configuration parameters: CountComments.
82
+ # Configuration parameters: CountComments, CountAsOne.
64
83
  Metrics/ClassLength:
65
- Max: 162
84
+ Max: 195
66
85
 
67
- # Offense count: 2
86
+ # Offense count: 5
87
+ # Configuration parameters: IgnoredMethods.
68
88
  Metrics/CyclomaticComplexity:
69
89
  Max: 13
70
90
 
71
- # Offense count: 42
72
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
73
- # URISchemes: http, https
74
- Metrics/LineLength:
75
- Max: 201
76
-
77
91
  # Offense count: 10
78
- # Configuration parameters: CountComments.
92
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
79
93
  Metrics/MethodLength:
80
94
  Max: 56
81
95
 
82
- # Offense count: 8
96
+ # Offense count: 9
83
97
  # Configuration parameters: CountKeywordArgs.
84
98
  Metrics/ParameterLists:
85
- Max: 10
99
+ Max: 11
86
100
 
87
- # Offense count: 1
101
+ # Offense count: 2
102
+ # Configuration parameters: IgnoredMethods.
88
103
  Metrics/PerceivedComplexity:
89
- Max: 8
104
+ Max: 11
90
105
 
91
106
  # Offense count: 2
92
- # Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist, MethodDefinitionMacros.
107
+ # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
93
108
  # NamePrefix: is_, has_, have_
94
- # NamePrefixBlacklist: is_, has_, have_
95
- # NameWhitelist: is_a?
109
+ # ForbiddenPrefixes: is_, has_, have_
110
+ # AllowedMethods: is_a?
96
111
  # MethodDefinitionMacros: define_method, define_singleton_method
97
112
  Naming/PredicateName:
98
113
  Exclude:
99
114
  - 'spec/**/*'
100
115
  - 'lib/restful_resource/associations.rb'
101
116
 
102
- # Offense count: 14
103
- # Configuration parameters: Prefixes.
104
- # Prefixes: when, with, without
105
- RSpec/ContextWording:
106
- Exclude:
107
- - 'spec/restful_resource/http_client_configuration_spec.rb'
108
- - 'spec/restful_resource/rails_validations_spec.rb'
109
- - 'spec/restful_resource/request_spec.rb'
110
-
111
117
  # Offense count: 1
112
118
  RSpec/DescribeMethod:
113
119
  Exclude:
114
120
  - 'spec/restful_resource/base_authorization_spec.rb'
115
121
 
116
- # Offense count: 19
122
+ # Offense count: 2
117
123
  # Configuration parameters: Max.
118
124
  RSpec/ExampleLength:
119
125
  Exclude:
120
126
  - 'spec/restful_resource/base_spec.rb'
121
- - 'spec/restful_resource/http_client_configuration_spec.rb'
122
- - 'spec/restful_resource/http_client_spec.rb'
123
127
  - 'spec/restful_resource/open_object_spec.rb'
124
- - 'spec/restful_resource/rails_validations_spec.rb'
125
- - 'spec/restful_resource/redirections_spec.rb'
126
128
 
127
- # Offense count: 53
129
+ # Offense count: 71
128
130
  # Configuration parameters: AssignmentOnly.
129
131
  RSpec/InstanceVariable:
130
132
  Exclude:
@@ -134,7 +136,13 @@ RSpec/InstanceVariable:
134
136
  - 'spec/restful_resource/rails_validations_spec.rb'
135
137
  - 'spec/restful_resource/redirections_spec.rb'
136
138
 
137
- # Offense count: 14
139
+ # Offense count: 6
140
+ RSpec/LeakyConstantDeclaration:
141
+ Exclude:
142
+ - 'spec/restful_resource/base_authorization_spec.rb'
143
+ - 'spec/restful_resource/http_client_configuration_spec.rb'
144
+
145
+ # Offense count: 17
138
146
  # Configuration parameters: EnforcedStyle.
139
147
  # SupportedStyles: have_received, receive
140
148
  RSpec/MessageSpies:
@@ -143,27 +151,38 @@ RSpec/MessageSpies:
143
151
  - 'spec/restful_resource/redirections_spec.rb'
144
152
  - 'spec/spec_helper.rb'
145
153
 
146
- # Offense count: 22
147
- # Configuration parameters: AggregateFailuresByDefault.
154
+ # Offense count: 24
148
155
  RSpec/MultipleExpectations:
149
156
  Max: 7
150
157
 
151
- # Offense count: 6
158
+ # Offense count: 1
159
+ # Configuration parameters: AllowSubject.
160
+ RSpec/MultipleMemoizedHelpers:
161
+ Max: 10
162
+
163
+ # Offense count: 13
164
+ # Configuration parameters: IgnoreSharedExamples.
152
165
  RSpec/NamedSubject:
153
166
  Exclude:
167
+ - 'spec/restful_resource/rails_validations_spec.rb'
154
168
  - 'spec/restful_resource/redirections_spec.rb'
155
169
 
156
- # Offense count: 10
170
+ # Offense count: 12
157
171
  RSpec/NestedGroups:
158
172
  Max: 5
159
173
 
160
- # Offense count: 2
174
+ # Offense count: 4
161
175
  RSpec/RepeatedDescription:
162
176
  Exclude:
163
177
  - 'spec/restful_resource/base_spec.rb'
164
178
 
165
- # Offense count: 3
166
- # Configuration parameters: IgnoreSymbolicNames.
179
+ # Offense count: 10
180
+ RSpec/StubbedMock:
181
+ Exclude:
182
+ - 'spec/spec_helper.rb'
183
+
184
+ # Offense count: 4
185
+ # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
167
186
  RSpec/VerifiedDoubles:
168
187
  Exclude:
169
188
  - 'spec/restful_resource/base_spec.rb'
@@ -176,28 +195,58 @@ Style/AsciiComments:
176
195
  Exclude:
177
196
  - 'lib/restful_resource/instrumentation.rb'
178
197
 
198
+ # Offense count: 3
199
+ # Cop supports --auto-correct.
200
+ # Configuration parameters: Keywords.
201
+ # Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE
202
+ Style/CommentAnnotation:
203
+ Exclude:
204
+ - 'spec/restful_resource/http_client_spec.rb'
205
+
179
206
  # Offense count: 1
180
- Style/MethodMissingSuper:
207
+ # Cop supports --auto-correct.
208
+ # Configuration parameters: EnforcedStyle.
209
+ # SupportedStyles: braces, no_braces
210
+ Style/HashAsLastArrayItem:
181
211
  Exclude:
182
- - 'lib/restful_resource/open_object.rb'
212
+ - 'lib/restful_resource/base.rb'
183
213
 
184
214
  # Offense count: 1
185
215
  Style/MissingRespondToMissing:
186
216
  Exclude:
187
217
  - 'lib/restful_resource/open_object.rb'
188
218
 
219
+ # Offense count: 2
220
+ # Configuration parameters: AllowedMethods.
221
+ # AllowedMethods: respond_to_missing?
222
+ Style/OptionalBooleanParameter:
223
+ Exclude:
224
+ - 'lib/restful_resource/open_object.rb'
225
+
189
226
  # Offense count: 1
190
227
  # Cop supports --auto-correct.
191
- # Configuration parameters: EnforcedStyle, AllowInnerSlashes.
192
- # SupportedStyles: slashes, percent_r, mixed
193
- Style/RegexpLiteral:
228
+ Style/RedundantFileExtensionInRequire:
229
+ Exclude:
230
+ - 'lib/restful_resource.rb'
231
+
232
+ # Offense count: 2
233
+ # Cop supports --auto-correct.
234
+ Style/StringConcatenation:
194
235
  Exclude:
236
+ - 'lib/restful_resource/authorization.rb'
195
237
  - 'lib/restful_resource/base.rb'
196
238
 
197
239
  # Offense count: 1
198
240
  # Cop supports --auto-correct.
199
- # Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, Whitelist.
200
- # Whitelist: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym
241
+ # Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, AllowedMethods.
242
+ # AllowedMethods: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym
201
243
  Style/TrivialAccessors:
202
244
  Exclude:
203
245
  - 'lib/restful_resource/base.rb'
246
+
247
+ # Offense count: 29
248
+ # Cop supports --auto-correct.
249
+ # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
250
+ # URISchemes: http, https
251
+ Layout/LineLength:
252
+ Max: 201
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
@@ -1,5 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
-
5
- gem 'pry'
data/Gemfile.lock CHANGED
@@ -1,100 +1,110 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- restful_resource (2.8.0)
5
- activesupport
6
- faraday (~> 0.15.0)
7
- faraday-cdn-metrics
4
+ restful_resource (2.11.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.1)
18
+ activesupport (6.1.3)
19
19
  concurrent-ruby (~> 1.0, >= 1.0.2)
20
- i18n (>= 0.7, < 2)
21
- minitest (~> 5.1)
22
- tzinfo (~> 1.1)
23
- zeitwerk (~> 2.2)
24
- ast (2.4.0)
25
- carwow_rubocop (3.0.4)
26
- rubocop (>= 0.68)
20
+ i18n (>= 1.6, < 2)
21
+ minitest (>= 5.1)
22
+ tzinfo (~> 2.0)
23
+ zeitwerk (~> 2.3)
24
+ ast (2.4.1)
25
+ carwow_rubocop (3.4.1)
26
+ rubocop (>= 0.93)
27
27
  rubocop-performance
28
28
  rubocop-rspec
29
29
  coderay (1.1.2)
30
- concurrent-ruby (1.1.5)
31
- diff-lcs (1.3)
30
+ concurrent-ruby (1.1.8)
31
+ diff-lcs (1.4.4)
32
32
  ethon (0.12.0)
33
33
  ffi (>= 1.3.0)
34
- faraday (0.15.4)
34
+ faraday (1.3.0)
35
+ faraday-net_http (~> 1.0)
35
36
  multipart-post (>= 1.2, < 3)
36
- faraday-cdn-metrics (0.1.0)
37
- faraday (~> 0.11)
37
+ ruby2_keywords
38
+ faraday-cdn-metrics (0.2.0)
39
+ faraday (~> 1)
38
40
  faraday-encoding (0.0.5)
39
41
  faraday
40
- faraday-http-cache (2.0.0)
41
- faraday (~> 0.8)
42
- faraday_middleware (0.13.1)
43
- faraday (>= 0.7.4, < 1.0)
44
- ffi (1.11.2)
45
- i18n (1.7.0)
42
+ faraday-http-cache (2.2.0)
43
+ faraday (>= 0.8)
44
+ faraday-net_http (1.0.1)
45
+ faraday_middleware (1.0.0)
46
+ faraday (~> 1.0)
47
+ ffi (1.14.2)
48
+ i18n (1.8.9)
46
49
  concurrent-ruby (~> 1.0)
47
- jaro_winkler (1.5.3)
48
50
  link_header (0.0.8)
49
- method_source (0.9.2)
50
- minitest (5.13.0)
51
+ method_source (1.0.0)
52
+ minitest (5.14.3)
51
53
  multipart-post (2.1.1)
52
- parallel (1.18.0)
53
- parser (2.6.5.0)
54
- ast (~> 2.4.0)
55
- pry (0.12.2)
56
- coderay (~> 1.1.0)
57
- method_source (~> 0.9.0)
58
- rack (2.0.7)
54
+ parallel (1.20.0)
55
+ parser (2.7.2.0)
56
+ ast (~> 2.4.1)
57
+ pry (0.13.1)
58
+ coderay (~> 1.1)
59
+ method_source (~> 1.0)
60
+ rack (2.2.3)
59
61
  rainbow (3.0.0)
60
- rake (13.0.0)
61
- rspec (3.9.0)
62
- rspec-core (~> 3.9.0)
63
- rspec-expectations (~> 3.9.0)
64
- rspec-mocks (~> 3.9.0)
65
- rspec-core (3.9.0)
66
- rspec-support (~> 3.9.0)
67
- rspec-expectations (3.9.0)
62
+ rake (13.0.3)
63
+ regexp_parser (1.8.2)
64
+ rexml (3.2.4)
65
+ rspec (3.10.0)
66
+ rspec-core (~> 3.10.0)
67
+ rspec-expectations (~> 3.10.0)
68
+ rspec-mocks (~> 3.10.0)
69
+ rspec-core (3.10.0)
70
+ rspec-support (~> 3.10.0)
71
+ rspec-expectations (3.10.0)
68
72
  diff-lcs (>= 1.2.0, < 2.0)
69
- rspec-support (~> 3.9.0)
73
+ rspec-support (~> 3.10.0)
70
74
  rspec-its (1.3.0)
71
75
  rspec-core (>= 3.0.0)
72
76
  rspec-expectations (>= 3.0.0)
73
- rspec-mocks (3.9.0)
77
+ rspec-mocks (3.10.0)
74
78
  diff-lcs (>= 1.2.0, < 2.0)
75
- rspec-support (~> 3.9.0)
76
- rspec-support (3.9.0)
79
+ rspec-support (~> 3.10.0)
80
+ rspec-support (3.10.0)
77
81
  rspec_junit_formatter (0.4.1)
78
82
  rspec-core (>= 2, < 4, != 2.12.0)
79
- rubocop (0.75.1)
80
- jaro_winkler (~> 1.5.1)
83
+ rubocop (1.3.0)
81
84
  parallel (~> 1.10)
82
- parser (>= 2.6)
85
+ parser (>= 2.7.1.5)
83
86
  rainbow (>= 2.2.2, < 4.0)
87
+ regexp_parser (>= 1.8)
88
+ rexml
89
+ rubocop-ast (>= 1.1.1)
84
90
  ruby-progressbar (~> 1.7)
85
- unicode-display_width (>= 1.4.0, < 1.7)
86
- rubocop-performance (1.5.0)
87
- rubocop (>= 0.71.0)
88
- rubocop-rspec (1.36.0)
89
- rubocop (>= 0.68.1)
91
+ unicode-display_width (>= 1.4.0, < 2.0)
92
+ rubocop-ast (1.1.1)
93
+ parser (>= 2.7.1.5)
94
+ rubocop-performance (1.8.1)
95
+ rubocop (>= 0.87.0)
96
+ rubocop-ast (>= 0.4.0)
97
+ rubocop-rspec (2.0.0)
98
+ rubocop (~> 1.0)
99
+ rubocop-ast (>= 1.1.0)
90
100
  ruby-progressbar (1.10.1)
91
- thread_safe (0.3.6)
92
- typhoeus (1.3.1)
101
+ ruby2_keywords (0.0.4)
102
+ typhoeus (1.4.0)
93
103
  ethon (>= 0.9.0)
94
- tzinfo (1.2.5)
95
- thread_safe (~> 0.1)
96
- unicode-display_width (1.6.0)
97
- zeitwerk (2.2.1)
104
+ tzinfo (2.0.4)
105
+ concurrent-ruby (~> 1.0)
106
+ unicode-display_width (1.7.0)
107
+ zeitwerk (2.4.2)
98
108
 
99
109
  PLATFORMS
100
110
  ruby
@@ -110,4 +120,4 @@ DEPENDENCIES
110
120
  rspec_junit_formatter
111
121
 
112
122
  BUNDLED WITH
113
- 2.0.2
123
+ 2.1.4