sidekiq-sequence 0.1.3 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.autotest +10 -0
- data/Gemfile +3 -1
- data/Gemfile.lock +88 -0
- data/lib/sidekiq/sequence.rb +4 -2
- data/lib/sidekiq/sequence/base.rb +9 -12
- data/lib/sidekiq/sequence/version.rb +1 -1
- data/sidekiq-sequence.gemspec +3 -0
- metadata +33 -5
- data/bin/console +0 -14
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d62231fa8c75d8944656bef9bc0f94f24043812880c042cf95caa3f5195921d
|
4
|
+
data.tar.gz: 2f99168d41407c56a8b4ce9a1a88699e99dd6da3704349aba69f931642063dbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3cfff429f8bc6ebb53d9d5176d03d1f0d9bd290cd93f5e12d1a8eb5ee5c2883361df11fe75182d310255c9eac0f45bc6fe8a720315544c2c27edc046bbc5372
|
7
|
+
data.tar.gz: 992fc45e2f1984c46ef6cdcaa1e4252cb852b11881784cb0b88748fb24df1deb0a0120621645b5cc80d7e553b81daea8561572aba143f1626b560b13cd3dbe30
|
data/.autotest
ADDED
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
sidekiq-sequence (0.1.7)
|
5
|
+
activerecord (>= 5)
|
6
|
+
railties (>= 5)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actionpack (6.0.3.2)
|
12
|
+
actionview (= 6.0.3.2)
|
13
|
+
activesupport (= 6.0.3.2)
|
14
|
+
rack (~> 2.0, >= 2.0.8)
|
15
|
+
rack-test (>= 0.6.3)
|
16
|
+
rails-dom-testing (~> 2.0)
|
17
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
18
|
+
actionview (6.0.3.2)
|
19
|
+
activesupport (= 6.0.3.2)
|
20
|
+
builder (~> 3.1)
|
21
|
+
erubi (~> 1.4)
|
22
|
+
rails-dom-testing (~> 2.0)
|
23
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
24
|
+
activemodel (6.0.3.2)
|
25
|
+
activesupport (= 6.0.3.2)
|
26
|
+
activerecord (6.0.3.2)
|
27
|
+
activemodel (= 6.0.3.2)
|
28
|
+
activesupport (= 6.0.3.2)
|
29
|
+
activesupport (6.0.3.2)
|
30
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
31
|
+
i18n (>= 0.7, < 2)
|
32
|
+
minitest (~> 5.1)
|
33
|
+
tzinfo (~> 1.1)
|
34
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
35
|
+
autotest-suffix (1.1.0)
|
36
|
+
builder (3.2.4)
|
37
|
+
concurrent-ruby (1.1.6)
|
38
|
+
crass (1.0.6)
|
39
|
+
erubi (1.9.0)
|
40
|
+
i18n (1.8.3)
|
41
|
+
concurrent-ruby (~> 1.0)
|
42
|
+
loofah (2.6.0)
|
43
|
+
crass (~> 1.0.2)
|
44
|
+
nokogiri (>= 1.5.9)
|
45
|
+
method_source (1.0.0)
|
46
|
+
mini_portile2 (2.4.0)
|
47
|
+
minitest (5.14.1)
|
48
|
+
minitest-autotest (1.1.1)
|
49
|
+
minitest-server (~> 1.0)
|
50
|
+
path_expander (~> 1.0)
|
51
|
+
minitest-server (1.0.6)
|
52
|
+
minitest (~> 5.0)
|
53
|
+
nokogiri (1.10.9)
|
54
|
+
mini_portile2 (~> 2.4.0)
|
55
|
+
path_expander (1.1.0)
|
56
|
+
rack (2.2.3)
|
57
|
+
rack-test (1.1.0)
|
58
|
+
rack (>= 1.0, < 3)
|
59
|
+
rails-dom-testing (2.0.3)
|
60
|
+
activesupport (>= 4.2.0)
|
61
|
+
nokogiri (>= 1.6)
|
62
|
+
rails-html-sanitizer (1.3.0)
|
63
|
+
loofah (~> 2.3)
|
64
|
+
railties (6.0.3.2)
|
65
|
+
actionpack (= 6.0.3.2)
|
66
|
+
activesupport (= 6.0.3.2)
|
67
|
+
method_source
|
68
|
+
rake (>= 0.8.7)
|
69
|
+
thor (>= 0.20.3, < 2.0)
|
70
|
+
rake (12.3.3)
|
71
|
+
thor (1.0.1)
|
72
|
+
thread_safe (0.3.6)
|
73
|
+
tzinfo (1.2.7)
|
74
|
+
thread_safe (~> 0.1)
|
75
|
+
zeitwerk (2.3.1)
|
76
|
+
|
77
|
+
PLATFORMS
|
78
|
+
ruby
|
79
|
+
|
80
|
+
DEPENDENCIES
|
81
|
+
autotest-suffix
|
82
|
+
minitest
|
83
|
+
minitest-autotest
|
84
|
+
rake (~> 12.0)
|
85
|
+
sidekiq-sequence!
|
86
|
+
|
87
|
+
BUNDLED WITH
|
88
|
+
2.1.4
|
data/lib/sidekiq/sequence.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'rails'
|
4
|
+
require 'active_support/dependencies'
|
3
5
|
require 'sidekiq/sequence/version'
|
4
6
|
require 'sidekiq/sequence/engine'
|
5
|
-
require 'sidekiq/sequence/base'
|
6
|
-
require 'sidekiq/sequence/worker'
|
7
7
|
|
8
8
|
module Sidekiq
|
9
9
|
module Sequence
|
10
|
+
autoload :Base, 'sidekiq/sequence/base'
|
11
|
+
autoload :Worker, 'sidekiq/sequence/worker'
|
10
12
|
end
|
11
13
|
end
|
@@ -2,24 +2,22 @@
|
|
2
2
|
|
3
3
|
module Sidekiq
|
4
4
|
module Sequence
|
5
|
-
# rubocop:disable Style/ClassVars
|
6
5
|
class Base
|
7
|
-
|
6
|
+
class << self
|
7
|
+
attr_reader :steps
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
def self.steps
|
14
|
-
@@steps
|
9
|
+
def step(worker_class)
|
10
|
+
@steps = [] if steps.nil?
|
11
|
+
@steps << worker_class.name
|
12
|
+
end
|
15
13
|
end
|
16
14
|
|
17
15
|
def self.perform_step(index, id)
|
18
|
-
if index >=
|
16
|
+
if index >= steps.size
|
19
17
|
# No more steps in the sequence, so delete the record.
|
20
18
|
Record.destroy id
|
21
19
|
else
|
22
|
-
|
20
|
+
steps[index].constantize.perform_async id
|
23
21
|
end
|
24
22
|
end
|
25
23
|
|
@@ -27,9 +25,8 @@ module Sidekiq
|
|
27
25
|
record = Record.create(data: data)
|
28
26
|
|
29
27
|
# Start first job in the sequence.
|
30
|
-
|
28
|
+
self.class.steps.first.constantize.perform_async record.id
|
31
29
|
end
|
32
30
|
end
|
33
|
-
# rubocop:enable Style/ClassVars
|
34
31
|
end
|
35
32
|
end
|
data/sidekiq-sequence.gemspec
CHANGED
metadata
CHANGED
@@ -1,15 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-sequence
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Moss
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
12
|
-
dependencies:
|
11
|
+
date: 2020-07-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: railties
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activerecord
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '5'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '5'
|
13
41
|
description: Create and manage sequential jobs in Sidekiq
|
14
42
|
email:
|
15
43
|
- joel@developwithstyle.com
|
@@ -17,16 +45,16 @@ executables: []
|
|
17
45
|
extensions: []
|
18
46
|
extra_rdoc_files: []
|
19
47
|
files:
|
48
|
+
- ".autotest"
|
20
49
|
- ".gitignore"
|
21
50
|
- ".travis.yml"
|
22
51
|
- CODE_OF_CONDUCT.md
|
23
52
|
- Gemfile
|
53
|
+
- Gemfile.lock
|
24
54
|
- LICENSE.txt
|
25
55
|
- README.md
|
26
56
|
- Rakefile
|
27
57
|
- app/models/sidekiq/sequence/record.rb
|
28
|
-
- bin/console
|
29
|
-
- bin/setup
|
30
58
|
- lib/generators/sidekiq_sequence/install_generator.rb
|
31
59
|
- lib/generators/sidekiq_sequence/templates/migration.rb.tt
|
32
60
|
- lib/sidekiq/sequence.rb
|
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "sidekiq/sequence"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|