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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c1cd3b5b82c58a499bd506d9d4462b129e7ad22
4
- data.tar.gz: 63386b1a562ad6123ec37aa0c89986fe24b53e9d
3
+ metadata.gz: ad9fc138f26cf621f8f0535eadfd7c8d0a08b92a
4
+ data.tar.gz: 26d73a3df4c76c23420e74361f9bbd801a756bdd
5
5
  SHA512:
6
- metadata.gz: 36ca49fd9e18994c25959d22fb1400f90d8b52715ccbab3a7bb697e5f9956901d8867a851833cbb959976722db78e2b9f8fe132cc5aa526e5640e4db3ed6edf6
7
- data.tar.gz: f541c4b5af4c015e26c7259e12b74ea85664a684c1557b8672737861ed5696f9d83bc0ee608b69a672b3637199ebfe22ebabbe5fc806c65d06c3be7dcfd216d2
6
+ metadata.gz: 4ac62585f2cd9dc0ac81f3c5610c0b9ab10bcc9db5ed73e6ea48087d0ea917648961f96bf3b717931d462c94a60d322044cbbd06970a3896a211e60199c0b108
7
+ data.tar.gz: f88428ff3ecc63090cd95fb99e55b2fbe7022421c1f4fc430350fc127abcb0ea41e9f29ef4b585c2b61c97c863329b1eee11b50d7e1651681a35ef0a96770a04
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sequins (0.1.4)
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.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.3.0)
76
+ mini_portile2 (2.4.0)
77
77
  minitest (5.11.3)
78
78
  nio4r (2.3.1)
79
- nokogiri (1.8.4)
80
- mini_portile2 (~> 2.3.0)
81
- rack (2.0.5)
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)
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2018 egghead.io LLC
3
+ Copyright (c) 2018-2019 Peter Keen
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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) egghead.io LLC. The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
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
 
@@ -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
@@ -78,7 +78,7 @@ module Sequins
78
78
 
79
79
  next_step = options[:then]
80
80
 
81
- Sequins::DelayWorker.set(wait_until: delay_until).perform_later(@klass.to_s, target.class.to_s, target.id, next_step.to_s)
81
+ Sequins.schedule_delay(delay_until, @klass, target, next_step)
82
82
  end
83
83
 
84
84
  def trigger(target, *args)
@@ -1,3 +1,3 @@
1
1
  module Sequins
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -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@egghead.io"]
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/eggheadio/sequins"
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.5
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: 2018-11-26 00:00:00.000000000 Z
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@egghead.io
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/eggheadio/sequins
167
+ homepage: https://github.com/peterkeen/sequins
168
168
  licenses:
169
169
  - MIT
170
170
  metadata: {}