sequins 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -6
- data/LICENSE.txt +1 -1
- data/README.md +1 -1
- data/lib/sequins.rb +4 -0
- data/lib/sequins/configuration.rb +7 -1
- data/lib/sequins/sequence.rb +1 -1
- data/lib/sequins/version.rb +1 -1
- data/sequins.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad9fc138f26cf621f8f0535eadfd7c8d0a08b92a
|
4
|
+
data.tar.gz: 26d73a3df4c76c23420e74361f9bbd801a756bdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ac62585f2cd9dc0ac81f3c5610c0b9ab10bcc9db5ed73e6ea48087d0ea917648961f96bf3b717931d462c94a60d322044cbbd06970a3896a211e60199c0b108
|
7
|
+
data.tar.gz: f88428ff3ecc63090cd95fb99e55b2fbe7022421c1f4fc430350fc127abcb0ea41e9f29ef4b585c2b61c97c863329b1eee11b50d7e1651681a35ef0a96770a04
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sequins (0.1.
|
4
|
+
sequins (0.1.5)
|
5
5
|
autoloaded (~> 2)
|
6
6
|
docile
|
7
7
|
rails (>= 5.0)
|
@@ -63,7 +63,7 @@ GEM
|
|
63
63
|
activesupport (>= 4.2.0)
|
64
64
|
i18n (1.1.0)
|
65
65
|
concurrent-ruby (~> 1.0)
|
66
|
-
loofah (2.2.
|
66
|
+
loofah (2.2.3)
|
67
67
|
crass (~> 1.0.2)
|
68
68
|
nokogiri (>= 1.5.9)
|
69
69
|
mail (2.7.1)
|
@@ -73,12 +73,12 @@ GEM
|
|
73
73
|
method_source (0.9.0)
|
74
74
|
mimemagic (0.3.2)
|
75
75
|
mini_mime (1.0.1)
|
76
|
-
mini_portile2 (2.
|
76
|
+
mini_portile2 (2.4.0)
|
77
77
|
minitest (5.11.3)
|
78
78
|
nio4r (2.3.1)
|
79
|
-
nokogiri (1.
|
80
|
-
mini_portile2 (~> 2.
|
81
|
-
rack (2.0.
|
79
|
+
nokogiri (1.10.1)
|
80
|
+
mini_portile2 (~> 2.4.0)
|
81
|
+
rack (2.0.6)
|
82
82
|
rack-test (1.1.0)
|
83
83
|
rack (>= 1.0, < 3)
|
84
84
|
rails (5.2.1)
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -144,7 +144,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/egghea
|
|
144
144
|
|
145
145
|
## License
|
146
146
|
|
147
|
-
Copyright (c)
|
147
|
+
Copyright (c) Peter Keen. The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
148
148
|
|
149
149
|
## Code of Conduct
|
150
150
|
|
data/lib/sequins.rb
CHANGED
@@ -23,6 +23,10 @@ module Sequins
|
|
23
23
|
def self.configure
|
24
24
|
yield configuration
|
25
25
|
end
|
26
|
+
|
27
|
+
def self.schedule_delay(delay_until, sequence_class, target, next_step)
|
28
|
+
configuration.delay_scheduler.call(delay_until, sequence_class, target, next_step)
|
29
|
+
end
|
26
30
|
end
|
27
31
|
|
28
32
|
require 'sequins/errors'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Sequins
|
2
2
|
class Configuration
|
3
|
-
attr_accessor :default_time_zone
|
3
|
+
attr_accessor :default_time_zone, :delay_scheduler
|
4
4
|
|
5
5
|
def initialize
|
6
6
|
if Object.const_defined?('Rails') && !Rails.configuration.time_zone.nil?
|
@@ -8,6 +8,12 @@ module Sequins
|
|
8
8
|
else
|
9
9
|
self.default_time_zone = 'America/Chicago'
|
10
10
|
end
|
11
|
+
|
12
|
+
self.delay_scheduler = lambda do |delay_until, sequence_class, target, next_step|
|
13
|
+
Sequins::DelayWorker
|
14
|
+
.set(wait_until: delay_until)
|
15
|
+
.perform_later(sequence_class.to_s, target.class.to_s, target.id, next_step.to_s)
|
16
|
+
end
|
11
17
|
end
|
12
18
|
end
|
13
19
|
end
|
data/lib/sequins/sequence.rb
CHANGED
@@ -78,7 +78,7 @@ module Sequins
|
|
78
78
|
|
79
79
|
next_step = options[:then]
|
80
80
|
|
81
|
-
Sequins
|
81
|
+
Sequins.schedule_delay(delay_until, @klass, target, next_step)
|
82
82
|
end
|
83
83
|
|
84
84
|
def trigger(target, *args)
|
data/lib/sequins/version.rb
CHANGED
data/sequins.gemspec
CHANGED
@@ -7,11 +7,11 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = "sequins"
|
8
8
|
spec.version = Sequins::VERSION
|
9
9
|
spec.authors = ["Pete Keen"]
|
10
|
-
spec.email = ["pete@
|
10
|
+
spec.email = ["pete@petekeen.net"]
|
11
11
|
|
12
12
|
spec.summary = %q{Sequins allows you to define temporal sequences of actions}
|
13
13
|
spec.description = %q{Set up sequences of actions that are delayed in time}
|
14
|
-
spec.homepage = "https://github.com/
|
14
|
+
spec.homepage = "https://github.com/peterkeen/sequins"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Keen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docile
|
@@ -138,7 +138,7 @@ dependencies:
|
|
138
138
|
version: '0'
|
139
139
|
description: Set up sequences of actions that are delayed in time
|
140
140
|
email:
|
141
|
-
- pete@
|
141
|
+
- pete@petekeen.net
|
142
142
|
executables: []
|
143
143
|
extensions: []
|
144
144
|
extra_rdoc_files: []
|
@@ -164,7 +164,7 @@ files:
|
|
164
164
|
- lib/sequins/step.rb
|
165
165
|
- lib/sequins/version.rb
|
166
166
|
- sequins.gemspec
|
167
|
-
homepage: https://github.com/
|
167
|
+
homepage: https://github.com/peterkeen/sequins
|
168
168
|
licenses:
|
169
169
|
- MIT
|
170
170
|
metadata: {}
|