europeana-api 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-style.yml +47 -849
- data/.travis.yml +3 -0
- data/Gemfile +1 -1
- data/europeana-api.gemspec +1 -1
- data/lib/europeana/api/record.rb +2 -2
- data/lib/europeana/api/record/hierarchy/base.rb +2 -4
- data/lib/europeana/api/requestable.rb +14 -0
- data/lib/europeana/api/search.rb +2 -2
- data/lib/europeana/api/version.rb +1 -1
- data/spec/europeana/api/record_spec.rb +2 -2
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 330985d53a6b1fb63021e3144d271c09b518deab
|
4
|
+
data.tar.gz: 7d8c128ff306ba05a4f7a2a4e041c08fbce564b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66111e036999c9cabcbd0ce2bbccccf507cccca8ca6d963c8ca68deeb66d7af01588be958c7fc984aad2a88c56538e95ca6e5301562adb236d229b1517c7a393
|
7
|
+
data.tar.gz: 2d243b1d9e517e5b95a11d28e7853092421005541de037dfa824bc4b215113694d11e1e83cbfb88f2eb19fa9cae6f325646db3433f489b8c5faee1c216f2d3ec
|
data/.ruby-style.yml
CHANGED
@@ -1,88 +1,9 @@
|
|
1
1
|
AllCops:
|
2
|
-
Include:
|
3
|
-
- "**/*.rake"
|
4
|
-
- "**/Gemfile"
|
5
|
-
- "**/Rakefile"
|
6
2
|
Exclude:
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
StyleGuideCopsOnly: false
|
12
|
-
Style/AccessModifierIndentation:
|
13
|
-
Description: Check indentation of private/protected visibility modifiers.
|
14
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected
|
15
|
-
Enabled: true
|
16
|
-
EnforcedStyle: indent
|
17
|
-
SupportedStyles:
|
18
|
-
- outdent
|
19
|
-
- indent
|
20
|
-
Style/AlignHash:
|
21
|
-
Description: Align the elements of a hash literal if they span more than one line.
|
22
|
-
Enabled: true
|
23
|
-
EnforcedHashRocketStyle: key
|
24
|
-
EnforcedColonStyle: key
|
25
|
-
EnforcedLastArgumentHashStyle: always_inspect
|
26
|
-
SupportedLastArgumentHashStyles:
|
27
|
-
- always_inspect
|
28
|
-
- always_ignore
|
29
|
-
- ignore_implicit
|
30
|
-
- ignore_explicit
|
31
|
-
Style/AlignParameters:
|
32
|
-
Description: Align the parameters of a method call if they span more than one line.
|
33
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
|
34
|
-
Enabled: true
|
35
|
-
EnforcedStyle: with_first_parameter
|
36
|
-
SupportedStyles:
|
37
|
-
- with_first_parameter
|
38
|
-
- with_fixed_indentation
|
39
|
-
Style/AndOr:
|
40
|
-
Description: Use &&/|| instead of and/or.
|
41
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-and-or-or
|
42
|
-
Enabled: true
|
43
|
-
EnforcedStyle: always
|
44
|
-
SupportedStyles:
|
45
|
-
- always
|
46
|
-
- conditionals
|
47
|
-
Style/BarePercentLiterals:
|
48
|
-
Description: Checks if usage of %() or %Q() matches configuration.
|
49
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand
|
50
|
-
Enabled: true
|
51
|
-
EnforcedStyle: bare_percent
|
52
|
-
SupportedStyles:
|
53
|
-
- percent_q
|
54
|
-
- bare_percent
|
55
|
-
Style/BracesAroundHashParameters:
|
56
|
-
Description: Enforce braces style around hash parameters.
|
57
|
-
Enabled: true
|
58
|
-
EnforcedStyle: no_braces
|
59
|
-
SupportedStyles:
|
60
|
-
- braces
|
61
|
-
- no_braces
|
62
|
-
- context_dependent
|
63
|
-
Style/CaseIndentation:
|
64
|
-
Description: Indentation of when in a case/when/[else/]end.
|
65
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-when-to-case
|
66
|
-
Enabled: true
|
67
|
-
IndentWhenRelativeTo: case
|
68
|
-
SupportedStyles:
|
69
|
-
- case
|
70
|
-
- end
|
71
|
-
IndentOneStep: false
|
72
|
-
Style/ClassAndModuleChildren:
|
73
|
-
Description: Checks style of children classes and modules.
|
74
|
-
Enabled: false
|
75
|
-
EnforcedStyle: nested
|
76
|
-
SupportedStyles:
|
77
|
-
- nested
|
78
|
-
- compact
|
79
|
-
Style/ClassCheck:
|
80
|
-
Description: Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.
|
81
|
-
Enabled: true
|
82
|
-
EnforcedStyle: is_a?
|
83
|
-
SupportedStyles:
|
84
|
-
- is_a?
|
85
|
-
- kind_of?
|
3
|
+
- "vendor/**/*"
|
4
|
+
- "db/schema.rb"
|
5
|
+
UseCache: false
|
6
|
+
TargetRubyVersion: 2.3
|
86
7
|
Style/CollectionMethods:
|
87
8
|
Description: Preferred collection methods.
|
88
9
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
|
@@ -90,21 +11,9 @@ Style/CollectionMethods:
|
|
90
11
|
PreferredMethods:
|
91
12
|
collect: map
|
92
13
|
collect!: map!
|
93
|
-
inject: reduce
|
94
|
-
detect: find
|
95
|
-
find_all: select
|
96
14
|
find: detect
|
97
|
-
|
98
|
-
|
99
|
-
REVIEW).
|
100
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#annotate-keywords
|
101
|
-
Enabled: false
|
102
|
-
Keywords:
|
103
|
-
- TODO
|
104
|
-
- FIXME
|
105
|
-
- OPTIMIZE
|
106
|
-
- HACK
|
107
|
-
- REVIEW
|
15
|
+
find_all: select
|
16
|
+
reduce: inject
|
108
17
|
Style/DotPosition:
|
109
18
|
Description: Checks the position of the dot in multi-line method calls.
|
110
19
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
|
@@ -113,161 +22,24 @@ Style/DotPosition:
|
|
113
22
|
SupportedStyles:
|
114
23
|
- leading
|
115
24
|
- trailing
|
116
|
-
Style/EmptyLineBetweenDefs:
|
117
|
-
Description: Use empty lines between defs.
|
118
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods
|
119
|
-
Enabled: true
|
120
|
-
AllowAdjacentOneLineDefs: false
|
121
|
-
Style/EmptyLinesAroundBlockBody:
|
122
|
-
Description: Keeps track of empty lines around block bodies.
|
123
|
-
Enabled: true
|
124
|
-
EnforcedStyle: no_empty_lines
|
125
|
-
SupportedStyles:
|
126
|
-
- empty_lines
|
127
|
-
- no_empty_lines
|
128
|
-
Style/EmptyLinesAroundClassBody:
|
129
|
-
Description: Keeps track of empty lines around class bodies.
|
130
|
-
Enabled: true
|
131
|
-
EnforcedStyle: no_empty_lines
|
132
|
-
SupportedStyles:
|
133
|
-
- empty_lines
|
134
|
-
- no_empty_lines
|
135
|
-
Style/EmptyLinesAroundModuleBody:
|
136
|
-
Description: Keeps track of empty lines around module bodies.
|
137
|
-
Enabled: true
|
138
|
-
EnforcedStyle: no_empty_lines
|
139
|
-
SupportedStyles:
|
140
|
-
- empty_lines
|
141
|
-
- no_empty_lines
|
142
|
-
Style/Encoding:
|
143
|
-
Description: Use UTF-8 as the source file encoding.
|
144
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#utf-8
|
145
|
-
Enabled: false
|
146
|
-
EnforcedStyle: always
|
147
|
-
SupportedStyles:
|
148
|
-
- when_needed
|
149
|
-
- always
|
150
25
|
Style/FileName:
|
151
26
|
Description: Use snake_case for source file names.
|
152
27
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
|
153
28
|
Enabled: false
|
154
29
|
Exclude: []
|
155
|
-
Style/FirstParameterIndentation:
|
156
|
-
Description: Checks the indentation of the first parameter in a method call.
|
157
|
-
Enabled: true
|
158
|
-
EnforcedStyle: special_for_inner_method_call_in_parentheses
|
159
|
-
SupportedStyles:
|
160
|
-
- consistent
|
161
|
-
- special_for_inner_method_call
|
162
|
-
- special_for_inner_method_call_in_parentheses
|
163
|
-
Style/For:
|
164
|
-
Description: Checks use of for or each in multiline loops.
|
165
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-for-loops
|
166
|
-
Enabled: true
|
167
|
-
EnforcedStyle: each
|
168
|
-
SupportedStyles:
|
169
|
-
- for
|
170
|
-
- each
|
171
|
-
Style/FormatString:
|
172
|
-
Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%.
|
173
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#sprintf
|
174
|
-
Enabled: false
|
175
|
-
EnforcedStyle: format
|
176
|
-
SupportedStyles:
|
177
|
-
- format
|
178
|
-
- sprintf
|
179
|
-
- percent
|
180
|
-
Style/GlobalVars:
|
181
|
-
Description: Do not introduce global variables.
|
182
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#instance-vars
|
183
|
-
Enabled: false
|
184
|
-
AllowedVariables: []
|
185
30
|
Style/GuardClause:
|
186
31
|
Description: Check for conditionals that can be replaced with guard clauses
|
187
32
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
|
188
33
|
Enabled: false
|
189
34
|
MinBodyLength: 1
|
190
|
-
Style/HashSyntax:
|
191
|
-
Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a =>
|
192
|
-
1, :b => 2 }.'
|
193
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-literals
|
194
|
-
Enabled: true
|
195
|
-
EnforcedStyle: ruby19
|
196
|
-
SupportedStyles:
|
197
|
-
- ruby19
|
198
|
-
- hash_rockets
|
199
35
|
Style/IfUnlessModifier:
|
200
36
|
Description: Favor modifier if/unless usage when you have a single-line body.
|
201
37
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
|
202
38
|
Enabled: false
|
203
39
|
MaxLineLength: 80
|
204
|
-
Style/
|
205
|
-
Description:
|
206
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
|
207
|
-
Enabled: true
|
208
|
-
Width: 2
|
209
|
-
Style/IndentHash:
|
210
|
-
Description: Checks the indentation of the first key in a hash literal.
|
211
|
-
Enabled: true
|
212
|
-
EnforcedStyle: special_inside_parentheses
|
213
|
-
SupportedStyles:
|
214
|
-
- special_inside_parentheses
|
215
|
-
- consistent
|
216
|
-
Style/LambdaCall:
|
217
|
-
Description: Use lambda.call(...) instead of lambda.(...).
|
218
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call
|
219
|
-
Enabled: false
|
220
|
-
EnforcedStyle: call
|
221
|
-
SupportedStyles:
|
222
|
-
- call
|
223
|
-
- braces
|
224
|
-
Style/Next:
|
225
|
-
Description: Use `next` to skip iteration instead of a condition at the end.
|
226
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
|
227
|
-
Enabled: false
|
228
|
-
EnforcedStyle: skip_modifier_ifs
|
229
|
-
MinBodyLength: 3
|
230
|
-
SupportedStyles:
|
231
|
-
- skip_modifier_ifs
|
232
|
-
- always
|
233
|
-
Style/NonNilCheck:
|
234
|
-
Description: Checks for redundant nil checks.
|
235
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks
|
236
|
-
Enabled: true
|
237
|
-
IncludeSemanticChanges: false
|
238
|
-
Style/MethodDefParentheses:
|
239
|
-
Description: Checks if the method definitions have or don't have parentheses.
|
240
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
|
241
|
-
Enabled: true
|
242
|
-
EnforcedStyle: require_parentheses
|
243
|
-
SupportedStyles:
|
244
|
-
- require_parentheses
|
245
|
-
- require_no_parentheses
|
246
|
-
Style/MethodName:
|
247
|
-
Description: Use the configured style when naming methods.
|
248
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
|
249
|
-
Enabled: true
|
250
|
-
EnforcedStyle: snake_case
|
251
|
-
SupportedStyles:
|
252
|
-
- snake_case
|
253
|
-
- camelCase
|
254
|
-
Style/MultilineOperationIndentation:
|
255
|
-
Description: Checks indentation of binary operations that span more than one line.
|
256
|
-
Enabled: true
|
257
|
-
EnforcedStyle: indented
|
258
|
-
SupportedStyles:
|
259
|
-
- aligned
|
260
|
-
- indented
|
261
|
-
Style/NumericLiterals:
|
262
|
-
Description: Add underscores to large numeric literals to improve their readability.
|
263
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
|
40
|
+
Style/OptionHash:
|
41
|
+
Description: Don't use option hashes when you can use keyword arguments.
|
264
42
|
Enabled: false
|
265
|
-
MinDigits: 5
|
266
|
-
Style/ParenthesesAroundCondition:
|
267
|
-
Description: Don't use parentheses around the condition of an if/unless/while.
|
268
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-parens-if
|
269
|
-
Enabled: true
|
270
|
-
AllowSafeAssignment: true
|
271
43
|
Style/PercentLiteralDelimiters:
|
272
44
|
Description: Use `%`-literal delimiters consistently
|
273
45
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
|
@@ -282,13 +54,6 @@ Style/PercentLiteralDelimiters:
|
|
282
54
|
"%w": "()"
|
283
55
|
"%W": "()"
|
284
56
|
"%x": "()"
|
285
|
-
Style/PercentQLiterals:
|
286
|
-
Description: Checks if uses of %Q/%q match the configured preference.
|
287
|
-
Enabled: true
|
288
|
-
EnforcedStyle: lower_case_q
|
289
|
-
SupportedStyles:
|
290
|
-
- lower_case_q
|
291
|
-
- upper_case_q
|
292
57
|
Style/PredicateName:
|
293
58
|
Description: Check the names of predicate methods.
|
294
59
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
|
@@ -299,6 +64,8 @@ Style/PredicateName:
|
|
299
64
|
- have_
|
300
65
|
NamePrefixBlacklist:
|
301
66
|
- is_
|
67
|
+
Exclude:
|
68
|
+
- spec/**/*
|
302
69
|
Style/RaiseArgs:
|
303
70
|
Description: Checks the arguments passed to raise/fail.
|
304
71
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
|
@@ -307,23 +74,6 @@ Style/RaiseArgs:
|
|
307
74
|
SupportedStyles:
|
308
75
|
- compact
|
309
76
|
- exploded
|
310
|
-
Style/RedundantReturn:
|
311
|
-
Description: Don't use return where it's not required.
|
312
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-return
|
313
|
-
Enabled: true
|
314
|
-
AllowMultipleReturnValues: false
|
315
|
-
Style/RegexpLiteral:
|
316
|
-
Description: Use %r for regular expressions matching more than `MaxSlashes` '/'
|
317
|
-
characters. Use %r only for regular expressions matching more than `MaxSlashes`
|
318
|
-
'/' character.
|
319
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-r
|
320
|
-
Enabled: false
|
321
|
-
MaxSlashes: 1
|
322
|
-
Style/Semicolon:
|
323
|
-
Description: Don't use semicolons to terminate expressions.
|
324
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon
|
325
|
-
Enabled: true
|
326
|
-
AllowAsExpressionSeparator: false
|
327
77
|
Style/SignalException:
|
328
78
|
Description: Checks for proper usage of fail and raise.
|
329
79
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
|
@@ -365,237 +115,77 @@ Style/StringLiteralsInInterpolation:
|
|
365
115
|
SupportedStyles:
|
366
116
|
- single_quotes
|
367
117
|
- double_quotes
|
368
|
-
Style/
|
369
|
-
Description: Checks
|
370
|
-
|
371
|
-
EnforcedStyleInsidePipes: no_space
|
372
|
-
SupportedStyles:
|
373
|
-
- space
|
374
|
-
- no_space
|
375
|
-
Style/SpaceAroundEqualsInParameterDefault:
|
376
|
-
Description: Checks that the equals signs in parameter default assignments have
|
377
|
-
or don't have surrounding space depending on configuration.
|
378
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-around-equals
|
379
|
-
Enabled: true
|
380
|
-
EnforcedStyle: space
|
381
|
-
SupportedStyles:
|
382
|
-
- space
|
383
|
-
- no_space
|
384
|
-
Style/SpaceBeforeBlockBraces:
|
385
|
-
Description: Checks that the left block brace has or doesn't have space before it.
|
386
|
-
Enabled: true
|
387
|
-
EnforcedStyle: space
|
388
|
-
SupportedStyles:
|
389
|
-
- space
|
390
|
-
- no_space
|
391
|
-
Style/SpaceInsideBlockBraces:
|
392
|
-
Description: Checks that block braces have or don't have surrounding space. For
|
393
|
-
blocks taking parameters, checks that the left brace has or doesn't have trailing
|
394
|
-
space.
|
395
|
-
Enabled: true
|
396
|
-
EnforcedStyle: space
|
397
|
-
SupportedStyles:
|
398
|
-
- space
|
399
|
-
- no_space
|
400
|
-
EnforcedStyleForEmptyBraces: no_space
|
401
|
-
SpaceBeforeBlockParameters: true
|
402
|
-
Style/SpaceInsideHashLiteralBraces:
|
403
|
-
Description: Use spaces inside hash literal braces - or don't.
|
404
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
405
|
-
Enabled: true
|
406
|
-
EnforcedStyle: space
|
407
|
-
EnforcedStyleForEmptyBraces: no_space
|
408
|
-
SupportedStyles:
|
409
|
-
- space
|
410
|
-
- no_space
|
411
|
-
Style/SymbolProc:
|
412
|
-
Description: Use symbols as procs instead of blocks when possible.
|
413
|
-
Enabled: true
|
414
|
-
IgnoredMethods:
|
415
|
-
- respond_to
|
416
|
-
Style/TrailingBlankLines:
|
417
|
-
Description: Checks trailing blank lines and final newline.
|
418
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#newline-eof
|
419
|
-
Enabled: true
|
420
|
-
EnforcedStyle: final_newline
|
421
|
-
SupportedStyles:
|
422
|
-
- final_newline
|
423
|
-
- final_blank_line
|
424
|
-
Style/TrailingComma:
|
425
|
-
Description: Checks for trailing comma in parameter lists and literals.
|
426
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
|
118
|
+
Style/TrailingCommaInArguments:
|
119
|
+
Description: 'Checks for trailing comma in argument lists.'
|
120
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
427
121
|
Enabled: false
|
428
122
|
EnforcedStyleForMultiline: no_comma
|
429
123
|
SupportedStyles:
|
430
124
|
- comma
|
125
|
+
- consistent_comma
|
431
126
|
- no_comma
|
432
|
-
Style/
|
433
|
-
Description:
|
434
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#
|
127
|
+
Style/TrailingCommaInLiteral:
|
128
|
+
Description: 'Checks for trailing comma in array and hash literals.'
|
129
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
435
130
|
Enabled: false
|
436
|
-
|
437
|
-
AllowPredicates: false
|
438
|
-
AllowDSLWriters: false
|
439
|
-
Whitelist:
|
440
|
-
- to_ary
|
441
|
-
- to_a
|
442
|
-
- to_c
|
443
|
-
- to_enum
|
444
|
-
- to_h
|
445
|
-
- to_hash
|
446
|
-
- to_i
|
447
|
-
- to_int
|
448
|
-
- to_io
|
449
|
-
- to_open
|
450
|
-
- to_path
|
451
|
-
- to_proc
|
452
|
-
- to_r
|
453
|
-
- to_regexp
|
454
|
-
- to_str
|
455
|
-
- to_s
|
456
|
-
- to_sym
|
457
|
-
Style/VariableName:
|
458
|
-
Description: Use the configured style when naming variables.
|
459
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
|
460
|
-
Enabled: true
|
461
|
-
EnforcedStyle: snake_case
|
131
|
+
EnforcedStyleForMultiline: no_comma
|
462
132
|
SupportedStyles:
|
463
|
-
-
|
464
|
-
-
|
465
|
-
|
466
|
-
Description: Favor modifier while/until usage when you have a single-line body.
|
467
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier
|
468
|
-
Enabled: false
|
469
|
-
MaxLineLength: 80
|
470
|
-
Style/WordArray:
|
471
|
-
Description: Use %w or %W for arrays of words.
|
472
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-w
|
473
|
-
Enabled: false
|
474
|
-
MinSize: 0
|
475
|
-
WordRegex: !ruby/regexp /\A[\p{Word}]+\z/
|
133
|
+
- comma
|
134
|
+
- consistent_comma
|
135
|
+
- no_comma
|
476
136
|
Metrics/AbcSize:
|
477
137
|
Description: A calculated magnitude based on number of assignments, branches, and
|
478
138
|
conditions.
|
479
|
-
Enabled:
|
139
|
+
Enabled: false
|
480
140
|
Max: 15
|
481
|
-
Metrics/BlockNesting:
|
482
|
-
Description: Avoid excessive block nesting
|
483
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count
|
484
|
-
Enabled: true
|
485
|
-
Max: 3
|
486
141
|
Metrics/ClassLength:
|
487
142
|
Description: Avoid classes longer than 100 lines of code.
|
488
143
|
Enabled: false
|
489
144
|
CountComments: false
|
490
145
|
Max: 100
|
146
|
+
Metrics/LineLength:
|
147
|
+
Description: Limit lines to max 140 characters
|
148
|
+
Max: 140
|
149
|
+
AllowHeredoc: true
|
150
|
+
AllowURI: true
|
151
|
+
URISchemes:
|
152
|
+
- http
|
153
|
+
- https
|
154
|
+
Metrics/ModuleLength:
|
155
|
+
CountComments: false
|
156
|
+
Max: 100
|
157
|
+
Description: Avoid modules longer than 100 lines of code.
|
158
|
+
Enabled: false
|
491
159
|
Metrics/CyclomaticComplexity:
|
492
160
|
Description: A complexity metric that is strongly correlated to the number of test
|
493
161
|
cases needed to validate a method.
|
494
|
-
Enabled: true
|
495
|
-
Max: 6
|
496
|
-
Metrics/LineLength:
|
497
|
-
Description: Limit lines to 80 characters.
|
498
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits
|
499
162
|
Enabled: false
|
500
|
-
Max:
|
501
|
-
AllowURI: true
|
502
|
-
URISchemes:
|
503
|
-
- http
|
504
|
-
- https
|
163
|
+
Max: 6
|
505
164
|
Metrics/MethodLength:
|
506
165
|
Description: Avoid methods longer than 10 lines of code.
|
507
166
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
|
508
|
-
Enabled:
|
509
|
-
CountComments:
|
167
|
+
Enabled: false
|
168
|
+
CountComments: false
|
510
169
|
Max: 10
|
511
|
-
Exclude:
|
512
|
-
- "spec/**/*"
|
513
170
|
Metrics/ParameterLists:
|
514
|
-
Description: Avoid
|
171
|
+
Description: Avoid parameter lists longer than three or four parameters.
|
515
172
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
|
516
|
-
Enabled:
|
173
|
+
Enabled: false
|
517
174
|
Max: 5
|
518
175
|
CountKeywordArgs: true
|
519
176
|
Metrics/PerceivedComplexity:
|
520
177
|
Description: A complexity metric geared towards measuring complexity for a human
|
521
178
|
reader.
|
522
|
-
Enabled:
|
179
|
+
Enabled: false
|
523
180
|
Max: 7
|
524
181
|
Lint/AssignmentInCondition:
|
525
182
|
Description: Don't use assignment in conditions.
|
526
183
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
|
527
184
|
Enabled: false
|
528
185
|
AllowSafeAssignment: true
|
529
|
-
Lint/EndAlignment:
|
530
|
-
Description: Align ends correctly.
|
531
|
-
Enabled: true
|
532
|
-
AlignWith: keyword
|
533
|
-
SupportedStyles:
|
534
|
-
- keyword
|
535
|
-
- variable
|
536
|
-
Lint/DefEndAlignment:
|
537
|
-
Description: Align ends corresponding to defs correctly.
|
538
|
-
Enabled: true
|
539
|
-
AlignWith: start_of_line
|
540
|
-
SupportedStyles:
|
541
|
-
- start_of_line
|
542
|
-
- def
|
543
|
-
Rails/ActionFilter:
|
544
|
-
Description: Enforces consistent use of action filter methods.
|
545
|
-
Enabled: true
|
546
|
-
EnforcedStyle: action
|
547
|
-
SupportedStyles:
|
548
|
-
- action
|
549
|
-
- filter
|
550
|
-
Include:
|
551
|
-
- app/controllers/**/*.rb
|
552
|
-
Rails/DefaultScope:
|
553
|
-
Description: Checks if the argument passed to default_scope is a block.
|
554
|
-
Enabled: true
|
555
|
-
Include:
|
556
|
-
- app/models/**/*.rb
|
557
|
-
Rails/HasAndBelongsToMany:
|
558
|
-
Description: Prefer has_many :through to has_and_belongs_to_many.
|
559
|
-
Enabled: true
|
560
|
-
Include:
|
561
|
-
- app/models/**/*.rb
|
562
|
-
Rails/Output:
|
563
|
-
Description: Checks for calls to puts, print, etc.
|
564
|
-
Enabled: true
|
565
|
-
Include:
|
566
|
-
- app/**/*.rb
|
567
|
-
- config/**/*.rb
|
568
|
-
- db/**/*.rb
|
569
|
-
- lib/**/*.rb
|
570
|
-
Rails/ReadWriteAttribute:
|
571
|
-
Description: Checks for read_attribute(:attr) and write_attribute(:attr, val).
|
572
|
-
Enabled: true
|
573
|
-
Include:
|
574
|
-
- app/models/**/*.rb
|
575
|
-
Rails/ScopeArgs:
|
576
|
-
Description: Checks the arguments of ActiveRecord scopes.
|
577
|
-
Enabled: true
|
578
|
-
Include:
|
579
|
-
- app/models/**/*.rb
|
580
|
-
Rails/Validation:
|
581
|
-
Description: Use validates :attribute, hash of validations.
|
582
|
-
Enabled: true
|
583
|
-
Include:
|
584
|
-
- app/models/**/*.rb
|
585
186
|
Style/InlineComment:
|
586
187
|
Description: Avoid inline comments.
|
587
188
|
Enabled: false
|
588
|
-
Style/MethodCalledOnDoEndBlock:
|
589
|
-
Description: Avoid chaining a method call on a do...end block.
|
590
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
|
591
|
-
Enabled: false
|
592
|
-
Style/SymbolArray:
|
593
|
-
Description: Use %i or %I for arrays of symbols.
|
594
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-i
|
595
|
-
Enabled: false
|
596
|
-
Style/ExtraSpacing:
|
597
|
-
Description: Do not use unnecessary spacing.
|
598
|
-
Enabled: true
|
599
189
|
Style/AccessorMethodName:
|
600
190
|
Description: Check the naming of accessor methods for get_/set_.
|
601
191
|
Enabled: false
|
@@ -603,81 +193,6 @@ Style/Alias:
|
|
603
193
|
Description: Use alias_method instead of alias.
|
604
194
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
|
605
195
|
Enabled: false
|
606
|
-
Style/AlignArray:
|
607
|
-
Description: Align the elements of an array literal if they span more than one line.
|
608
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays
|
609
|
-
Enabled: true
|
610
|
-
Style/ArrayJoin:
|
611
|
-
Description: Use Array#join instead of Array#*.
|
612
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join
|
613
|
-
Enabled: false
|
614
|
-
Style/AsciiComments:
|
615
|
-
Description: Use only ascii symbols in comments.
|
616
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-comments
|
617
|
-
Enabled: false
|
618
|
-
Style/AsciiIdentifiers:
|
619
|
-
Description: Use only ascii symbols in identifiers.
|
620
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-identifiers
|
621
|
-
Enabled: false
|
622
|
-
Style/Attr:
|
623
|
-
Description: Checks for uses of Module#attr.
|
624
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr
|
625
|
-
Enabled: false
|
626
|
-
Style/BeginBlock:
|
627
|
-
Description: Avoid the use of BEGIN blocks.
|
628
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks
|
629
|
-
Enabled: true
|
630
|
-
Style/BlockComments:
|
631
|
-
Description: Do not use block comments.
|
632
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments
|
633
|
-
Enabled: true
|
634
|
-
Style/BlockEndNewline:
|
635
|
-
Description: Put end statement of multiline block on its own line.
|
636
|
-
Enabled: true
|
637
|
-
Style/Blocks:
|
638
|
-
Description: Avoid using {...} for multi-line blocks (multiline chaining is always
|
639
|
-
ugly). Prefer {...} over do...end for single-line blocks.
|
640
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
|
641
|
-
Enabled: true
|
642
|
-
Style/CaseEquality:
|
643
|
-
Description: Avoid explicit use of the case equality operator(===).
|
644
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-case-equality
|
645
|
-
Enabled: false
|
646
|
-
Style/CharacterLiteral:
|
647
|
-
Description: Checks for uses of character literals.
|
648
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-character-literals
|
649
|
-
Enabled: false
|
650
|
-
Style/ClassAndModuleCamelCase:
|
651
|
-
Description: Use CamelCase for classes and modules.
|
652
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#camelcase-classes
|
653
|
-
Enabled: true
|
654
|
-
Style/ClassMethods:
|
655
|
-
Description: Use self when defining module/class methods.
|
656
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#def-self-singletons
|
657
|
-
Enabled: true
|
658
|
-
Style/ClassVars:
|
659
|
-
Description: Avoid the use of class variables.
|
660
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-class-vars
|
661
|
-
Enabled: false
|
662
|
-
Style/ColonMethodCall:
|
663
|
-
Description: 'Do not use :: for method call.'
|
664
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#double-colons
|
665
|
-
Enabled: false
|
666
|
-
Style/CommentIndentation:
|
667
|
-
Description: Indentation of comments.
|
668
|
-
Enabled: true
|
669
|
-
Style/ConstantName:
|
670
|
-
Description: Constants should use SCREAMING_SNAKE_CASE.
|
671
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#screaming-snake-case
|
672
|
-
Enabled: true
|
673
|
-
Style/DefWithParentheses:
|
674
|
-
Description: Use def with parentheses when there are arguments.
|
675
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
|
676
|
-
Enabled: true
|
677
|
-
Style/DeprecatedHashMethods:
|
678
|
-
Description: Checks for use of deprecated Hash methods.
|
679
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-key
|
680
|
-
Enabled: false
|
681
196
|
Style/Documentation:
|
682
197
|
Description: Document classes and non-namespace modules.
|
683
198
|
Enabled: false
|
@@ -688,234 +203,31 @@ Style/DoubleNegation:
|
|
688
203
|
Style/EachWithObject:
|
689
204
|
Description: Prefer `each_with_object` over `inject` or `reduce`.
|
690
205
|
Enabled: false
|
691
|
-
Style/ElseAlignment:
|
692
|
-
Description: Align elses and elsifs correctly.
|
693
|
-
Enabled: true
|
694
|
-
Style/EmptyElse:
|
695
|
-
Description: Avoid empty else-clauses.
|
696
|
-
Enabled: true
|
697
|
-
Style/EmptyLines:
|
698
|
-
Description: Don't use several empty lines in a row.
|
699
|
-
Enabled: true
|
700
|
-
Style/EmptyLinesAroundAccessModifier:
|
701
|
-
Description: Keep blank lines around access modifiers.
|
702
|
-
Enabled: true
|
703
|
-
Style/EmptyLinesAroundMethodBody:
|
704
|
-
Description: Keeps track of empty lines around method bodies.
|
705
|
-
Enabled: true
|
706
206
|
Style/EmptyLiteral:
|
707
207
|
Description: Prefer literals to Array.new/Hash.new/String.new.
|
708
208
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
|
709
209
|
Enabled: false
|
710
|
-
Style/EndBlock:
|
711
|
-
Description: Avoid the use of END blocks.
|
712
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-END-blocks
|
713
|
-
Enabled: true
|
714
|
-
Style/EndOfLine:
|
715
|
-
Description: Use Unix-style line endings.
|
716
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#crlf
|
717
|
-
Enabled: true
|
718
|
-
Style/EvenOdd:
|
719
|
-
Description: Favor the use of Fixnum#even? && Fixnum#odd?
|
720
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
|
721
|
-
Enabled: false
|
722
|
-
Style/FlipFlop:
|
723
|
-
Description: Checks for flip flops
|
724
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops
|
725
|
-
Enabled: false
|
726
|
-
Style/IfWithSemicolon:
|
727
|
-
Description: Do not use if x; .... Use the ternary operator instead.
|
728
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs
|
729
|
-
Enabled: false
|
730
|
-
Style/IndentationConsistency:
|
731
|
-
Description: Keep indentation straight.
|
732
|
-
Enabled: true
|
733
|
-
Style/IndentArray:
|
734
|
-
Description: Checks the indentation of the first element in an array literal.
|
735
|
-
Enabled: true
|
736
|
-
Style/InfiniteLoop:
|
737
|
-
Description: Use Kernel#loop for infinite loops.
|
738
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#infinite-loop
|
739
|
-
Enabled: true
|
740
|
-
Style/Lambda:
|
741
|
-
Description: Use the new lambda literal syntax for single-line blocks.
|
742
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#lambda-multi-line
|
743
|
-
Enabled: false
|
744
|
-
Style/LeadingCommentSpace:
|
745
|
-
Description: Comments should start with a space.
|
746
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-space
|
747
|
-
Enabled: true
|
748
|
-
Style/LineEndConcatenation:
|
749
|
-
Description: Use \ instead of + or << to concatenate two string literals at line
|
750
|
-
end.
|
751
|
-
Enabled: false
|
752
|
-
Style/MethodCallParentheses:
|
753
|
-
Description: Do not use parentheses for method calls with no arguments.
|
754
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-args-no-parens
|
755
|
-
Enabled: true
|
756
210
|
Style/ModuleFunction:
|
757
211
|
Description: Checks for usage of `extend self` in modules.
|
758
212
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
|
759
213
|
Enabled: false
|
760
|
-
Style/MultilineBlockChain:
|
761
|
-
Description: Avoid multi-line chains of blocks.
|
762
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
|
763
|
-
Enabled: true
|
764
|
-
Style/MultilineBlockLayout:
|
765
|
-
Description: Ensures newlines after multiline block do statements.
|
766
|
-
Enabled: true
|
767
|
-
Style/MultilineIfThen:
|
768
|
-
Description: Do not use then for multi-line if/unless.
|
769
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-then
|
770
|
-
Enabled: true
|
771
|
-
Style/MultilineTernaryOperator:
|
772
|
-
Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.'
|
773
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary
|
774
|
-
Enabled: true
|
775
|
-
Style/NegatedIf:
|
776
|
-
Description: Favor unless over if for negative conditions (or control flow or).
|
777
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#unless-for-negatives
|
778
|
-
Enabled: false
|
779
|
-
Style/NegatedWhile:
|
780
|
-
Description: Favor until over while for negative conditions.
|
781
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#until-for-negatives
|
782
|
-
Enabled: false
|
783
|
-
Style/NestedTernaryOperator:
|
784
|
-
Description: Use one expression per branch in a ternary operator.
|
785
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-ternary
|
786
|
-
Enabled: true
|
787
|
-
Style/NilComparison:
|
788
|
-
Description: Prefer x.nil? to x == nil.
|
789
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
|
790
|
-
Enabled: false
|
791
|
-
Style/Not:
|
792
|
-
Description: Use ! instead of not.
|
793
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bang-not-not
|
794
|
-
Enabled: false
|
795
214
|
Style/OneLineConditional:
|
796
215
|
Description: Favor the ternary operator(?:) over if/then/else/end constructs.
|
797
216
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
|
798
217
|
Enabled: false
|
799
|
-
Style/OpMethod:
|
800
|
-
Description: When defining binary operators, name the argument other.
|
801
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
|
802
|
-
Enabled: false
|
803
218
|
Style/PerlBackrefs:
|
804
219
|
Description: Avoid Perl-style regex back references.
|
805
220
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
|
806
221
|
Enabled: false
|
807
|
-
Style/
|
808
|
-
Description:
|
809
|
-
|
810
|
-
|
811
|
-
Style/RedundantBegin:
|
812
|
-
Description: Don't use begin blocks when they are not needed.
|
813
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#begin-implicit
|
814
|
-
Enabled: true
|
815
|
-
Style/RedundantException:
|
816
|
-
Description: Checks for an obsolete RuntimeException argument in raise/fail.
|
817
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror
|
818
|
-
Enabled: true
|
819
|
-
Style/RedundantSelf:
|
820
|
-
Description: Don't use self where it's not needed.
|
821
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-self-unless-required
|
822
|
-
Enabled: true
|
823
|
-
Style/RescueModifier:
|
824
|
-
Description: Avoid using rescue in its modifier form.
|
825
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers
|
826
|
-
Enabled: true
|
827
|
-
Style/SelfAssignment:
|
828
|
-
Description: Checks for places where self-assignment shorthand should have been
|
829
|
-
used.
|
830
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#self-assignment
|
222
|
+
Style/Send:
|
223
|
+
Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
|
224
|
+
may overlap with existing methods.
|
225
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send
|
831
226
|
Enabled: false
|
832
|
-
Style/SingleSpaceBeforeFirstArg:
|
833
|
-
Description: Checks that exactly one space is used between a method name and the
|
834
|
-
first argument for method calls without parentheses.
|
835
|
-
Enabled: true
|
836
|
-
Style/SpaceAfterColon:
|
837
|
-
Description: Use spaces after colons.
|
838
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
839
|
-
Enabled: true
|
840
|
-
Style/SpaceAfterComma:
|
841
|
-
Description: Use spaces after commas.
|
842
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
843
|
-
Enabled: true
|
844
|
-
Style/SpaceAfterControlKeyword:
|
845
|
-
Description: Use spaces after if/elsif/unless/while/until/case/when.
|
846
|
-
Enabled: true
|
847
|
-
Style/SpaceAfterMethodName:
|
848
|
-
Description: Do not put a space between a method name and the opening parenthesis
|
849
|
-
in a method definition.
|
850
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
|
851
|
-
Enabled: true
|
852
|
-
Style/SpaceAfterNot:
|
853
|
-
Description: Tracks redundant space after the ! operator.
|
854
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-bang
|
855
|
-
Enabled: true
|
856
|
-
Style/SpaceAfterSemicolon:
|
857
|
-
Description: Use spaces after semicolons.
|
858
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
859
|
-
Enabled: true
|
860
|
-
Style/SpaceBeforeComma:
|
861
|
-
Description: No spaces before commas.
|
862
|
-
Enabled: true
|
863
|
-
Style/SpaceBeforeComment:
|
864
|
-
Description: Checks for missing space between code and a comment on the same line.
|
865
|
-
Enabled: true
|
866
|
-
Style/SpaceBeforeSemicolon:
|
867
|
-
Description: No spaces before semicolons.
|
868
|
-
Enabled: true
|
869
|
-
Style/SpaceAroundOperators:
|
870
|
-
Description: Use spaces around operators.
|
871
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
872
|
-
Enabled: true
|
873
|
-
Style/SpaceBeforeModifierKeyword:
|
874
|
-
Description: Put a space before the modifier keyword.
|
875
|
-
Enabled: true
|
876
|
-
Style/SpaceInsideBrackets:
|
877
|
-
Description: No spaces after [ or before ].
|
878
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
|
879
|
-
Enabled: true
|
880
|
-
Style/SpaceInsideParens:
|
881
|
-
Description: No spaces after ( or before ).
|
882
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
|
883
|
-
Enabled: true
|
884
|
-
Style/SpaceInsideRangeLiteral:
|
885
|
-
Description: No spaces inside range literals.
|
886
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals
|
887
|
-
Enabled: true
|
888
227
|
Style/SpecialGlobalVars:
|
889
228
|
Description: Avoid Perl-style global variables.
|
890
229
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
|
891
230
|
Enabled: false
|
892
|
-
Style/StructInheritance:
|
893
|
-
Description: Checks for inheritance from Struct.new.
|
894
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new
|
895
|
-
Enabled: true
|
896
|
-
Style/Tab:
|
897
|
-
Description: No hard tabs.
|
898
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
|
899
|
-
Enabled: true
|
900
|
-
Style/TrailingWhitespace:
|
901
|
-
Description: Avoid trailing whitespace.
|
902
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace
|
903
|
-
Enabled: true
|
904
|
-
Style/UnlessElse:
|
905
|
-
Description: Do not use unless with else. Rewrite these with the positive case first.
|
906
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-else-with-unless
|
907
|
-
Enabled: true
|
908
|
-
Style/UnneededCapitalW:
|
909
|
-
Description: Checks for %W when interpolation is not needed.
|
910
|
-
Enabled: true
|
911
|
-
Style/UnneededPercentQ:
|
912
|
-
Description: Checks for %q/%Q when single quotes or double quotes would do.
|
913
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q
|
914
|
-
Enabled: true
|
915
|
-
Style/UnneededPercentX:
|
916
|
-
Description: Checks for %x when `` would do.
|
917
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-x
|
918
|
-
Enabled: true
|
919
231
|
Style/VariableInterpolation:
|
920
232
|
Description: Don't interpolate global, instance and class variables directly in
|
921
233
|
strings.
|
@@ -925,130 +237,16 @@ Style/WhenThen:
|
|
925
237
|
Description: Use when x then ... for one-line cases.
|
926
238
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
|
927
239
|
Enabled: false
|
928
|
-
|
929
|
-
Description:
|
930
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do
|
931
|
-
Enabled: true
|
932
|
-
Lint/AmbiguousOperator:
|
933
|
-
Description: Checks for ambiguous operators in the first argument of a method invocation
|
934
|
-
without parentheses.
|
935
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-as-args
|
936
|
-
Enabled: false
|
937
|
-
Lint/AmbiguousRegexpLiteral:
|
938
|
-
Description: Checks for ambiguous regexp literals in the first argument of a method
|
939
|
-
invocation without parenthesis.
|
940
|
-
Enabled: false
|
941
|
-
Lint/BlockAlignment:
|
942
|
-
Description: Align block ends correctly.
|
943
|
-
Enabled: true
|
944
|
-
Lint/ConditionPosition:
|
945
|
-
Description: Checks for condition placed in a confusing position relative to the
|
946
|
-
keyword.
|
947
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition
|
948
|
-
Enabled: false
|
949
|
-
Lint/Debugger:
|
950
|
-
Description: Check for debugger calls.
|
951
|
-
Enabled: true
|
952
|
-
Lint/DeprecatedClassMethods:
|
953
|
-
Description: Check for deprecated class method calls.
|
954
|
-
Enabled: false
|
955
|
-
Lint/DuplicateMethods:
|
956
|
-
Description: Check for duplicate methods calls.
|
957
|
-
Enabled: true
|
958
|
-
Lint/ElseLayout:
|
959
|
-
Description: Check for odd code arrangement in an else block.
|
960
|
-
Enabled: false
|
961
|
-
Lint/EmptyEnsure:
|
962
|
-
Description: Checks for empty ensure block.
|
963
|
-
Enabled: true
|
964
|
-
Lint/EmptyInterpolation:
|
965
|
-
Description: Checks for empty string interpolation.
|
966
|
-
Enabled: true
|
967
|
-
Lint/EndInMethod:
|
968
|
-
Description: END blocks should not be placed inside method definitions.
|
969
|
-
Enabled: true
|
970
|
-
Lint/EnsureReturn:
|
971
|
-
Description: Do not use return in an ensure block.
|
972
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-return-ensure
|
973
|
-
Enabled: true
|
974
|
-
Lint/Eval:
|
975
|
-
Description: The use of eval represents a serious security risk.
|
240
|
+
Lint/EachWithObjectArgument:
|
241
|
+
Description: Check for immutable argument given to each_with_object.
|
976
242
|
Enabled: true
|
977
243
|
Lint/HandleExceptions:
|
978
244
|
Description: Don't suppress exception.
|
979
245
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
|
980
246
|
Enabled: false
|
981
|
-
Lint/InvalidCharacterLiteral:
|
982
|
-
Description: Checks for invalid character literals with a non-escaped whitespace
|
983
|
-
character.
|
984
|
-
Enabled: false
|
985
247
|
Lint/LiteralInCondition:
|
986
248
|
Description: Checks of literals used in conditions.
|
987
249
|
Enabled: false
|
988
250
|
Lint/LiteralInInterpolation:
|
989
251
|
Description: Checks for literals used in interpolation.
|
990
252
|
Enabled: false
|
991
|
-
Lint/Loop:
|
992
|
-
Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
|
993
|
-
for post-loop tests.
|
994
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#loop-with-break
|
995
|
-
Enabled: false
|
996
|
-
Lint/ParenthesesAsGroupedExpression:
|
997
|
-
Description: Checks for method calls with a space before the opening parenthesis.
|
998
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
|
999
|
-
Enabled: false
|
1000
|
-
Lint/RequireParentheses:
|
1001
|
-
Description: Use parentheses in the method call to avoid confusion about precedence.
|
1002
|
-
Enabled: false
|
1003
|
-
Lint/RescueException:
|
1004
|
-
Description: Avoid rescuing the Exception class.
|
1005
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-blind-rescues
|
1006
|
-
Enabled: true
|
1007
|
-
Lint/ShadowingOuterLocalVariable:
|
1008
|
-
Description: Do not use the same name as outer local variable for block arguments
|
1009
|
-
or block local variables.
|
1010
|
-
Enabled: true
|
1011
|
-
Lint/SpaceBeforeFirstArg:
|
1012
|
-
Description: Put a space between a method name and the first argument in a method
|
1013
|
-
call without parentheses.
|
1014
|
-
Enabled: true
|
1015
|
-
Lint/StringConversionInInterpolation:
|
1016
|
-
Description: Checks for Object#to_s usage in string interpolation.
|
1017
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-to-s
|
1018
|
-
Enabled: true
|
1019
|
-
Lint/UnderscorePrefixedVariableName:
|
1020
|
-
Description: Do not use prefix `_` for a variable that is used.
|
1021
|
-
Enabled: false
|
1022
|
-
Lint/UnusedBlockArgument:
|
1023
|
-
Description: Checks for unused block arguments.
|
1024
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
1025
|
-
Enabled: true
|
1026
|
-
Lint/UnusedMethodArgument:
|
1027
|
-
Description: Checks for unused method arguments.
|
1028
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
1029
|
-
Enabled: true
|
1030
|
-
Lint/UnreachableCode:
|
1031
|
-
Description: Unreachable code.
|
1032
|
-
Enabled: true
|
1033
|
-
Lint/UselessAccessModifier:
|
1034
|
-
Description: Checks for useless access modifiers.
|
1035
|
-
Enabled: true
|
1036
|
-
Lint/UselessAssignment:
|
1037
|
-
Description: Checks for useless assignment to a local variable.
|
1038
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
1039
|
-
Enabled: true
|
1040
|
-
Lint/UselessComparison:
|
1041
|
-
Description: Checks for comparison of something with itself.
|
1042
|
-
Enabled: true
|
1043
|
-
Lint/UselessElseWithoutRescue:
|
1044
|
-
Description: Checks for useless `else` in `begin..end` without `rescue`.
|
1045
|
-
Enabled: true
|
1046
|
-
Lint/UselessSetterCall:
|
1047
|
-
Description: Checks for useless setter call to a local variable.
|
1048
|
-
Enabled: true
|
1049
|
-
Lint/Void:
|
1050
|
-
Description: Possible use of operator/literal/variable in void context.
|
1051
|
-
Enabled: false
|
1052
|
-
Rails/Delegate:
|
1053
|
-
Description: Prefer delegate method for delegations.
|
1054
|
-
Enabled: false
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/europeana-api.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.required_ruby_version = '>= 2.0.0'
|
22
22
|
|
23
|
-
spec.add_dependency 'activesupport', '>= 3.0'
|
23
|
+
spec.add_dependency 'activesupport', '>= 3.0', '< 5'
|
24
24
|
spec.add_dependency 'multi_json', '~> 1.0'
|
25
25
|
|
26
26
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
data/lib/europeana/api/record.rb
CHANGED
@@ -19,8 +19,8 @@ module Europeana
|
|
19
19
|
# @param [String] id Europeana ID of the record
|
20
20
|
# @param [Hash] params Request parameters
|
21
21
|
def initialize(id, params = {})
|
22
|
+
self.request_params = params
|
22
23
|
@id = id
|
23
|
-
@params = params
|
24
24
|
end
|
25
25
|
|
26
26
|
##
|
@@ -59,7 +59,7 @@ module Europeana
|
|
59
59
|
# @return [String]
|
60
60
|
def request_url(options = {})
|
61
61
|
options.assert_valid_keys(:ld)
|
62
|
-
(
|
62
|
+
(api_url + "/record#{@id}.json").tap do |url|
|
63
63
|
url << 'ld' if options[:ld]
|
64
64
|
end
|
65
65
|
end
|
@@ -7,11 +7,9 @@ module Europeana
|
|
7
7
|
class Base
|
8
8
|
include Requestable
|
9
9
|
|
10
|
-
attr_accessor :params
|
11
|
-
|
12
10
|
def initialize(id, params = {})
|
13
11
|
@id = id
|
14
|
-
|
12
|
+
self.request_params = params
|
15
13
|
end
|
16
14
|
|
17
15
|
def parse_response(response, options = {})
|
@@ -19,7 +17,7 @@ module Europeana
|
|
19
17
|
end
|
20
18
|
|
21
19
|
def request_url(_options = {})
|
22
|
-
|
20
|
+
api_url + "/record#{@id}/#{api_method}.json"
|
23
21
|
end
|
24
22
|
|
25
23
|
def api_method
|
@@ -5,6 +5,14 @@ module Europeana
|
|
5
5
|
#
|
6
6
|
# Class needs to implement {#request_url}
|
7
7
|
module Requestable
|
8
|
+
def extract_api_url(params)
|
9
|
+
@api_url = params.delete(:api_url)
|
10
|
+
end
|
11
|
+
|
12
|
+
def api_url
|
13
|
+
@api_url || Europeana::API.url
|
14
|
+
end
|
15
|
+
|
8
16
|
##
|
9
17
|
# Request-specific params, to be overriden in including class
|
10
18
|
#
|
@@ -13,6 +21,12 @@ module Europeana
|
|
13
21
|
{}
|
14
22
|
end
|
15
23
|
|
24
|
+
def request_params=(params)
|
25
|
+
params = params.deep_dup
|
26
|
+
extract_api_url(params)
|
27
|
+
@params = HashWithIndifferentAccess.new(params)
|
28
|
+
end
|
29
|
+
|
16
30
|
##
|
17
31
|
# Query params with API key added
|
18
32
|
#
|
data/lib/europeana/api/search.rb
CHANGED
@@ -28,7 +28,7 @@ module Europeana
|
|
28
28
|
##
|
29
29
|
# @param [Hash] params Europeana API request parameters for Search query
|
30
30
|
def initialize(params = {})
|
31
|
-
|
31
|
+
self.request_params = params
|
32
32
|
end
|
33
33
|
|
34
34
|
##
|
@@ -36,7 +36,7 @@ module Europeana
|
|
36
36
|
#
|
37
37
|
# @return [URI]
|
38
38
|
def request_url(_options = {})
|
39
|
-
|
39
|
+
api_url + '/search.json'
|
40
40
|
end
|
41
41
|
|
42
42
|
alias_method :execute, :execute_request
|
@@ -35,7 +35,7 @@ RSpec.describe Europeana::API::Record do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'sets params attribute' do
|
38
|
-
expect(subject.instance_variable_get(:@params)).to eq(params)
|
38
|
+
expect(subject.instance_variable_get(:@params)).to eq(HashWithIndifferentAccess.new(params))
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -92,7 +92,7 @@ RSpec.describe Europeana::API::Record do
|
|
92
92
|
|
93
93
|
context 'with API key' do
|
94
94
|
it 'adds API key to params' do
|
95
|
-
expect(subject.params_with_authentication).to eq(params.merge(wskey: api_key))
|
95
|
+
expect(subject.params_with_authentication).to eq(HashWithIndifferentAccess.new(params).merge(wskey: api_key))
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: europeana-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Doe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -17,6 +17,9 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3.0'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '5'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -24,6 +27,9 @@ dependencies:
|
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '3.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: multi_json
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|