caffeinate 2.0.4 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb48d50e2800e8fb0f43b61dc0cf4b241990a1221ca1d841160a3a845d7fbb47
4
- data.tar.gz: 6374ac7daac72c68a035ff51bf97803e0ed080f3c0ceed8d4848729773bd6a41
3
+ metadata.gz: 99e1c4493c6e9c0a024a789e5ee16383afe64fa73b6263ee2482dcace8038703
4
+ data.tar.gz: 9d49f256a79051ad3264de0444843dd5dc5c4bf8cf74fd77021709728f9dc8b4
5
5
  SHA512:
6
- metadata.gz: 1239724ca7603400fd5a6cf7952e542e363fee75b8a58b53018fc6eeffbf8436fe79100da13f84278452d5f1101ec51f4508a8efc334fb222f04f4b96b5c9cd2
7
- data.tar.gz: 53264a47eb958f1a7c90aa6d1255174cebe37f3c4cf43bc63019b46cc39b91b7cdde961ddc1bc38f8036209cefe418e1ab89f49a0391f529101bbfaea252020e
6
+ metadata.gz: 76f7ed8231cfc694d020edc3432e064bed577aad92fbc7e0bd3e5bed9b9d93a10b3b7d5650fbd72a10911dff29484aa19dfdfa64c2971fb8b47f7d0ef8312402
7
+ data.tar.gz: 668b441c7fda4930186e9bae3758c8d0d29eac861f0f2079dc3f17602fbefa5e96ec323508679c243f87272153fc89f3066c1fd5931e25fcbd2ff42ef856a6f0
data/README.md CHANGED
@@ -28,6 +28,10 @@ No! Not at all!
28
28
 
29
29
  There's not a lot of activity here because it's stable and working! I am more than happy to entertain new features.
30
30
 
31
+ ## Oh my gosh, a web UI!
32
+
33
+ See https://github.com/joshmn/caffeinate-webui for an accompanying lightweight UI for simple administrative tasks and overview.
34
+
31
35
  ## Do you suffer from ActionMailer tragedies?
32
36
 
33
37
  If you have _anything_ like this is your codebase, **you need Caffeinate**:
@@ -9,21 +9,21 @@ module Caffeinate
9
9
  before_action :find_campaign_subscription!
10
10
 
11
11
  def unsubscribe
12
- @campaign_subscription.unsubscribe!
12
+ @campaign_subscription.unsubscribe!(true)
13
13
  end
14
14
 
15
15
  def subscribe
16
- @campaign_subscription.resubscribe!
16
+ @campaign_subscription.resubscribe!(true)
17
17
  end
18
18
 
19
19
  private
20
20
 
21
21
  def caffeinate_subscribe_url(**options)
22
- Caffeinate::UrlHelpers.caffeinate_subscribe_url(@campaign_subscription, options)
22
+ Caffeinate::UrlHelpers.caffeinate_subscribe_url(@campaign_subscription, **options)
23
23
  end
24
24
 
25
25
  def caffeinate_unsubscribe_url(**options)
26
- Caffeinate::UrlHelpers.caffeinate_unsubscribe_url(@campaign_subscription, options)
26
+ Caffeinate::UrlHelpers.caffeinate_unsubscribe_url(@campaign_subscription, **options)
27
27
  end
28
28
 
29
29
  def find_campaign_subscription!
@@ -9,6 +9,7 @@ require 'caffeinate/dripper/drip'
9
9
  require 'caffeinate/dripper/inferences'
10
10
  require 'caffeinate/dripper/perform'
11
11
  require 'caffeinate/dripper/periodical'
12
+ require 'caffeinate/dripper/rescuable'
12
13
  require 'caffeinate/dripper/subscriber'
13
14
 
14
15
  module Caffeinate
@@ -24,6 +25,7 @@ module Caffeinate
24
25
  include Inferences
25
26
  include Perform
26
27
  include Periodical
28
+ include Rescuable
27
29
  include Subscriber
28
30
  end
29
31
  end
@@ -19,6 +19,7 @@ module Caffeinate
19
19
  else
20
20
  mailing.mailer_class.constantize.send(mailing.mailer_action, mailing)
21
21
  end
22
+
22
23
  message.caffeinate_mailing = mailing
23
24
  if ::Caffeinate.config.deliver_later?
24
25
  message.deliver_later
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Caffeinate
4
+ module Dripper
5
+ module Rescuable
6
+ def self.included(klass)
7
+ klass.include ::ActiveSupport::Rescuable
8
+ klass.extend ClassMethods
9
+ end
10
+
11
+ module ClassMethods
12
+ def deliver!(mailing)
13
+ begin
14
+ super
15
+ rescue Exception => exception
16
+ if self.rescue_with_handler(exception, object: mailing)
17
+ return
18
+ end
19
+ raise
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Caffeinate
4
- VERSION = '2.0.4'
4
+ VERSION = '2.1.0'
5
5
  end
data/lib/caffeinate.rb CHANGED
@@ -22,7 +22,7 @@ require 'caffeinate/dripper_collection'
22
22
 
23
23
  module Caffeinate
24
24
  def self.dripper_collection
25
- @drippers ||= DripperCollection.new
25
+ @dripper_collection ||= DripperCollection.new
26
26
  end
27
27
 
28
28
  # Global configuration
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: 2.0.4
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Brody
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-11 00:00:00.000000000 Z
11
+ date: 2023-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -179,6 +179,7 @@ files:
179
179
  - lib/caffeinate/dripper/inferences.rb
180
180
  - lib/caffeinate/dripper/perform.rb
181
181
  - lib/caffeinate/dripper/periodical.rb
182
+ - lib/caffeinate/dripper/rescuable.rb
182
183
  - lib/caffeinate/dripper/subscriber.rb
183
184
  - lib/caffeinate/dripper_collection.rb
184
185
  - lib/caffeinate/engine.rb
@@ -200,7 +201,7 @@ homepage: https://github.com/joshmn/caffeinate
200
201
  licenses:
201
202
  - MIT
202
203
  metadata: {}
203
- post_install_message:
204
+ post_install_message:
204
205
  rdoc_options: []
205
206
  require_paths:
206
207
  - lib
@@ -216,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
217
  version: '0'
217
218
  requirements: []
218
219
  rubygems_version: 3.1.4
219
- signing_key:
220
+ signing_key:
220
221
  specification_version: 4
221
222
  summary: Create, manage, and send scheduled email sequences and drip campaigns from
222
223
  your Rails app.