rest-ftp-daemon 0.221.2 → 0.222.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +2 -0
- data/.rubocop.yml +859 -0
- data/Gemfile.lock +34 -3
- data/README.md +6 -1
- data/Rakefile +8 -1
- data/bin/rest-ftp-daemon +9 -9
- data/config.ru +3 -3
- data/lib/rest-ftp-daemon.rb +43 -43
- data/lib/rest-ftp-daemon/api/dashboard.rb +14 -4
- data/lib/rest-ftp-daemon/api/job_presenter.rb +1 -1
- data/lib/rest-ftp-daemon/api/jobs.rb +42 -42
- data/lib/rest-ftp-daemon/api/root.rb +37 -17
- data/lib/rest-ftp-daemon/constants.rb +8 -8
- data/lib/rest-ftp-daemon/helpers.rb +12 -13
- data/lib/rest-ftp-daemon/job.rb +24 -23
- data/lib/rest-ftp-daemon/job_queue.rb +8 -9
- data/lib/rest-ftp-daemon/logger.rb +2 -14
- data/lib/rest-ftp-daemon/logger_pool.rb +1 -1
- data/lib/rest-ftp-daemon/notification.rb +5 -5
- data/lib/rest-ftp-daemon/paginate.rb +4 -3
- data/lib/rest-ftp-daemon/settings.rb +11 -11
- data/lib/rest-ftp-daemon/uri.rb +2 -2
- data/lib/rest-ftp-daemon/views/dashboard_table.haml +1 -1
- data/lib/rest-ftp-daemon/worker.rb +1 -1
- data/lib/rest-ftp-daemon/worker_conchita.rb +3 -3
- data/lib/rest-ftp-daemon/worker_job.rb +3 -3
- data/lib/rest-ftp-daemon/worker_pool.rb +6 -9
- data/rest-ftp-daemon.gemspec +3 -1
- data/rest-ftp-daemon.yml.sample +12 -11
- data/spec/rest-ftp-daemon/features/dashboard_spec.rb +23 -0
- data/spec/spec_helper.rb +62 -0
- data/spec/support/config.yml +26 -0
- metadata +35 -4
- data/lib/rest-ftp-daemon/api/debug.rb +0 -31
- data/lib/rest-ftp-daemon/api/status.rb +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a37b551aba1fb9064471f18ffa0d783ac5b7aab5
|
4
|
+
data.tar.gz: e89ea4d47e9fea2cf75bbabf241b25cb1f3a0c72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1295e3ea0b82bad61532d4addca8b05b4f2a5372fa0373e03838b608dab74c26f5439bb09647eee73296746006501427acd4123ea110f13f4cd8c592a3f21c01
|
7
|
+
data.tar.gz: e8a6d8a799496cbf1e51bf6cb77e3424df91f9fe423f5ce9743ceddb9648c9518d7215f3729e8c30c48e150a98da5d99c07415b212215b31ee483f10fe5da049
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,859 @@
|
|
1
|
+
# This is the default configuration file. Enabling and disabling is configured
|
2
|
+
# in separate files. This file adds all other parameters apart from Enabled.
|
3
|
+
|
4
|
+
inherit_from:
|
5
|
+
|
6
|
+
|
7
|
+
# Common configuration.
|
8
|
+
AllCops:
|
9
|
+
# Include common Ruby source files.
|
10
|
+
Include:
|
11
|
+
- '**/*.gemspec'
|
12
|
+
- '**/*.podspec'
|
13
|
+
- '**/*.jbuilder'
|
14
|
+
- '**/*.rake'
|
15
|
+
- '**/*.opal'
|
16
|
+
- '**/config.ru'
|
17
|
+
- '**/Gemfile'
|
18
|
+
- '**/Rakefile'
|
19
|
+
- '**/Capfile'
|
20
|
+
- '**/Guardfile'
|
21
|
+
- '**/Podfile'
|
22
|
+
- '**/Thorfile'
|
23
|
+
- '**/Vagrantfile'
|
24
|
+
- '**/Berksfile'
|
25
|
+
- '**/Cheffile'
|
26
|
+
- '**/Vagabondfile'
|
27
|
+
Exclude:
|
28
|
+
- 'vendor/**/*'
|
29
|
+
- 'DOC/**/*'
|
30
|
+
# By default, the rails cops are not run. Override in project or home
|
31
|
+
# directory .rubocop.yml files, or by giving the -R/--rails option.
|
32
|
+
RunRailsCops: false
|
33
|
+
# Cop names are not displayed in offense messages by default. Change behavior
|
34
|
+
# by overriding DisplayCopNames, or by giving the -D/--display-cop-names
|
35
|
+
# option.
|
36
|
+
DisplayCopNames: false
|
37
|
+
# Style guide URLs are not displayed in offense messages by default. Change
|
38
|
+
# behavior by overriding DisplayStyleGuide, or by giving the
|
39
|
+
# -S/--display-style-guide option.
|
40
|
+
DisplayStyleGuide: false
|
41
|
+
# Additional cops that do not reference a style guide rule may be enabled by
|
42
|
+
# default. Change behavior by overriding StyleGuideCopsOnly, or by giving
|
43
|
+
# the --only-guide-cops option.
|
44
|
+
StyleGuideCopsOnly: false
|
45
|
+
|
46
|
+
# Indent private/protected/public as deep as method definitions
|
47
|
+
Style/AccessModifierIndentation:
|
48
|
+
EnforcedStyle: indent
|
49
|
+
SupportedStyles:
|
50
|
+
- outdent
|
51
|
+
- indent
|
52
|
+
|
53
|
+
# Align the elements of a hash literal if they span more than one line.
|
54
|
+
Style/AlignHash:
|
55
|
+
# Alignment of entries using hash rocket as separator. Valid values are:
|
56
|
+
#
|
57
|
+
# key - left alignment of keys
|
58
|
+
# 'a' => 2
|
59
|
+
# 'bb' => 3
|
60
|
+
# separator - alignment of hash rockets, keys are right aligned
|
61
|
+
# 'a' => 2
|
62
|
+
# 'bb' => 3
|
63
|
+
# table - left alignment of keys, hash rockets, and values
|
64
|
+
# 'a' => 2
|
65
|
+
# 'bb' => 3
|
66
|
+
EnforcedHashRocketStyle: key
|
67
|
+
# Alignment of entries using colon as separator. Valid values are:
|
68
|
+
#
|
69
|
+
# key - left alignment of keys
|
70
|
+
# a: 0
|
71
|
+
# bb: 1
|
72
|
+
# separator - alignment of colons, keys are right aligned
|
73
|
+
# a: 0
|
74
|
+
# bb: 1
|
75
|
+
# table - left alignment of keys and values
|
76
|
+
# a: 0
|
77
|
+
# bb: 1
|
78
|
+
EnforcedColonStyle: key
|
79
|
+
# Select whether hashes that are the last argument in a method call should be
|
80
|
+
# inspected? Valid values are:
|
81
|
+
#
|
82
|
+
# always_inspect - Inspect both implicit and explicit hashes.
|
83
|
+
# Registers an offense for:
|
84
|
+
# function(a: 1,
|
85
|
+
# b: 2)
|
86
|
+
# Registers an offense for:
|
87
|
+
# function({a: 1,
|
88
|
+
# b: 2})
|
89
|
+
# always_ignore - Ignore both implicit and explicit hashes.
|
90
|
+
# Accepts:
|
91
|
+
# function(a: 1,
|
92
|
+
# b: 2)
|
93
|
+
# Accepts:
|
94
|
+
# function({a: 1,
|
95
|
+
# b: 2})
|
96
|
+
# ignore_implicit - Ignore only implicit hashes.
|
97
|
+
# Accepts:
|
98
|
+
# function(a: 1,
|
99
|
+
# b: 2)
|
100
|
+
# Registers an offense for:
|
101
|
+
# function({a: 1,
|
102
|
+
# b: 2})
|
103
|
+
# ignore_explicit - Ignore only explicit hashes.
|
104
|
+
# Accepts:
|
105
|
+
# function({a: 1,
|
106
|
+
# b: 2})
|
107
|
+
# Registers an offense for:
|
108
|
+
# function(a: 1,
|
109
|
+
# b: 2)
|
110
|
+
EnforcedLastArgumentHashStyle: always_inspect
|
111
|
+
SupportedLastArgumentHashStyles:
|
112
|
+
- always_inspect
|
113
|
+
- always_ignore
|
114
|
+
- ignore_implicit
|
115
|
+
- ignore_explicit
|
116
|
+
|
117
|
+
Style/AlignParameters:
|
118
|
+
# Alignment of parameters in multi-line method calls.
|
119
|
+
#
|
120
|
+
# The `with_first_parameter` style aligns the following lines along the same
|
121
|
+
# column as the first parameter.
|
122
|
+
#
|
123
|
+
# method_call(a,
|
124
|
+
# b)
|
125
|
+
#
|
126
|
+
# The `with_fixed_indentation` style aligns the following lines with one
|
127
|
+
# level of indentation relative to the start of the line with the method call.
|
128
|
+
#
|
129
|
+
# method_call(a,
|
130
|
+
# b)
|
131
|
+
EnforcedStyle: with_first_parameter
|
132
|
+
SupportedStyles:
|
133
|
+
- with_first_parameter
|
134
|
+
- with_fixed_indentation
|
135
|
+
|
136
|
+
Style/AndOr:
|
137
|
+
# Whether `and` and `or` are banned only in conditionals (conditionals)
|
138
|
+
# or completely (always).
|
139
|
+
EnforcedStyle: always
|
140
|
+
SupportedStyles:
|
141
|
+
- always
|
142
|
+
- conditionals
|
143
|
+
|
144
|
+
|
145
|
+
# Checks if usage of %() or %Q() matches configuration.
|
146
|
+
Style/BarePercentLiterals:
|
147
|
+
EnforcedStyle: bare_percent
|
148
|
+
SupportedStyles:
|
149
|
+
- percent_q
|
150
|
+
- bare_percent
|
151
|
+
|
152
|
+
Style/BlockDelimiters:
|
153
|
+
EnforcedStyle: line_count_based
|
154
|
+
SupportedStyles:
|
155
|
+
# The `line_count_based` style enforces braces around single line blocks and
|
156
|
+
# do..end around multi-line blocks.
|
157
|
+
- line_count_based
|
158
|
+
# The `semantic` style enforces braces around functional blocks, where the
|
159
|
+
# primary purpose of the block is to return a value and do..end for
|
160
|
+
# procedural blocks, where the primary purpose of the block is its
|
161
|
+
# side-effects.
|
162
|
+
#
|
163
|
+
# This looks at the usage of a block's method to determine its type (e.g. is
|
164
|
+
# the result of a `map` assigned to a variable or passed to another
|
165
|
+
# method) but exceptions are permitted in the `ProceduralMethods`,
|
166
|
+
# `FunctionalMethods` and `IgnoredMethods` sections below.
|
167
|
+
- semantic
|
168
|
+
ProceduralMethods:
|
169
|
+
# Methods that are known to be procedural in nature but look functional from
|
170
|
+
# their usage, e.g.
|
171
|
+
#
|
172
|
+
# time = Benchmark.realtime do
|
173
|
+
# foo.bar
|
174
|
+
# end
|
175
|
+
#
|
176
|
+
# Here, the return value of the block is discarded but the return value of
|
177
|
+
# `Benchmark.realtime` is used.
|
178
|
+
- benchmark
|
179
|
+
- bm
|
180
|
+
- bmbm
|
181
|
+
- create
|
182
|
+
- each_with_object
|
183
|
+
- measure
|
184
|
+
- new
|
185
|
+
- realtime
|
186
|
+
- tap
|
187
|
+
- with_object
|
188
|
+
FunctionalMethods:
|
189
|
+
# Methods that are known to be functional in nature but look procedural from
|
190
|
+
# their usage, e.g.
|
191
|
+
#
|
192
|
+
# let(:foo) { Foo.new }
|
193
|
+
#
|
194
|
+
# Here, the return value of `Foo.new` is used to define a `foo` helper but
|
195
|
+
# doesn't appear to be used from the return value of `let`.
|
196
|
+
- let
|
197
|
+
- let!
|
198
|
+
- subject
|
199
|
+
- watch
|
200
|
+
IgnoredMethods:
|
201
|
+
# Methods that can be either procedural or functional and cannot be
|
202
|
+
# categorised from their usage alone, e.g.
|
203
|
+
#
|
204
|
+
# foo = lambda do |x|
|
205
|
+
# puts "Hello, #{x}"
|
206
|
+
# end
|
207
|
+
#
|
208
|
+
# foo = lambda do |x|
|
209
|
+
# x * 100
|
210
|
+
# end
|
211
|
+
#
|
212
|
+
# Here, it is impossible to tell from the return value of `lambda` whether
|
213
|
+
# the inner block's return value is significant.
|
214
|
+
- lambda
|
215
|
+
- proc
|
216
|
+
- it
|
217
|
+
|
218
|
+
Style/BracesAroundHashParameters:
|
219
|
+
EnforcedStyle: no_braces
|
220
|
+
SupportedStyles:
|
221
|
+
# The `braces` style enforces braces around all method parameters that are
|
222
|
+
# hashes.
|
223
|
+
- braces
|
224
|
+
# The `no_braces` style checks that the last parameter doesn't have braces
|
225
|
+
# around it.
|
226
|
+
- no_braces
|
227
|
+
# The `context_dependent` style checks that the last parameter doesn't have
|
228
|
+
# braces around it, but requires braces if the second to last parameter is
|
229
|
+
# also a hash literal.
|
230
|
+
- context_dependent
|
231
|
+
|
232
|
+
# Indentation of `when`.
|
233
|
+
Style/CaseIndentation:
|
234
|
+
IndentWhenRelativeTo: case
|
235
|
+
SupportedStyles:
|
236
|
+
- case
|
237
|
+
- end
|
238
|
+
IndentOneStep: false
|
239
|
+
|
240
|
+
Style/ClassAndModuleChildren:
|
241
|
+
# Checks the style of children definitions at classes and modules.
|
242
|
+
#
|
243
|
+
# Basically there are two different styles:
|
244
|
+
#
|
245
|
+
# `nested` - have each child on a separate line
|
246
|
+
# class Foo
|
247
|
+
# class Bar
|
248
|
+
# end
|
249
|
+
# end
|
250
|
+
#
|
251
|
+
# `compact` - combine definitions as much as possible
|
252
|
+
# class Foo::Bar
|
253
|
+
# end
|
254
|
+
#
|
255
|
+
# The compact style is only forced, for classes / modules with one child.
|
256
|
+
EnforcedStyle: nested
|
257
|
+
SupportedStyles:
|
258
|
+
- nested
|
259
|
+
- compact
|
260
|
+
|
261
|
+
Style/ClassCheck:
|
262
|
+
EnforcedStyle: is_a?
|
263
|
+
SupportedStyles:
|
264
|
+
- is_a?
|
265
|
+
- kind_of?
|
266
|
+
|
267
|
+
# Align with the style guide.
|
268
|
+
Style/CollectionMethods:
|
269
|
+
# Mapping from undesired method to desired_method
|
270
|
+
# e.g. to use `detect` over `find`:
|
271
|
+
#
|
272
|
+
# CollectionMethods:
|
273
|
+
# PreferredMethods:
|
274
|
+
# find: detect
|
275
|
+
PreferredMethods:
|
276
|
+
collect: 'map'
|
277
|
+
collect!: 'map!'
|
278
|
+
inject: 'reduce'
|
279
|
+
detect: 'find'
|
280
|
+
find_all: 'select'
|
281
|
+
|
282
|
+
# Use ` or %x around command literals.
|
283
|
+
Style/CommandLiteral:
|
284
|
+
EnforcedStyle: backticks
|
285
|
+
# backticks: Always use backticks.
|
286
|
+
# percent_x: Always use %x.
|
287
|
+
# mixed: Use backticks on single-line commands, and %x on multi-line commands.
|
288
|
+
SupportedStyles:
|
289
|
+
- backticks
|
290
|
+
- percent_x
|
291
|
+
- mixed
|
292
|
+
# If false, the cop will always recommend using %x if one or more backticks
|
293
|
+
# are found in the command string.
|
294
|
+
AllowInnerBackticks: false
|
295
|
+
|
296
|
+
# Checks formatting of special comments
|
297
|
+
Style/CommentAnnotation:
|
298
|
+
Keywords:
|
299
|
+
- TODO
|
300
|
+
- FIXME
|
301
|
+
- OPTIMIZE
|
302
|
+
- HACK
|
303
|
+
- REVIEW
|
304
|
+
|
305
|
+
# Checks that you have put a copyright in a comment before any code.
|
306
|
+
#
|
307
|
+
# You can override the default Notice in your .rubocop.yml file.
|
308
|
+
#
|
309
|
+
# In order to use autocorrect, you must supply a value for the
|
310
|
+
# AutocorrectNotice key that matches the regexp Notice. A blank
|
311
|
+
# AutocorrectNotice will cause an error during autocorrect.
|
312
|
+
#
|
313
|
+
# Autocorrect will add a copyright notice in a comment at the top
|
314
|
+
# of the file immediately after any shebang or encoding comments.
|
315
|
+
#
|
316
|
+
# Example rubocop.yml:
|
317
|
+
#
|
318
|
+
# Style/Copyright:
|
319
|
+
# Enabled: true
|
320
|
+
# Notice: 'Copyright (\(c\) )?2015 Yahoo! Inc'
|
321
|
+
# AutocorrectNotice: '# Copyright (c) 2015 Yahoo! Inc.'
|
322
|
+
#
|
323
|
+
Style/Copyright:
|
324
|
+
Notice: '^Copyright (\(c\) )?2[0-9]{3} .+'
|
325
|
+
AutocorrectNotice: ''
|
326
|
+
|
327
|
+
# Multi-line method chaining should be done with leading dots.
|
328
|
+
Style/DotPosition:
|
329
|
+
EnforcedStyle: leading
|
330
|
+
SupportedStyles:
|
331
|
+
- leading
|
332
|
+
- trailing
|
333
|
+
|
334
|
+
# Warn on empty else statements
|
335
|
+
# empty - warn only on empty else
|
336
|
+
# nil - warn on else with nil in it
|
337
|
+
# both - warn on empty else and else with nil in it
|
338
|
+
Style/EmptyElse:
|
339
|
+
EnforcedStyle: both
|
340
|
+
SupportedStyles:
|
341
|
+
- empty
|
342
|
+
- nil
|
343
|
+
- both
|
344
|
+
|
345
|
+
# Use empty lines between defs.
|
346
|
+
Style/EmptyLineBetweenDefs:
|
347
|
+
# If true, this parameter means that single line method definitions don't
|
348
|
+
# need an empty line between them.
|
349
|
+
AllowAdjacentOneLineDefs: false
|
350
|
+
|
351
|
+
Style/EmptyLinesAroundBlockBody:
|
352
|
+
EnforcedStyle: no_empty_lines
|
353
|
+
SupportedStyles:
|
354
|
+
- empty_lines
|
355
|
+
- no_empty_lines
|
356
|
+
|
357
|
+
Style/EmptyLinesAroundClassBody:
|
358
|
+
EnforcedStyle: no_empty_lines
|
359
|
+
SupportedStyles:
|
360
|
+
- empty_lines
|
361
|
+
- no_empty_lines
|
362
|
+
|
363
|
+
Style/EmptyLinesAroundModuleBody:
|
364
|
+
EnforcedStyle: no_empty_lines
|
365
|
+
SupportedStyles:
|
366
|
+
- empty_lines
|
367
|
+
- no_empty_lines
|
368
|
+
|
369
|
+
# Checks whether the source file has a utf-8 encoding comment or not
|
370
|
+
# AutoCorrectEncodingComment must match the regex
|
371
|
+
# /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
|
372
|
+
Style/Encoding:
|
373
|
+
EnforcedStyle: always
|
374
|
+
SupportedStyles:
|
375
|
+
- when_needed
|
376
|
+
- always
|
377
|
+
AutoCorrectEncodingComment: '# encoding: utf-8'
|
378
|
+
|
379
|
+
Style/FileName:
|
380
|
+
# File names listed in AllCops:Include are excluded by default. Add extra
|
381
|
+
# excludes here.
|
382
|
+
Exclude: []
|
383
|
+
|
384
|
+
Style/FirstParameterIndentation:
|
385
|
+
EnforcedStyle: special_for_inner_method_call_in_parentheses
|
386
|
+
SupportedStyles:
|
387
|
+
# The first parameter should always be indented one step more than the
|
388
|
+
# preceding line.
|
389
|
+
- consistent
|
390
|
+
# The first parameter should normally be indented one step more than the
|
391
|
+
# preceding line, but if it's a parameter for a method call that is itself
|
392
|
+
# a parameter in a method call, then the inner parameter should be indented
|
393
|
+
# relative to the inner method.
|
394
|
+
- special_for_inner_method_call
|
395
|
+
# Same as special_for_inner_method_call except that the special rule only
|
396
|
+
# applies if the outer method call encloses its arguments in parentheses.
|
397
|
+
- special_for_inner_method_call_in_parentheses
|
398
|
+
|
399
|
+
# Checks use of for or each in multiline loops.
|
400
|
+
Style/For:
|
401
|
+
EnforcedStyle: each
|
402
|
+
SupportedStyles:
|
403
|
+
- for
|
404
|
+
- each
|
405
|
+
|
406
|
+
# Enforce the method used for string formatting.
|
407
|
+
Style/FormatString:
|
408
|
+
EnforcedStyle: format
|
409
|
+
SupportedStyles:
|
410
|
+
- format
|
411
|
+
- sprintf
|
412
|
+
- percent
|
413
|
+
|
414
|
+
# Built-in global variables are allowed by default.
|
415
|
+
Style/GlobalVars:
|
416
|
+
AllowedVariables: []
|
417
|
+
|
418
|
+
# `MinBodyLength` defines the number of lines of the a body of an if / unless
|
419
|
+
# needs to have to trigger this cop
|
420
|
+
Style/GuardClause:
|
421
|
+
MinBodyLength: 1
|
422
|
+
|
423
|
+
Style/HashSyntax:
|
424
|
+
EnforcedStyle: ruby19
|
425
|
+
SupportedStyles:
|
426
|
+
- ruby19
|
427
|
+
- ruby19_no_mixed_keys
|
428
|
+
- hash_rockets
|
429
|
+
# Force hashes that have a symbol value to use hash rockets
|
430
|
+
UseHashRocketsWithSymbolValues: false
|
431
|
+
|
432
|
+
Style/IfUnlessModifier:
|
433
|
+
MaxLineLength: 120
|
434
|
+
|
435
|
+
Style/IndentationConsistency:
|
436
|
+
# The difference between `rails` and `normal` is that the `rails` style
|
437
|
+
# prescribes that in classes and modules the `protected` and `private`
|
438
|
+
# modifier keywords shall be indented the same as public methods and that
|
439
|
+
# protected and private members shall be indented one step more than the
|
440
|
+
# modifiers. Other than that, both styles mean that entities on the same
|
441
|
+
# logical depth shall have the same indentation.
|
442
|
+
EnforcedStyle: normal
|
443
|
+
SupportedStyles:
|
444
|
+
- normal
|
445
|
+
- rails
|
446
|
+
|
447
|
+
Style/IndentationWidth:
|
448
|
+
# Number of spaces for each indentation level.
|
449
|
+
Width: 2
|
450
|
+
|
451
|
+
# Checks the indentation of the first key in a hash literal.
|
452
|
+
Style/IndentHash:
|
453
|
+
# The value `special_inside_parentheses` means that hash literals with braces
|
454
|
+
# that have their opening brace on the same line as a surrounding opening
|
455
|
+
# round parenthesis, shall have their first key indented relative to the
|
456
|
+
# first position inside the parenthesis.
|
457
|
+
# The value `consistent` means that the indentation of the first key shall
|
458
|
+
# always be relative to the first position of the line where the opening
|
459
|
+
# brace is.
|
460
|
+
EnforcedStyle: special_inside_parentheses
|
461
|
+
SupportedStyles:
|
462
|
+
- special_inside_parentheses
|
463
|
+
- consistent
|
464
|
+
|
465
|
+
Style/LambdaCall:
|
466
|
+
EnforcedStyle: call
|
467
|
+
SupportedStyles:
|
468
|
+
- call
|
469
|
+
- braces
|
470
|
+
|
471
|
+
Style/Next:
|
472
|
+
# With `always` all conditions at the end of an iteration needs to be
|
473
|
+
# replaced by next - with `skip_modifier_ifs` the modifier if like this one
|
474
|
+
# are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
|
475
|
+
EnforcedStyle: skip_modifier_ifs
|
476
|
+
# `MinBodyLength` defines the number of lines of the a body of an if / unless
|
477
|
+
# needs to have to trigger this cop
|
478
|
+
MinBodyLength: 3
|
479
|
+
SupportedStyles:
|
480
|
+
- skip_modifier_ifs
|
481
|
+
- always
|
482
|
+
|
483
|
+
Style/NonNilCheck:
|
484
|
+
# With `IncludeSemanticChanges` set to `true`, this cop reports offenses for
|
485
|
+
# `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
|
486
|
+
# **usually** OK, but might change behavior.
|
487
|
+
#
|
488
|
+
# With `IncludeSemanticChanges` set to `false`, this cop does not report
|
489
|
+
# offenses for `!x.nil?` and does no changes that might change behavior.
|
490
|
+
IncludeSemanticChanges: false
|
491
|
+
|
492
|
+
Style/MethodDefParentheses:
|
493
|
+
EnforcedStyle: require_parentheses
|
494
|
+
SupportedStyles:
|
495
|
+
- require_parentheses
|
496
|
+
- require_no_parentheses
|
497
|
+
|
498
|
+
Style/MethodName:
|
499
|
+
EnforcedStyle: snake_case
|
500
|
+
SupportedStyles:
|
501
|
+
- snake_case
|
502
|
+
- camelCase
|
503
|
+
|
504
|
+
Style/MultilineOperationIndentation:
|
505
|
+
EnforcedStyle: aligned
|
506
|
+
SupportedStyles:
|
507
|
+
- aligned
|
508
|
+
- indented
|
509
|
+
|
510
|
+
Style/NumericLiterals:
|
511
|
+
MinDigits: 5
|
512
|
+
|
513
|
+
# Allow safe assignment in conditions.
|
514
|
+
Style/ParenthesesAroundCondition:
|
515
|
+
AllowSafeAssignment: true
|
516
|
+
|
517
|
+
Style/PercentLiteralDelimiters:
|
518
|
+
PreferredDelimiters:
|
519
|
+
'%': ()
|
520
|
+
'%i': ()
|
521
|
+
'%q': ()
|
522
|
+
'%Q': ()
|
523
|
+
'%r': '{}'
|
524
|
+
'%s': ()
|
525
|
+
'%w': ()
|
526
|
+
'%W': ()
|
527
|
+
'%x': ()
|
528
|
+
|
529
|
+
Style/PercentQLiterals:
|
530
|
+
EnforcedStyle: lower_case_q
|
531
|
+
SupportedStyles:
|
532
|
+
- lower_case_q # Use %q when possible, %Q when necessary
|
533
|
+
- upper_case_q # Always use %Q
|
534
|
+
|
535
|
+
Style/PredicateName:
|
536
|
+
# Predicate name prefices.
|
537
|
+
NamePrefix:
|
538
|
+
- is_
|
539
|
+
- has_
|
540
|
+
- have_
|
541
|
+
# Predicate name prefices that should be removed.
|
542
|
+
NamePrefixBlacklist:
|
543
|
+
- is_
|
544
|
+
- has_
|
545
|
+
- have_
|
546
|
+
|
547
|
+
Style/RaiseArgs:
|
548
|
+
EnforcedStyle: exploded
|
549
|
+
SupportedStyles:
|
550
|
+
- compact # raise Exception.new(msg)
|
551
|
+
- exploded # raise Exception, msg
|
552
|
+
|
553
|
+
Style/RedundantReturn:
|
554
|
+
# When true allows code like `return x, y`.
|
555
|
+
AllowMultipleReturnValues: false
|
556
|
+
|
557
|
+
# Use / or %r around regular expressions.
|
558
|
+
Style/RegexpLiteral:
|
559
|
+
EnforcedStyle: slashes
|
560
|
+
# slashes: Always use slashes.
|
561
|
+
# percent_r: Always use %r.
|
562
|
+
# mixed: Use slashes on single-line regexes, and %r on multi-line regexes.
|
563
|
+
SupportedStyles:
|
564
|
+
- slashes
|
565
|
+
- percent_r
|
566
|
+
- mixed
|
567
|
+
# If false, the cop will always recommend using %r if one or more slashes
|
568
|
+
# are found in the regexp string.
|
569
|
+
AllowInnerSlashes: false
|
570
|
+
|
571
|
+
Style/Semicolon:
|
572
|
+
# Allow ; to separate several expressions on the same line.
|
573
|
+
AllowAsExpressionSeparator: false
|
574
|
+
|
575
|
+
Style/SignalException:
|
576
|
+
EnforcedStyle: semantic
|
577
|
+
SupportedStyles:
|
578
|
+
- only_raise
|
579
|
+
- only_fail
|
580
|
+
- semantic
|
581
|
+
|
582
|
+
Style/SingleLineBlockParams:
|
583
|
+
Methods:
|
584
|
+
- reduce:
|
585
|
+
- a
|
586
|
+
- e
|
587
|
+
- inject:
|
588
|
+
- a
|
589
|
+
- e
|
590
|
+
|
591
|
+
Style/SingleLineMethods:
|
592
|
+
AllowIfMethodIsEmpty: true
|
593
|
+
|
594
|
+
Style/StringLiterals:
|
595
|
+
EnforcedStyle: double_quotes
|
596
|
+
SupportedStyles:
|
597
|
+
- single_quotes
|
598
|
+
- double_quotes
|
599
|
+
|
600
|
+
Style/StringLiteralsInInterpolation:
|
601
|
+
EnforcedStyle: double_quotes
|
602
|
+
SupportedStyles:
|
603
|
+
- single_quotes
|
604
|
+
- double_quotes
|
605
|
+
|
606
|
+
Style/SpaceAroundBlockParameters:
|
607
|
+
EnforcedStyleInsidePipes: no_space
|
608
|
+
SupportedStyles:
|
609
|
+
- space
|
610
|
+
- no_space
|
611
|
+
|
612
|
+
Style/SpaceAroundEqualsInParameterDefault:
|
613
|
+
EnforcedStyle: space
|
614
|
+
SupportedStyles:
|
615
|
+
- space
|
616
|
+
- no_space
|
617
|
+
|
618
|
+
Style/SpaceAroundOperators:
|
619
|
+
MultiSpaceAllowedForOperators:
|
620
|
+
- '='
|
621
|
+
- '=>'
|
622
|
+
|
623
|
+
Style/SpaceBeforeBlockBraces:
|
624
|
+
EnforcedStyle: space
|
625
|
+
SupportedStyles:
|
626
|
+
- space
|
627
|
+
- no_space
|
628
|
+
|
629
|
+
Style/SpaceInsideBlockBraces:
|
630
|
+
EnforcedStyle: space
|
631
|
+
SupportedStyles:
|
632
|
+
- space
|
633
|
+
- no_space
|
634
|
+
# Valid values are: space, no_space
|
635
|
+
EnforcedStyleForEmptyBraces: no_space
|
636
|
+
# Space between { and |. Overrides EnforcedStyle if there is a conflict.
|
637
|
+
SpaceBeforeBlockParameters: true
|
638
|
+
|
639
|
+
Style/SpaceInsideHashLiteralBraces:
|
640
|
+
EnforcedStyle: space
|
641
|
+
EnforcedStyleForEmptyBraces: no_space
|
642
|
+
SupportedStyles:
|
643
|
+
- space
|
644
|
+
- no_space
|
645
|
+
|
646
|
+
Style/SymbolProc:
|
647
|
+
# A list of method names to be ignored by the check.
|
648
|
+
# The names should be fairly unique, otherwise you'll end up ignoring lots of code.
|
649
|
+
IgnoredMethods:
|
650
|
+
- respond_to
|
651
|
+
|
652
|
+
Style/TrailingBlankLines:
|
653
|
+
EnforcedStyle: final_newline
|
654
|
+
SupportedStyles:
|
655
|
+
- final_newline
|
656
|
+
- final_blank_line
|
657
|
+
|
658
|
+
Style/TrailingComma:
|
659
|
+
# If EnforcedStyleForMultiline is comma, the cop requires a comma after the
|
660
|
+
# last item of a list, but only for lists where each item is on its own line.
|
661
|
+
# If EnforcedStyleForMultiline is consistent_comma, the cop requires a comma
|
662
|
+
# after the last item of a list, for all lists.
|
663
|
+
EnforcedStyleForMultiline: no_comma
|
664
|
+
SupportedStyles:
|
665
|
+
- comma
|
666
|
+
- consistent_comma
|
667
|
+
- no_comma
|
668
|
+
|
669
|
+
# TrivialAccessors requires exact name matches and doesn't allow
|
670
|
+
# predicated methods by default.
|
671
|
+
Style/TrivialAccessors:
|
672
|
+
# When set to false the cop will suggest the use of accessor methods
|
673
|
+
# in situations like:
|
674
|
+
#
|
675
|
+
# def name
|
676
|
+
# @other_name
|
677
|
+
# end
|
678
|
+
#
|
679
|
+
# This way you can uncover "hidden" attributes in your code.
|
680
|
+
ExactNameMatch: true
|
681
|
+
AllowPredicates: false
|
682
|
+
# Allows trivial writers that don't end in an equal sign. e.g.
|
683
|
+
#
|
684
|
+
# def on_exception(action)
|
685
|
+
# @on_exception=action
|
686
|
+
# end
|
687
|
+
# on_exception :restart
|
688
|
+
#
|
689
|
+
# Commonly used in DSLs
|
690
|
+
AllowDSLWriters: false
|
691
|
+
IgnoreClassMethods: false
|
692
|
+
Whitelist:
|
693
|
+
- to_ary
|
694
|
+
- to_a
|
695
|
+
- to_c
|
696
|
+
- to_enum
|
697
|
+
- to_h
|
698
|
+
- to_hash
|
699
|
+
- to_i
|
700
|
+
- to_int
|
701
|
+
- to_io
|
702
|
+
- to_open
|
703
|
+
- to_path
|
704
|
+
- to_proc
|
705
|
+
- to_r
|
706
|
+
- to_regexp
|
707
|
+
- to_str
|
708
|
+
- to_s
|
709
|
+
- to_sym
|
710
|
+
|
711
|
+
Style/VariableName:
|
712
|
+
EnforcedStyle: snake_case
|
713
|
+
SupportedStyles:
|
714
|
+
- snake_case
|
715
|
+
- camelCase
|
716
|
+
|
717
|
+
Style/WhileUntilModifier:
|
718
|
+
MaxLineLength: 80
|
719
|
+
|
720
|
+
Style/WordArray:
|
721
|
+
MinSize: 0
|
722
|
+
# The regular expression WordRegex decides what is considered a word.
|
723
|
+
WordRegex: !ruby/regexp '/\A[\p{Word}]+\z/'
|
724
|
+
|
725
|
+
##################### Metrics ##################################
|
726
|
+
|
727
|
+
Metrics/AbcSize:
|
728
|
+
# The ABC size is a calculated magnitude, so this number can be a Fixnum or
|
729
|
+
# a Float.
|
730
|
+
Max: 15
|
731
|
+
|
732
|
+
Metrics/BlockNesting:
|
733
|
+
Max: 3
|
734
|
+
|
735
|
+
Metrics/ClassLength:
|
736
|
+
CountComments: false # count full line comments?
|
737
|
+
Max: 100
|
738
|
+
|
739
|
+
Metrics/ModuleLength:
|
740
|
+
CountComments: false # count full line comments?
|
741
|
+
Max: 100
|
742
|
+
|
743
|
+
# Avoid complex methods.
|
744
|
+
Metrics/CyclomaticComplexity:
|
745
|
+
Max: 6
|
746
|
+
|
747
|
+
Metrics/LineLength:
|
748
|
+
Max: 80
|
749
|
+
# To make it possible to copy or click on URIs in the code, we allow lines
|
750
|
+
# contaning a URI to be longer than Max.
|
751
|
+
AllowURI: true
|
752
|
+
URISchemes:
|
753
|
+
- http
|
754
|
+
- https
|
755
|
+
|
756
|
+
Metrics/MethodLength:
|
757
|
+
CountComments: false # count full line comments?
|
758
|
+
Max: 10
|
759
|
+
|
760
|
+
Metrics/ParameterLists:
|
761
|
+
Max: 5
|
762
|
+
CountKeywordArgs: true
|
763
|
+
|
764
|
+
Metrics/PerceivedComplexity:
|
765
|
+
Max: 7
|
766
|
+
|
767
|
+
##################### Lint ##################################
|
768
|
+
|
769
|
+
# Allow safe assignment in conditions.
|
770
|
+
Lint/AssignmentInCondition:
|
771
|
+
AllowSafeAssignment: true
|
772
|
+
|
773
|
+
# Align ends correctly.
|
774
|
+
Lint/EndAlignment:
|
775
|
+
# The value `keyword` means that `end` should be aligned with the matching
|
776
|
+
# keyword (if, while, etc.).
|
777
|
+
# The value `variable` means that in assignments, `end` should be aligned
|
778
|
+
# with the start of the variable on the left hand side of `=`. In all other
|
779
|
+
# situations, `end` should still be aligned with the keyword.
|
780
|
+
AlignWith: keyword
|
781
|
+
SupportedStyles:
|
782
|
+
- keyword
|
783
|
+
- variable
|
784
|
+
AutoCorrect: false
|
785
|
+
|
786
|
+
Lint/DefEndAlignment:
|
787
|
+
# The value `def` means that `end` should be aligned with the def keyword.
|
788
|
+
# The value `start_of_line` means that `end` should be aligned with method
|
789
|
+
# calls like `private`, `public`, etc, if present in front of the `def`
|
790
|
+
# keyword on the same line.
|
791
|
+
AlignWith: start_of_line
|
792
|
+
SupportedStyles:
|
793
|
+
- start_of_line
|
794
|
+
- def
|
795
|
+
AutoCorrect: false
|
796
|
+
|
797
|
+
##################### Rails ##################################
|
798
|
+
|
799
|
+
Rails/ActionFilter:
|
800
|
+
EnforcedStyle: action
|
801
|
+
SupportedStyles:
|
802
|
+
- action
|
803
|
+
- filter
|
804
|
+
Include:
|
805
|
+
- app/controllers/**/*.rb
|
806
|
+
|
807
|
+
Rails/Date:
|
808
|
+
# The value `always` disallows usage of `Date.today`, `Date.current`,
|
809
|
+
# `Date#to_time` etc.
|
810
|
+
# The value `acceptable` allows usage of `Date.current`, `Date.yesterday`, etc
|
811
|
+
# (but not `Date.today`) which are overriden by ActiveSupport to handle current
|
812
|
+
# time zone.
|
813
|
+
EnforcedStyle: always
|
814
|
+
SupportedStyles:
|
815
|
+
- always
|
816
|
+
- acceptable
|
817
|
+
|
818
|
+
Rails/DefaultScope:
|
819
|
+
Include:
|
820
|
+
- app/models/**/*.rb
|
821
|
+
|
822
|
+
Rails/FindBy:
|
823
|
+
Include:
|
824
|
+
- app/models/**/*.rb
|
825
|
+
|
826
|
+
Rails/FindEach:
|
827
|
+
Include:
|
828
|
+
- app/models/**/*.rb
|
829
|
+
|
830
|
+
Rails/HasAndBelongsToMany:
|
831
|
+
Include:
|
832
|
+
- app/models/**/*.rb
|
833
|
+
|
834
|
+
Rails/Output:
|
835
|
+
Include:
|
836
|
+
- app/**/*.rb
|
837
|
+
- config/**/*.rb
|
838
|
+
- db/**/*.rb
|
839
|
+
- lib/**/*.rb
|
840
|
+
|
841
|
+
Rails/ReadWriteAttribute:
|
842
|
+
Include:
|
843
|
+
- app/models/**/*.rb
|
844
|
+
|
845
|
+
Rails/ScopeArgs:
|
846
|
+
Include:
|
847
|
+
- app/models/**/*.rb
|
848
|
+
|
849
|
+
Rails/TimeZone:
|
850
|
+
# The value `always` means that `Time` should be used with `zone`.
|
851
|
+
# The value `acceptable` allows usage of `in_time_zone` instead of `zone`.
|
852
|
+
EnforcedStyle: always
|
853
|
+
SupportedStyles:
|
854
|
+
- always
|
855
|
+
- acceptable
|
856
|
+
|
857
|
+
Rails/Validation:
|
858
|
+
Include:
|
859
|
+
- app/models/**/*.rb
|