sidekiq-unique-jobs 4.0.18 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sidekiq-unique-jobs might be problematic. Click here for more details.

Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +42 -7
  3. data/.csslintrc +2 -0
  4. data/.eslintignore +1 -0
  5. data/.eslintrc +213 -0
  6. data/.gitignore +2 -0
  7. data/.rspec +1 -2
  8. data/.rubocop.yml +19 -0
  9. data/.simplecov +2 -1
  10. data/.travis.yml +8 -12
  11. data/Appraisals +10 -20
  12. data/CHANGELOG.md +4 -0
  13. data/Gemfile +10 -6
  14. data/README.md +16 -2
  15. data/Rakefile +1 -0
  16. data/bin/bench +1 -0
  17. data/bin/jobs +1 -0
  18. data/circle.yml +6 -3
  19. data/gemfiles/sidekiq_4.0.gemfile +8 -5
  20. data/gemfiles/sidekiq_4.1.gemfile +8 -5
  21. data/gemfiles/{sidekiq_3.1.gemfile → sidekiq_4.2.gemfile} +9 -6
  22. data/gemfiles/{sidekiq_3.2.gemfile → sidekiq_5.0.gemfile} +9 -6
  23. data/gemfiles/sidekiq_develop.gemfile +8 -5
  24. data/lib/sidekiq-unique-jobs.rb +1 -1
  25. data/lib/sidekiq_unique_jobs/config.rb +1 -9
  26. data/lib/sidekiq_unique_jobs/constants.rb +1 -0
  27. data/lib/sidekiq_unique_jobs/core_ext.rb +44 -34
  28. data/lib/sidekiq_unique_jobs/lock/while_executing.rb +1 -1
  29. data/lib/sidekiq_unique_jobs/script_mock.rb +4 -7
  30. data/lib/sidekiq_unique_jobs/scripts.rb +9 -8
  31. data/lib/sidekiq_unique_jobs/testing/sidekiq_overrides.rb +23 -17
  32. data/lib/sidekiq_unique_jobs/unique_args.rb +1 -1
  33. data/lib/sidekiq_unique_jobs/unlockable.rb +8 -15
  34. data/lib/sidekiq_unique_jobs/util.rb +7 -0
  35. data/lib/sidekiq_unique_jobs/version.rb +1 -1
  36. data/rails_example/.env.test +12 -0
  37. data/rails_example/.rspec +1 -1
  38. data/rails_example/Gemfile +12 -9
  39. data/rails_example/app/controllers/work_controller.rb +16 -2
  40. data/rails_example/app/models/guest.rb +8 -11
  41. data/rails_example/app/workers/simple_worker.rb +4 -1
  42. data/rails_example/app/workers/slow_until_executing_worker.rb +15 -0
  43. data/rails_example/app/workers/spawn_simple_worker.rb +3 -0
  44. data/rails_example/app/workers/without_argument_worker.rb +12 -0
  45. data/rails_example/bin/check_or_setup_db +0 -1
  46. data/rails_example/common-services.yml +2 -0
  47. data/rails_example/config/database.yml +2 -2
  48. data/rails_example/config/environments/development.rb +1 -1
  49. data/rails_example/config/environments/test.rb +1 -1
  50. data/rails_example/config/initializers/sidekiq.rb +1 -1
  51. data/rails_example/config/routes.rb +1 -0
  52. data/rails_example/config/spring.rb +2 -2
  53. data/rails_example/docker-compose.yml +19 -38
  54. data/rails_example/spec/controllers/work_controller_mock_spec.rb +91 -0
  55. data/rails_example/spec/controllers/work_controller_spec.rb +46 -141
  56. data/rails_example/spec/rails_helper.rb +1 -2
  57. data/sidekiq-unique-jobs.gemspec +6 -4
  58. data/spec/jobs/custom_queue_job.rb +1 -2
  59. data/spec/jobs/just_a_worker.rb +1 -2
  60. data/spec/jobs/long_running_job.rb +1 -2
  61. data/spec/jobs/main_job.rb +1 -2
  62. data/spec/jobs/my_unique_job.rb +1 -2
  63. data/spec/jobs/plain_class.rb +1 -2
  64. data/spec/jobs/test_class.rb +1 -2
  65. data/spec/jobs/until_and_while_executing_job.rb +1 -2
  66. data/spec/jobs/until_executing_job.rb +1 -2
  67. data/spec/jobs/without_argument_job.rb +9 -0
  68. data/spec/lib/sidekiq_unique_jobs/client/middleware_spec.rb +6 -3
  69. data/spec/lib/sidekiq_unique_jobs/config_spec.rb +84 -0
  70. data/spec/lib/sidekiq_unique_jobs/lock/until_and_while_executing_spec.rb +2 -1
  71. data/spec/lib/sidekiq_unique_jobs/lock/while_executing_spec.rb +2 -2
  72. data/spec/lib/sidekiq_unique_jobs/script_mock_spec.rb +12 -6
  73. data/spec/lib/sidekiq_unique_jobs/scripts_spec.rb +0 -5
  74. data/spec/lib/sidekiq_unique_jobs/sidekiq_testing_enabled_spec.rb +5 -3
  75. data/spec/lib/sidekiq_unique_jobs/sidekiq_unique_ext_spec.rb +2 -2
  76. data/spec/lib/sidekiq_unique_jobs/unique_args_spec.rb +23 -7
  77. data/spec/lib/sidekiq_unique_jobs/unlockable_spec.rb +34 -0
  78. data/spec/lib/sidekiq_unique_jobs/util_spec.rb +1 -1
  79. data/spec/spec_helper.rb +3 -14
  80. data/spec/support/ruby_meta.rb +10 -3
  81. data/spec/support/sidekiq_meta.rb +2 -3
  82. metadata +33 -16
  83. data/gemfiles/sidekiq_2.15.gemfile +0 -9
  84. data/gemfiles/sidekiq_2.16.gemfile +0 -9
  85. data/gemfiles/sidekiq_2.17.gemfile +0 -19
  86. data/gemfiles/sidekiq_3.0.gemfile +0 -19
  87. data/gemfiles/sidekiq_3.3.gemfile +0 -19
  88. data/spec/celluloid_with_fallback.rb +0 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e48826d7669ceaa951fae20cf68de7a3e9676b9
4
- data.tar.gz: 42a874852687d4bba62d79fee6adc3119aec6ebe
3
+ metadata.gz: 133211c0920216c3537ec4417d74252f4804420b
4
+ data.tar.gz: 3b2f8878d4ea75aaacaa9e1c82876705aefad514
5
5
  SHA512:
6
- metadata.gz: a40449737349637916e6498dd0cb2408ec9f9300d3cf0f900effdfc290f4148a1acc672fcd0e85932d9d9198d5102807b103ec768346beeebe7cfdce06fabad7
7
- data.tar.gz: 2ac854b6034970cb0609a9f855f576939d31e3dacfa8627bc4bbbccbed8d08e98e41ca478a29103e0991da599f7fc0378a6dd34f6ba7fcaca15a43751e580b14
6
+ metadata.gz: aca4b5c230b92c0bd7b180e3738bb930e82309743008b2c17726012d851623f5a2da156141872980942a22c84e8dfefe0affe77a212d4a210d6bc8d072f47af3
7
+ data.tar.gz: cfaaa3845e5bc4012df8001bb23f01f352fe99ece7e8330020b7dbf19c3e126ca76a306584dc50a76b909d279ce701b32b51ba0ca7e9b762123ea909d2924672
data/.codeclimate.yml CHANGED
@@ -1,3 +1,33 @@
1
+ ---
2
+ engines:
3
+ csslint:
4
+ enabled: true
5
+ duplication:
6
+ enabled: true
7
+ config:
8
+ languages:
9
+ - ruby
10
+ - javascript
11
+ - python
12
+ - php
13
+ eslint:
14
+ enabled: true
15
+ fixme:
16
+ enabled: true
17
+ rubocop:
18
+ enabled: true
19
+ ratings:
20
+ paths:
21
+ - "**.css"
22
+ - "**.inc"
23
+ - "**.js"
24
+ - "**.jsx"
25
+ - "**.module"
26
+ - "**.php"
27
+ - "**.py"
28
+ - "**.rb"
29
+ exclude_paths:
30
+ - spec/
1
31
  engines:
2
32
  bundler-audit:
3
33
  enabled: true
@@ -5,18 +35,23 @@ engines:
5
35
  enabled: true
6
36
  duplication:
7
37
  enabled: true
38
+ config:
39
+ languages:
40
+ - ruby
8
41
  rubocop:
9
42
  enabled: true
10
- golint:
11
- enabled: true
12
43
  ratings:
13
44
  paths:
14
45
  - lib/**
15
46
  - bin/**
16
47
  - "**.rb"
17
48
  exclude_paths:
18
- - spec/
19
- - gemfiles/
20
- - rails_example/
21
- - redis/
22
- - tmp/
49
+ - Gemfile
50
+ - *.gemspec
51
+ - Appraisals
52
+ - spec/**/*.rb
53
+ - gemfiles/**/*
54
+ - rails_example/**/*
55
+ - redis/**/*
56
+ - tmp/**/*
57
+
data/.csslintrc ADDED
@@ -0,0 +1,2 @@
1
+ --exclude-exts=.min.css
2
+ --ignore=adjoining-classes,box-model,ids,order-alphabetical,unqualified-attributes
data/.eslintignore ADDED
@@ -0,0 +1 @@
1
+ **/*{.,-}min.js
data/.eslintrc ADDED
@@ -0,0 +1,213 @@
1
+ ecmaFeatures:
2
+ modules: true
3
+ jsx: true
4
+
5
+ env:
6
+ amd: true
7
+ browser: true
8
+ es6: true
9
+ jquery: true
10
+ node: true
11
+
12
+ # http://eslint.org/docs/rules/
13
+ rules:
14
+ # Possible Errors
15
+ comma-dangle: [2, never]
16
+ no-cond-assign: 2
17
+ no-console: 0
18
+ no-constant-condition: 2
19
+ no-control-regex: 2
20
+ no-debugger: 2
21
+ no-dupe-args: 2
22
+ no-dupe-keys: 2
23
+ no-duplicate-case: 2
24
+ no-empty: 2
25
+ no-empty-character-class: 2
26
+ no-ex-assign: 2
27
+ no-extra-boolean-cast: 2
28
+ no-extra-parens: 0
29
+ no-extra-semi: 2
30
+ no-func-assign: 2
31
+ no-inner-declarations: [2, functions]
32
+ no-invalid-regexp: 2
33
+ no-irregular-whitespace: 2
34
+ no-negated-in-lhs: 2
35
+ no-obj-calls: 2
36
+ no-regex-spaces: 2
37
+ no-sparse-arrays: 2
38
+ no-unexpected-multiline: 2
39
+ no-unreachable: 2
40
+ use-isnan: 2
41
+ valid-jsdoc: 0
42
+ valid-typeof: 2
43
+
44
+ # Best Practices
45
+ accessor-pairs: 2
46
+ block-scoped-var: 0
47
+ complexity: [2, 6]
48
+ consistent-return: 0
49
+ curly: 0
50
+ default-case: 0
51
+ dot-location: 0
52
+ dot-notation: 0
53
+ eqeqeq: 2
54
+ guard-for-in: 2
55
+ no-alert: 2
56
+ no-caller: 2
57
+ no-case-declarations: 2
58
+ no-div-regex: 2
59
+ no-else-return: 0
60
+ no-empty-label: 2
61
+ no-empty-pattern: 2
62
+ no-eq-null: 2
63
+ no-eval: 2
64
+ no-extend-native: 2
65
+ no-extra-bind: 2
66
+ no-fallthrough: 2
67
+ no-floating-decimal: 0
68
+ no-implicit-coercion: 0
69
+ no-implied-eval: 2
70
+ no-invalid-this: 0
71
+ no-iterator: 2
72
+ no-labels: 0
73
+ no-lone-blocks: 2
74
+ no-loop-func: 2
75
+ no-magic-number: 0
76
+ no-multi-spaces: 0
77
+ no-multi-str: 0
78
+ no-native-reassign: 2
79
+ no-new-func: 2
80
+ no-new-wrappers: 2
81
+ no-new: 2
82
+ no-octal-escape: 2
83
+ no-octal: 2
84
+ no-proto: 2
85
+ no-redeclare: 2
86
+ no-return-assign: 2
87
+ no-script-url: 2
88
+ no-self-compare: 2
89
+ no-sequences: 0
90
+ no-throw-literal: 0
91
+ no-unused-expressions: 2
92
+ no-useless-call: 2
93
+ no-useless-concat: 2
94
+ no-void: 2
95
+ no-warning-comments: 0
96
+ no-with: 2
97
+ radix: 2
98
+ vars-on-top: 0
99
+ wrap-iife: 2
100
+ yoda: 0
101
+
102
+ # Strict
103
+ strict: 0
104
+
105
+ # Variables
106
+ init-declarations: 0
107
+ no-catch-shadow: 2
108
+ no-delete-var: 2
109
+ no-label-var: 2
110
+ no-shadow-restricted-names: 2
111
+ no-shadow: 0
112
+ no-undef-init: 2
113
+ no-undef: 0
114
+ no-undefined: 0
115
+ no-unused-vars: 0
116
+ no-use-before-define: 0
117
+
118
+ # Node.js and CommonJS
119
+ callback-return: 2
120
+ global-require: 2
121
+ handle-callback-err: 2
122
+ no-mixed-requires: 0
123
+ no-new-require: 0
124
+ no-path-concat: 2
125
+ no-process-exit: 2
126
+ no-restricted-modules: 0
127
+ no-sync: 0
128
+
129
+ # Stylistic Issues
130
+ array-bracket-spacing: 0
131
+ block-spacing: 0
132
+ brace-style: 0
133
+ camelcase: 0
134
+ comma-spacing: 0
135
+ comma-style: 0
136
+ computed-property-spacing: 0
137
+ consistent-this: 0
138
+ eol-last: 0
139
+ func-names: 0
140
+ func-style: 0
141
+ id-length: 0
142
+ id-match: 0
143
+ indent: 0
144
+ jsx-quotes: 0
145
+ key-spacing: 0
146
+ linebreak-style: 0
147
+ lines-around-comment: 0
148
+ max-depth: 0
149
+ max-len: 0
150
+ max-nested-callbacks: 0
151
+ max-params: 0
152
+ max-statements: [2, 30]
153
+ new-cap: 0
154
+ new-parens: 0
155
+ newline-after-var: 0
156
+ no-array-constructor: 0
157
+ no-bitwise: 0
158
+ no-continue: 0
159
+ no-inline-comments: 0
160
+ no-lonely-if: 0
161
+ no-mixed-spaces-and-tabs: 0
162
+ no-multiple-empty-lines: 0
163
+ no-negated-condition: 0
164
+ no-nested-ternary: 0
165
+ no-new-object: 0
166
+ no-plusplus: 0
167
+ no-restricted-syntax: 0
168
+ no-spaced-func: 0
169
+ no-ternary: 0
170
+ no-trailing-spaces: 0
171
+ no-underscore-dangle: 0
172
+ no-unneeded-ternary: 0
173
+ object-curly-spacing: 0
174
+ one-var: 0
175
+ operator-assignment: 0
176
+ operator-linebreak: 0
177
+ padded-blocks: 0
178
+ quote-props: 0
179
+ quotes: 0
180
+ require-jsdoc: 0
181
+ semi-spacing: 0
182
+ semi: 0
183
+ sort-vars: 0
184
+ space-after-keywords: 0
185
+ space-before-blocks: 0
186
+ space-before-function-paren: 0
187
+ space-before-keywords: 0
188
+ space-in-parens: 0
189
+ space-infix-ops: 0
190
+ space-return-throw-case: 0
191
+ space-unary-ops: 0
192
+ spaced-comment: 0
193
+ wrap-regex: 0
194
+
195
+ # ECMAScript 6
196
+ arrow-body-style: 0
197
+ arrow-parens: 0
198
+ arrow-spacing: 0
199
+ constructor-super: 0
200
+ generator-star-spacing: 0
201
+ no-arrow-condition: 0
202
+ no-class-assign: 0
203
+ no-const-assign: 0
204
+ no-dupe-class-members: 0
205
+ no-this-before-super: 0
206
+ no-var: 0
207
+ object-shorthand: 0
208
+ prefer-arrow-callback: 0
209
+ prefer-const: 0
210
+ prefer-reflect: 0
211
+ prefer-spread: 0
212
+ prefer-template: 0
213
+ require-yield: 0
data/.gitignore CHANGED
@@ -12,3 +12,5 @@ gemfiles/*.lock
12
12
  coverage/
13
13
  tmp/
14
14
  rails_example/spec/examples.txt
15
+
16
+ *.sublime-*
data/.rspec CHANGED
@@ -1,3 +1,2 @@
1
1
  --color
2
- --format progress
3
- --order random
2
+ --order random
data/.rubocop.yml CHANGED
@@ -7,6 +7,7 @@ AllCops:
7
7
  Exclude:
8
8
  - 'Gemfile.lock'
9
9
  - 'gemfiles/**/*'
10
+ TargetRubyVersion: 2.4
10
11
 
11
12
  Lint/HandleExceptions:
12
13
  Enabled: true
@@ -26,6 +27,11 @@ Metrics/LineLength:
26
27
  Metrics/MethodLength:
27
28
  Max: 13
28
29
 
30
+ Metrics/BlockLength:
31
+ Enabled: true
32
+ Exclude:
33
+ - '**/spec/**/*_spec.rb'
34
+
29
35
  Metrics/PerceivedComplexity:
30
36
  Max: 8
31
37
 
@@ -35,11 +41,24 @@ Style/AccessorMethodName:
35
41
  Style/ConstantName:
36
42
  Enabled: true
37
43
 
44
+ Style/FrozenStringLiteralComment:
45
+ Enabled: false
46
+
38
47
  Style/Documentation:
39
48
  Enabled: false
40
49
 
41
50
  Style/FileName:
42
51
  Enabled: true
52
+ Exclude:
53
+ - 'lib/sidekiq-unique-jobs.rb'
43
54
 
44
55
  Style/GlobalVars:
45
56
  Enabled: true
57
+
58
+ Style/SymbolArray:
59
+ Enabled: true
60
+ EnforcedStyle: brackets
61
+
62
+ Style/TrailingCommaInLiteral:
63
+ Enabled: true
64
+ EnforcedStyleForMultiline: comma
data/.simplecov CHANGED
@@ -1,9 +1,10 @@
1
1
  require 'simplecov-json'
2
+ require 'codeclimate-test-reporter'
2
3
 
3
4
  # SimpleCov.refuse_coverage_drop
4
5
  SimpleCov.formatters = [
5
6
  SimpleCov::Formatter::HTMLFormatter,
6
- SimpleCov::Formatter::JSONFormatter
7
+ SimpleCov::Formatter::JSONFormatter,
7
8
  ]
8
9
  SimpleCov.start do
9
10
  add_filter '/spec/'
data/.travis.yml CHANGED
@@ -10,23 +10,19 @@ services:
10
10
  script:
11
11
  - if [[ "${STYLE}" = "true" ]]; then bundle exec rubocop; fi;
12
12
  - bundle exec rspec spec
13
+ - if [[ "${STYLE}" = "true" ]]; then CODECLIMATE_REPO_TOKEN=88e524e8f638efe690def7a6e2c72b1a9db5cdfa74548921b734d609a5858ee5 bundle exec codeclimate-test-reporter; fi;
13
14
  rvm:
14
- - jruby-19mode
15
- - jruby-9.0.4.0
16
- - jruby-9.1.2.0
17
- - rbx-3.9
18
- - 2.1.8
19
- - 2.2.4
15
+ - 2.4.1
16
+ - 2.3.2
17
+ - 2.2.5
18
+ - jruby-9.1.8.0
20
19
  env: STYLE=false
21
20
  gemfile:
22
21
  - gemfiles/sidekiq_develop.gemfile
23
- - gemfiles/sidekiq_2.17.gemfile
24
- - gemfiles/sidekiq_3.0.gemfile
25
- - gemfiles/sidekiq_3.1.gemfile
26
- - gemfiles/sidekiq_3.2.gemfile
27
- - gemfiles/sidekiq_3.3.gemfile
28
22
  - gemfiles/sidekiq_4.0.gemfile
29
23
  - gemfiles/sidekiq_4.1.gemfile
24
+ - gemfiles/sidekiq_4.2.gemfile
25
+ - gemfiles/sidekiq_5.0.gemfile
30
26
 
31
27
  notifications:
32
28
  email:
@@ -35,7 +31,7 @@ notifications:
35
31
  matrix:
36
32
  fast_finish: true
37
33
  include:
38
- - rvm: 2.3.1
34
+ - rvm: 2.4.1
39
35
  gemfile: gemfiles/sidekiq_develop.gemfile
40
36
  env: STYLE=true
41
37
  addons:
data/Appraisals CHANGED
@@ -1,27 +1,9 @@
1
+ # rubocop:disable Style/FileName
2
+
1
3
  appraise 'sidekiq-develop' do
2
4
  gem 'sidekiq', github: 'mperham/sidekiq'
3
5
  end
4
6
 
5
- appraise 'sidekiq-2.17' do
6
- gem 'sidekiq', '~> 2.17.4'
7
- end
8
-
9
- appraise 'sidekiq-3.0' do
10
- gem 'sidekiq', '~> 3.0.0'
11
- end
12
-
13
- appraise 'sidekiq-3.1' do
14
- gem 'sidekiq', '~> 3.1.0'
15
- end
16
-
17
- appraise 'sidekiq-3.2' do
18
- gem 'sidekiq', '~> 3.2.0'
19
- end
20
-
21
- appraise 'sidekiq-3.3' do
22
- gem 'sidekiq', '~> 3.3.0'
23
- end
24
-
25
7
  appraise 'sidekiq-4.0' do
26
8
  gem 'sidekiq', '~> 4.0.0'
27
9
  end
@@ -29,3 +11,11 @@ end
29
11
  appraise 'sidekiq-4.1' do
30
12
  gem 'sidekiq', '~> 4.1.0'
31
13
  end
14
+
15
+ appraise 'sidekiq-4.2' do
16
+ gem 'sidekiq', '~> 4.2.0'
17
+ end
18
+
19
+ appraise 'sidekiq-5.0' do
20
+ gem 'sidekiq', '>= 5.0.0.beta', '< 6'
21
+ end