couchdb-ruby-server 1.0.1 → 1.1.1

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