caffeinate 0.7.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/caffeinate/drip.rb +2 -0
- data/lib/caffeinate/dripper/drip_collection.rb +3 -3
- data/lib/caffeinate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95fdb8a2737308443cbaea5cd679815501c8eef5b28a195a5922912436193b4c
|
4
|
+
data.tar.gz: 7d30e96bb9dedc5c5230c67435bc0a3967da9dd1a117c995b828f0ce5cc1c10c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 621b74af22e92674652545c490eb46a1ff26d936f2786741eed4afd11f596d5c21fcf391d80db271d2d99851a0d12bae13571b30315f2e43a1d24f1b9f07f878
|
7
|
+
data.tar.gz: ab7c14a44591695c6c76c038ee98e366c81e6b7cb3ab63435145b800174b26fae6cc155a8d27379a75e774b5f3b564679119ea9ca5ae41d640af806aaa9696f8
|
data/lib/caffeinate/drip.rb
CHANGED
@@ -25,6 +25,8 @@ module Caffeinate
|
|
25
25
|
start = mailing.instance_exec(&options[:start])
|
26
26
|
start += options[:every] if mailing.caffeinate_campaign_subscription.caffeinate_mailings.count.positive?
|
27
27
|
date = start.from_now
|
28
|
+
elsif options[:on]
|
29
|
+
date = mailing.instance_exec(&options[:on])
|
28
30
|
else
|
29
31
|
date = options[:delay].from_now
|
30
32
|
end
|
@@ -42,7 +42,7 @@ module Caffeinate
|
|
42
42
|
|
43
43
|
def validate_drip_options(action, options)
|
44
44
|
options.symbolize_keys!
|
45
|
-
options.assert_valid_keys(:mailer_class, :step, :delay, :every, :start, :using, :mailer, :at)
|
45
|
+
options.assert_valid_keys(:mailer_class, :step, :delay, :every, :start, :using, :mailer, :at, :on)
|
46
46
|
options[:mailer_class] ||= options[:mailer] || @dripper.defaults[:mailer_class]
|
47
47
|
options[:using] ||= @dripper.defaults[:using]
|
48
48
|
options[:step] ||= @dripper.drips.size + 1
|
@@ -51,8 +51,8 @@ module Caffeinate
|
|
51
51
|
raise ArgumentError, "You must define :mailer_class or :mailer in the options for #{action.inspect} on #{@dripper.inspect}"
|
52
52
|
end
|
53
53
|
|
54
|
-
if options[:every].nil? && options[:delay].nil?
|
55
|
-
raise ArgumentError, "You must define :delay in the options for #{action.inspect} on #{@dripper.inspect}"
|
54
|
+
if options[:every].nil? && options[:delay].nil? && options[:on].nil?
|
55
|
+
raise ArgumentError, "You must define :delay or :on or :every in the options for #{action.inspect} on #{@dripper.inspect}"
|
56
56
|
end
|
57
57
|
|
58
58
|
options
|
data/lib/caffeinate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caffeinate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Brody
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|