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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebd5c45c4d4fd056ba4ff2080a464e2151bc3245849c709d9f81d396c4b36523
4
- data.tar.gz: 0ed91aa4d77c8b368fadc721ffdd81bdd70a249cebe077fadcd2161b6ebf6dab
3
+ metadata.gz: 95fdb8a2737308443cbaea5cd679815501c8eef5b28a195a5922912436193b4c
4
+ data.tar.gz: 7d30e96bb9dedc5c5230c67435bc0a3967da9dd1a117c995b828f0ce5cc1c10c
5
5
  SHA512:
6
- metadata.gz: 0dc2f09d245f8936bf55ab0c00d8a4cd4b8651db10f9656a66869088297c43c694b1c71356421216d59a27376fac89962bb8dbd02dfd7d648e65578f2cfb1900
7
- data.tar.gz: 3554585afc00fc341c8627ee67071c02ca8f60092f96545043c4c06447a4c6c0ae37e3292cda9293047670471c7b16843dfa3a5b04b4b215ea93562d7050d22b
6
+ metadata.gz: 621b74af22e92674652545c490eb46a1ff26d936f2786741eed4afd11f596d5c21fcf391d80db271d2d99851a0d12bae13571b30315f2e43a1d24f1b9f07f878
7
+ data.tar.gz: ab7c14a44591695c6c76c038ee98e366c81e6b7cb3ab63435145b800174b26fae6cc155a8d27379a75e774b5f3b564679119ea9ca5ae41d640af806aaa9696f8
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Caffeinate
4
- VERSION = '0.7.1'
4
+ VERSION = '0.8.0'
5
5
  end
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.7.1
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-15 00:00:00.000000000 Z
11
+ date: 2020-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails