internal-affairs 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e71aee6ec52d850d76ad3db18e034f4efaeeb1c79e7a774bf47a79fe038a4f4d
4
+ data.tar.gz: cf8b1e595af9c5d49d5906241877478f09af971525f6239a81c621ac6bbb256c
5
+ SHA512:
6
+ metadata.gz: d2df655bdfb88d498da415b02dbef02847070725dde3b6731f721d0d67318691ef356bc2ef800fdf0db7bc8f01427d3e98bc389b68ceb95b3ab68f40f0dfe397
7
+ data.tar.gz: c9a0bf8c4dfb15e24337cdabbdf465cc82176cf76a769041d2ffb4f60fbd443590acb00be4ab64e6ff66bc7eb014acb9848c8e6ba861e4d0f9c1ca0ac942b083
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ .bundle
2
+ Gemfile.lock
3
+ bin
4
+ coverage
5
+ pkg/*
6
+ gemfiles/**/*.gemfile.lock
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --fail-fast
data/.rubocop.yml ADDED
@@ -0,0 +1,497 @@
1
+ require:
2
+ - rubocop-rspec
3
+ - rubocop-performance
4
+ - rubocop-rails
5
+ AllCops:
6
+ Exclude:
7
+ - "vendor/**/*"
8
+ - "db/**/*"
9
+ - "bin/**/*"
10
+ DisplayCopNames: false
11
+ TargetRubyVersion: 2.5
12
+ Rails:
13
+ Enabled: true
14
+ Layout/ParameterAlignment:
15
+ Description: Align the parameters of a method call if they span more than one line.
16
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
17
+ Enabled: true
18
+ EnforcedStyle: with_fixed_indentation
19
+ SupportedStyles:
20
+ - with_first_parameter
21
+ - with_fixed_indentation
22
+ Metrics/BlockLength:
23
+ Enabled: false
24
+ Style/ClassAndModuleChildren:
25
+ Description: Checks style of children classes and modules.
26
+ Enabled: false
27
+ EnforcedStyle: nested
28
+ SupportedStyles:
29
+ - nested
30
+ - compact
31
+ Style/CommentAnnotation:
32
+ Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK,
33
+ REVIEW).
34
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#annotate-keywords
35
+ Enabled: false
36
+ Keywords:
37
+ - TODO
38
+ - FIXME
39
+ - OPTIMIZE
40
+ - HACK
41
+ - REVIEW
42
+ Naming/FileName:
43
+ Description: Use snake_case for source file names.
44
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
45
+ Enabled: false
46
+ Exclude: []
47
+ Style/FormatString:
48
+ Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%.
49
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#sprintf
50
+ Enabled: false
51
+ EnforcedStyle: format
52
+ SupportedStyles:
53
+ - format
54
+ - sprintf
55
+ - percent
56
+ Style/FrozenStringLiteralComment:
57
+ Enabled: false
58
+ Style/GlobalVars:
59
+ Description: Do not introduce global variables.
60
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#instance-vars
61
+ Enabled: false
62
+ AllowedVariables: []
63
+ Style/GuardClause:
64
+ Description: Check for conditionals that can be replaced with guard clauses
65
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
66
+ Enabled: false
67
+ MinBodyLength: 1
68
+ Style/IfUnlessModifier:
69
+ Description: Favor modifier if/unless usage when you have a single-line body.
70
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
71
+ Enabled: false
72
+ Style/LambdaCall:
73
+ Description: Use lambda.call(...) instead of lambda.(...).
74
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call
75
+ Enabled: false
76
+ EnforcedStyle: call
77
+ SupportedStyles:
78
+ - call
79
+ - braces
80
+ Style/Next:
81
+ Description: Use `next` to skip iteration instead of a condition at the end.
82
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
83
+ Enabled: false
84
+ EnforcedStyle: skip_modifier_ifs
85
+ MinBodyLength: 3
86
+ SupportedStyles:
87
+ - skip_modifier_ifs
88
+ - always
89
+ Layout/MultilineOperationIndentation:
90
+ Description: Checks indentation of binary operations that span more than one line.
91
+ Enabled: true
92
+ EnforcedStyle: indented
93
+ SupportedStyles:
94
+ - aligned
95
+ - indented
96
+ Style/MutableConstant:
97
+ Description: Do not assign mutable objects to constants.
98
+ Enabled: false
99
+ Style/NumericLiterals:
100
+ Description: Add underscores to large numeric literals to improve their readability.
101
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
102
+ Enabled: false
103
+ MinDigits: 5
104
+ Style/PercentLiteralDelimiters:
105
+ Description: Use `%`-literal delimiters consistently
106
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
107
+ Enabled: false
108
+ PreferredDelimiters:
109
+ "%": "()"
110
+ "%i": "()"
111
+ "%q": "()"
112
+ "%Q": "()"
113
+ "%r": "{}"
114
+ "%s": "()"
115
+ "%w": "()"
116
+ "%W": "()"
117
+ "%x": "()"
118
+ Naming/PredicateName:
119
+ Description: Check the names of predicate methods.
120
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
121
+ Enabled: true
122
+ NamePrefix:
123
+ - is_
124
+ - has_
125
+ - have_
126
+ ForbiddenPrefixes:
127
+ - is_
128
+ Style/RaiseArgs:
129
+ Description: Checks the arguments passed to raise/fail.
130
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
131
+ Enabled: false
132
+ EnforcedStyle: exploded
133
+ SupportedStyles:
134
+ - compact
135
+ - exploded
136
+ Style/SignalException:
137
+ Description: Checks for proper usage of fail and raise.
138
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
139
+ Enabled: false
140
+ EnforcedStyle: semantic
141
+ SupportedStyles:
142
+ - only_raise
143
+ - only_fail
144
+ - semantic
145
+ Style/SingleLineMethods:
146
+ Description: Avoid single-line methods.
147
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
148
+ Enabled: false
149
+ AllowIfMethodIsEmpty: true
150
+ Style/StringLiterals:
151
+ Description: Checks if uses of quotes match the configured preference.
152
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
153
+ Enabled: false
154
+ EnforcedStyle: double_quotes
155
+ SupportedStyles:
156
+ - single_quotes
157
+ - double_quotes
158
+ Style/TrailingCommaInArguments:
159
+ Description: Checks for trailing comma in argument lists.
160
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
161
+ Enabled: true
162
+ Style/TrailingCommaInArrayLiteral:
163
+ Description: Checks for trailing comma in array and hash literals.
164
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-trailing-array-commas
165
+ Enabled: true
166
+ Style/TrailingCommaInHashLiteral:
167
+ Description: Checks for trailing comma in array and hash literals.
168
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-trailing-array-commas
169
+ Enabled: true
170
+ Style/TrivialAccessors:
171
+ Description: Prefer attr_* methods to trivial readers/writers.
172
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr_family
173
+ Enabled: false
174
+ ExactNameMatch: false
175
+ AllowPredicates: false
176
+ AllowDSLWriters: false
177
+ AllowedMethods:
178
+ - to_ary
179
+ - to_a
180
+ - to_c
181
+ - to_enum
182
+ - to_h
183
+ - to_hash
184
+ - to_i
185
+ - to_int
186
+ - to_io
187
+ - to_open
188
+ - to_path
189
+ - to_proc
190
+ - to_r
191
+ - to_regexp
192
+ - to_str
193
+ - to_s
194
+ - to_sym
195
+ Style/WhileUntilModifier:
196
+ Description: Favor modifier while/until usage when you have a single-line body.
197
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier
198
+ Enabled: false
199
+ Style/WordArray:
200
+ Description: Use %w or %W for arrays of words.
201
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-w
202
+ Enabled: false
203
+ MinSize: 0
204
+ WordRegex: !ruby/regexp /\A[\p{Word}]+\z/
205
+ Metrics/AbcSize:
206
+ Description: A calculated magnitude based on number of assignments, branches, and
207
+ conditions.
208
+ Enabled: true
209
+ Max: 25
210
+ Metrics/BlockNesting:
211
+ Description: Avoid excessive block nesting
212
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count
213
+ Enabled: true
214
+ Max: 3
215
+ Metrics/ClassLength:
216
+ Description: Avoid classes longer than 100 lines of code.
217
+ Enabled: false
218
+ CountComments: false
219
+ Max: 100
220
+ Layout/LineLength:
221
+ Description: Limit lines to 100 characters.
222
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#100-character-limits
223
+ Enabled: true
224
+ Max: 100
225
+ IgnoredPatterns: ['\A#']
226
+ AllowURI: true
227
+ URISchemes:
228
+ - http
229
+ - https
230
+ Metrics/MethodLength:
231
+ Description: Avoid methods longer than 15 lines of code.
232
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
233
+ Enabled: true
234
+ CountComments: true
235
+ Max: 15
236
+ Exclude:
237
+ - "spec/**/*"
238
+ Metrics/ParameterLists:
239
+ Description: Avoid long parameter lists.
240
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
241
+ Enabled: false
242
+ Max: 5
243
+ CountKeywordArgs: true
244
+ Lint/AssignmentInCondition:
245
+ Description: Don't use assignment in conditions.
246
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
247
+ Enabled: false
248
+ AllowSafeAssignment: true
249
+ Layout/EndAlignment:
250
+ Description: Align ends correctly.
251
+ Enabled: true
252
+ EnforcedStyleAlignWith: keyword
253
+ SupportedStylesAlignWith:
254
+ - keyword
255
+ - variable
256
+ Layout/DefEndAlignment:
257
+ Description: Align ends corresponding to defs correctly.
258
+ Enabled: true
259
+ EnforcedStyleAlignWith: start_of_line
260
+ SupportedStylesAlignWith:
261
+ - start_of_line
262
+ - def
263
+ Style/SymbolArray:
264
+ Description: Use %i or %I for arrays of symbols.
265
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-i
266
+ Enabled: false
267
+ Layout/ExtraSpacing:
268
+ Description: Do not use unnecessary spacing.
269
+ Enabled: false
270
+ Naming/AccessorMethodName:
271
+ Description: Check the naming of accessor methods for get_/set_.
272
+ Enabled: false
273
+ Style/Alias:
274
+ Description: Use alias_method instead of alias.
275
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
276
+ Enabled: false
277
+ Style/ArrayJoin:
278
+ Description: Use Array#join instead of Array#*.
279
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join
280
+ Enabled: false
281
+ Style/AsciiComments:
282
+ Description: Use only ascii symbols in comments.
283
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-comments
284
+ Enabled: false
285
+ Naming/AsciiIdentifiers:
286
+ Description: Use only ascii symbols in identifiers.
287
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-identifiers
288
+ Enabled: false
289
+ Style/Attr:
290
+ Description: Checks for uses of Module#attr.
291
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr
292
+ Enabled: false
293
+ Style/BlockComments:
294
+ Description: Do not use block comments.
295
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments
296
+ Enabled: false
297
+ Style/CaseEquality:
298
+ Description: Avoid explicit use of the case equality operator(===).
299
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-case-equality
300
+ Enabled: false
301
+ Style/CharacterLiteral:
302
+ Description: Checks for uses of character literals.
303
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-character-literals
304
+ Enabled: false
305
+ Style/ClassVars:
306
+ Description: Avoid the use of class variables.
307
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-class-vars
308
+ Enabled: false
309
+ Style/ColonMethodCall:
310
+ Description: 'Do not use :: for method call.'
311
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#double-colons
312
+ Enabled: false
313
+ Style/PreferredHashMethods:
314
+ Description: Checks for use of deprecated Hash methods.
315
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-key
316
+ Enabled: false
317
+ Style/Documentation:
318
+ Description: Document classes and non-namespace modules.
319
+ Enabled: false
320
+ Style/DoubleNegation:
321
+ Description: Checks for uses of double negation (!!).
322
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
323
+ Enabled: false
324
+ Style/EachWithObject:
325
+ Description: Prefer `each_with_object` over `inject` or `reduce`.
326
+ Enabled: false
327
+ Style/EmptyElse:
328
+ Description: Avoid empty else-clauses.
329
+ Enabled: true
330
+ Style/EmptyLiteral:
331
+ Description: Prefer literals to Array.new/Hash.new/String.new.
332
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
333
+ Enabled: false
334
+ Layout/EndOfLine:
335
+ Description: Use Unix-style line endings.
336
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#crlf
337
+ Enabled: true
338
+ Style/EvenOdd:
339
+ Description: Favor the use of Fixnum#even? && Fixnum#odd?
340
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
341
+ Enabled: false
342
+ Lint/FlipFlop:
343
+ Description: Checks for flip flops
344
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops
345
+ Enabled: false
346
+ Style/IfWithSemicolon:
347
+ Description: Do not use if x; .... Use the ternary operator instead.
348
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs
349
+ Enabled: false
350
+ Style/Lambda:
351
+ Description: Use the new lambda literal syntax for single-line blocks.
352
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#lambda-multi-line
353
+ Enabled: false
354
+ Style/LineEndConcatenation:
355
+ Description: Use \ instead of + or << to concatenate two string literals at line
356
+ end.
357
+ Enabled: false
358
+ Style/ModuleFunction:
359
+ Description: Checks for usage of `extend self` in modules.
360
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
361
+ Enabled: false
362
+ Style/MultilineBlockChain:
363
+ Description: Avoid multi-line chains of blocks.
364
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
365
+ Enabled: false
366
+ Layout/MultilineBlockLayout:
367
+ Description: Ensures newlines after multiline block do statements.
368
+ Enabled: false
369
+ Style/NegatedIf:
370
+ Description: Favor unless over if for negative conditions (or control flow or).
371
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#unless-for-negatives
372
+ Enabled: false
373
+ Style/NegatedWhile:
374
+ Description: Favor until over while for negative conditions.
375
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#until-for-negatives
376
+ Enabled: false
377
+ Style/NilComparison:
378
+ Description: Prefer x.nil? to x == nil.
379
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
380
+ Enabled: false
381
+ Style/OneLineConditional:
382
+ Description: Favor the ternary operator(?:) over if/then/else/end constructs.
383
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
384
+ Enabled: false
385
+ Naming/BinaryOperatorParameterName:
386
+ Description: When defining binary operators, name the argument other.
387
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
388
+ Enabled: false
389
+ Style/PerlBackrefs:
390
+ Description: Avoid Perl-style regex back references.
391
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
392
+ Enabled: false
393
+ Style/Proc:
394
+ Description: Use proc instead of Proc.new.
395
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc
396
+ Enabled: false
397
+ Style/SelfAssignment:
398
+ Description: Checks for places where self-assignment shorthand should have been
399
+ used.
400
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#self-assignment
401
+ Enabled: false
402
+ Layout/SpaceBeforeFirstArg:
403
+ Description: Put a space between a method name and the first argument in a method
404
+ call without parentheses.
405
+ Enabled: true
406
+ Layout/SpaceAroundOperators:
407
+ Description: Use spaces around operators.
408
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
409
+ Enabled: true
410
+ Layout/SpaceInsideParens:
411
+ Description: No spaces after ( or before ).
412
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
413
+ Enabled: true
414
+ Style/SpecialGlobalVars:
415
+ Description: Avoid Perl-style global variables.
416
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
417
+ Enabled: false
418
+ Style/VariableInterpolation:
419
+ Description: Don't interpolate global, instance and class variables directly in
420
+ strings.
421
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
422
+ Enabled: false
423
+ Style/WhenThen:
424
+ Description: Use when x then ... for one-line cases.
425
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
426
+ Enabled: false
427
+ Lint/AmbiguousOperator:
428
+ Description: Checks for ambiguous operators in the first argument of a method invocation
429
+ without parentheses.
430
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-as-args
431
+ Enabled: false
432
+ Lint/AmbiguousRegexpLiteral:
433
+ Description: Checks for ambiguous regexp literals in the first argument of a method
434
+ invocation without parenthesis.
435
+ Enabled: false
436
+ Layout/BlockAlignment:
437
+ Description: Align block ends correctly.
438
+ Enabled: true
439
+ Layout/ConditionPosition:
440
+ Description: Checks for condition placed in a confusing position relative to the
441
+ keyword.
442
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition
443
+ Enabled: false
444
+ Lint/DeprecatedClassMethods:
445
+ Description: Check for deprecated class method calls.
446
+ Enabled: false
447
+ Lint/ElseLayout:
448
+ Description: Check for odd code arrangement in an else block.
449
+ Enabled: false
450
+ Lint/SuppressedException:
451
+ Description: Don't suppress exception.
452
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
453
+ Enabled: false
454
+ Lint/LiteralAsCondition:
455
+ Description: Checks of literals used in conditions.
456
+ Enabled: false
457
+ Lint/LiteralInInterpolation:
458
+ Description: Checks for literals used in interpolation.
459
+ Enabled: false
460
+ Lint/Loop:
461
+ Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
462
+ for post-loop tests.
463
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#loop-with-break
464
+ Enabled: false
465
+ Lint/ParenthesesAsGroupedExpression:
466
+ Description: Checks for method calls with a space before the opening parenthesis.
467
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
468
+ Enabled: false
469
+ Lint/RequireParentheses:
470
+ Description: Use parentheses in the method call to avoid confusion about precedence.
471
+ Enabled: false
472
+ Lint/UnderscorePrefixedVariableName:
473
+ Description: Do not use prefix `_` for a variable that is used.
474
+ Enabled: false
475
+ Lint/Void:
476
+ Description: Possible use of operator/literal/variable in void context.
477
+ Enabled: false
478
+ Rails/Delegate:
479
+ Description: Prefer delegate method for delegations.
480
+ Enabled: false
481
+ Performance/RedundantBlockCall:
482
+ Description: Use `yield` instead of `block.call`.
483
+ Reference: https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code
484
+ Enabled: false
485
+ RSpec/MultipleExpectations:
486
+ Max: 5
487
+ RSpec/NestedGroups:
488
+ Max: 5
489
+ RSpec/ExampleLength:
490
+ Max: 10
491
+ RSpec/LetSetup:
492
+ Enabled: false
493
+ RSpec/ExpectChange:
494
+ Enabled: true
495
+ EnforcedStyle: block
496
+ RSpec/MultipleMemoizedHelpers:
497
+ Max: 8
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in internal-affairs-gem.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,40 @@
1
+ **If you're viewing this at https://github.com/collectiveidea/delayed_job_active_record,
2
+ you're reading the documentation for the master branch.
3
+ [View documentation for the latest release
4
+ (4.1.7).](https://github.com/collectiveidea/delayed_job_active_record/tree/v4.1.7)**
5
+
6
+ # DelayedJob ActiveRecord Backend
7
+
8
+ [![Gem Version](https://img.shields.io/gem/v/delayed_job_active_record.svg)](https://rubygems.org/gems/delayed_job_active_record)
9
+ ![CI](https://github.com/collectiveidea/delayed_job_active_record/workflows/CI/badge.svg)
10
+ [![Coverage Status](https://img.shields.io/coveralls/collectiveidea/delayed_job_active_record.svg)](https://coveralls.io/r/collectiveidea/delayed_job_active_record)
11
+
12
+ ## Installation
13
+
14
+ Add the gem to your Gemfile:
15
+
16
+ gem 'delayed_job_active_record'
17
+
18
+ Run `bundle install`.
19
+
20
+ If you're using Rails, run the generator to create the migration for the
21
+ delayed_job table.
22
+
23
+ rails g delayed_job:active_record
24
+ rake db:migrate
25
+
26
+ ## Problems locking jobs
27
+
28
+ You can try using the legacy locking code. It is usually slower but works better for certain people.
29
+
30
+ Delayed::Backend::ActiveRecord.configuration.reserve_sql_strategy = :default_sql
31
+
32
+ ## Upgrading from 2.x to 3.0.0
33
+
34
+ If you're upgrading from Delayed Job 2.x, run the upgrade generator to create a
35
+ migration to add a column to your delayed_jobs table.
36
+
37
+ rails g delayed_job:upgrade
38
+ rake db:migrate
39
+
40
+ That's it. Use [delayed_job as normal](http://github.com/collectiveidea/delayed_job).
data/Rakefile ADDED
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_helper"
4
+ Bundler::GemHelper.install_tasks
5
+
6
+ require "rspec/core/rake_task"
7
+
8
+ ADAPTERS = %w[mysql2 postgresql sqlite3].freeze
9
+
10
+ ADAPTERS.each do |adapter|
11
+ desc "Run RSpec code examples for #{adapter} adapter"
12
+ RSpec::Core::RakeTask.new(adapter => "#{adapter}:adapter")
13
+
14
+ namespace adapter do
15
+ task :adapter do
16
+ ENV["ADAPTER"] = adapter
17
+ end
18
+ end
19
+ end
20
+
21
+ task :coverage do
22
+ ENV["COVERAGE"] = "true"
23
+ end
24
+
25
+ task :adapter do
26
+ ENV["ADAPTER"] = nil
27
+ end
28
+
29
+ Rake::Task[:spec].enhance do
30
+ require "simplecov"
31
+ require "coveralls"
32
+
33
+ Coveralls::SimpleCov::Formatter.new.format(SimpleCov.result)
34
+ end
35
+
36
+ require "rubocop/rake_task"
37
+ RuboCop::RakeTask.new
38
+
39
+ task default: ([:coverage] + ADAPTERS + [:adapter] + [:rubocop])
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'internal_affairs/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "internal-affairs"
8
+ spec.version = InternalAffairs::VERSION
9
+ spec.summary = "Internal Affairs integration helper"
10
+ spec.authors = ["devs@buda.com"]
11
+
12
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
13
+ spec.bindir = "exe"
14
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
15
+ spec.require_paths = ["lib"]
16
+
17
+ spec.add_dependency "actionpack", [">= 5.0", "< 8.0"]
18
+ spec.add_dependency "activejob", [">= 5.0", "< 8.0"]
19
+ spec.add_dependency "activerecord", [">= 5.0", "< 8.0"]
20
+ spec.add_dependency "activesupport", [">= 5.0", "< 8.0"]
21
+ spec.add_dependency "authograph", "~> 1.0.3"
22
+ spec.add_dependency "faraday", "~> 1.7.0"
23
+ spec.add_dependency "money", "~> 6.11.3"
24
+ spec.add_dependency "patron", "~> 0.13.3"
25
+ spec.add_development_dependency "bundler", "~> 2.3.0"
26
+ spec.add_development_dependency "database_cleaner-active_record"
27
+ spec.add_development_dependency "factory_bot", "~> 4.10.0"
28
+ spec.add_development_dependency "guard", "~> 2.18.0"
29
+ spec.add_development_dependency "guard-rspec", "~> 4.7.3"
30
+ spec.add_development_dependency "pry"
31
+ spec.add_development_dependency "rake", "~> 13.0.0"
32
+ spec.add_development_dependency "rspec", "~> 3.10.0"
33
+ spec.add_development_dependency "rspec-rails", "~> 5.0.1"
34
+ spec.add_development_dependency "shoulda-matchers", "~> 4.5.1"
35
+ spec.add_development_dependency "sqlite3"
36
+ spec.add_development_dependency "webmock", "~> 3.14.0"
37
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'generators/internal_affairs/generator_helper'
4
+ require 'rails/generators/migration'
5
+ require 'rails/generators/active_record'
6
+
7
+ # Extend the DelayedJobGenerator so that it creates an AR migration
8
+ module InternalAffairs
9
+ class ActiveRecordGenerator < ::Rails::Generators::Base
10
+ include ::ActiveRecord::Generators::Migration
11
+ include ::InternalAffairs::GeneratorHelper
12
+
13
+ source_paths << File.join(File.dirname(__FILE__), 'templates')
14
+
15
+ def create_migration_file
16
+ migration_template(
17
+ 'migration.rb',
18
+ 'db/migrate/create_pending_operations.rb'
19
+ )
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,7 @@
1
+ module InternalAffairs
2
+ module GeneratorHelper
3
+ def migration_version
4
+ "[#{ActiveRecord::Migration.current_version}]"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ class CreatePendingOperations < ActiveRecord::Migration<%= migration_version %>
2
+ def change
3
+ create_table :internal_affairs_pending_operations do |t|
4
+ t.datetime :created_at
5
+ t.string :operation_uuid
6
+ t.string :target_class
7
+ t.text :target_attributes
8
+ end
9
+ end
10
+ end
@@ -0,0 +1 @@
1
+ require 'internal_affairs'