caffeinate 0.1.4 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +58 -43
  3. data/app/controllers/caffeinate/campaign_subscriptions_controller.rb +17 -2
  4. data/app/models/caffeinate/campaign.rb +40 -1
  5. data/app/models/caffeinate/campaign_subscription.rb +52 -11
  6. data/app/models/caffeinate/mailing.rb +26 -3
  7. data/app/views/caffeinate/campaign_subscriptions/subscribe.html.erb +3 -0
  8. data/app/views/caffeinate/campaign_subscriptions/unsubscribe.html.erb +3 -0
  9. data/app/views/layouts/_caffeinate.html.erb +11 -0
  10. data/config/locales/en.yml +6 -0
  11. data/db/migrate/20201124183102_create_caffeinate_campaigns.rb +1 -0
  12. data/db/migrate/20201124183303_create_caffeinate_campaign_subscriptions.rb +3 -0
  13. data/db/migrate/20201124183419_create_caffeinate_mailings.rb +4 -1
  14. data/lib/caffeinate.rb +2 -0
  15. data/lib/caffeinate/action_mailer.rb +4 -4
  16. data/lib/caffeinate/action_mailer/extension.rb +17 -1
  17. data/lib/caffeinate/action_mailer/interceptor.rb +4 -2
  18. data/lib/caffeinate/action_mailer/observer.rb +5 -4
  19. data/lib/caffeinate/active_record/extension.rb +3 -2
  20. data/lib/caffeinate/configuration.rb +4 -1
  21. data/lib/caffeinate/drip.rb +22 -35
  22. data/lib/caffeinate/drip_evaluator.rb +35 -0
  23. data/lib/caffeinate/dripper/base.rb +13 -14
  24. data/lib/caffeinate/dripper/batching.rb +22 -0
  25. data/lib/caffeinate/dripper/callbacks.rb +74 -6
  26. data/lib/caffeinate/dripper/campaign.rb +8 -9
  27. data/lib/caffeinate/dripper/defaults.rb +4 -2
  28. data/lib/caffeinate/dripper/delivery.rb +8 -8
  29. data/lib/caffeinate/dripper/drip.rb +46 -16
  30. data/lib/caffeinate/dripper/inferences.rb +29 -0
  31. data/lib/caffeinate/dripper/perform.rb +16 -5
  32. data/lib/caffeinate/dripper/periodical.rb +24 -0
  33. data/lib/caffeinate/engine.rb +12 -9
  34. data/lib/caffeinate/helpers.rb +24 -0
  35. data/lib/caffeinate/mail_ext.rb +12 -0
  36. data/lib/caffeinate/url_helpers.rb +10 -0
  37. data/lib/caffeinate/version.rb +1 -1
  38. data/lib/generators/caffeinate/install_generator.rb +5 -1
  39. data/lib/generators/caffeinate/templates/caffeinate.rb +11 -1
  40. metadata +13 -5
  41. data/app/views/layouts/caffeinate/application.html.erb +0 -15
  42. data/app/views/layouts/caffeinate/campaign_subscriptions/unsubscribe.html.erb +0 -1
  43. data/lib/caffeinate/action_mailer/helpers.rb +0 -12
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.1.4
4
+ version: 0.5.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-11-27 00:00:00.000000000 Z
11
+ date: 2020-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -124,8 +124,10 @@ files:
124
124
  - app/models/caffeinate/campaign.rb
125
125
  - app/models/caffeinate/campaign_subscription.rb
126
126
  - app/models/caffeinate/mailing.rb
127
- - app/views/layouts/caffeinate/application.html.erb
128
- - app/views/layouts/caffeinate/campaign_subscriptions/unsubscribe.html.erb
127
+ - app/views/caffeinate/campaign_subscriptions/subscribe.html.erb
128
+ - app/views/caffeinate/campaign_subscriptions/unsubscribe.html.erb
129
+ - app/views/layouts/_caffeinate.html.erb
130
+ - config/locales/en.yml
129
131
  - config/routes.rb
130
132
  - db/migrate/20201124183102_create_caffeinate_campaigns.rb
131
133
  - db/migrate/20201124183303_create_caffeinate_campaign_subscriptions.rb
@@ -133,22 +135,28 @@ files:
133
135
  - lib/caffeinate.rb
134
136
  - lib/caffeinate/action_mailer.rb
135
137
  - lib/caffeinate/action_mailer/extension.rb
136
- - lib/caffeinate/action_mailer/helpers.rb
137
138
  - lib/caffeinate/action_mailer/interceptor.rb
138
139
  - lib/caffeinate/action_mailer/observer.rb
139
140
  - lib/caffeinate/active_record/extension.rb
140
141
  - lib/caffeinate/configuration.rb
141
142
  - lib/caffeinate/deliver_async.rb
142
143
  - lib/caffeinate/drip.rb
144
+ - lib/caffeinate/drip_evaluator.rb
143
145
  - lib/caffeinate/dripper/base.rb
146
+ - lib/caffeinate/dripper/batching.rb
144
147
  - lib/caffeinate/dripper/callbacks.rb
145
148
  - lib/caffeinate/dripper/campaign.rb
146
149
  - lib/caffeinate/dripper/defaults.rb
147
150
  - lib/caffeinate/dripper/delivery.rb
148
151
  - lib/caffeinate/dripper/drip.rb
152
+ - lib/caffeinate/dripper/inferences.rb
149
153
  - lib/caffeinate/dripper/perform.rb
154
+ - lib/caffeinate/dripper/periodical.rb
150
155
  - lib/caffeinate/dripper/subscriber.rb
151
156
  - lib/caffeinate/engine.rb
157
+ - lib/caffeinate/helpers.rb
158
+ - lib/caffeinate/mail_ext.rb
159
+ - lib/caffeinate/url_helpers.rb
152
160
  - lib/caffeinate/version.rb
153
161
  - lib/generators/caffeinate/install_generator.rb
154
162
  - lib/generators/caffeinate/templates/application_dripper.rb
@@ -1,15 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Caffeinate</title>
5
- <%= csrf_meta_tags %>
6
- <%= csp_meta_tag %>
7
-
8
- <%= stylesheet_link_tag "caffeinate/application", media: "all" %>
9
- </head>
10
- <body>
11
-
12
- <%= yield %>
13
-
14
- </body>
15
- </html>
@@ -1 +0,0 @@
1
- <h5>You have been unsubscribed.</h5>
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Caffeinate
4
- module ActionMailer
5
- module Helpers
6
- def caffeinate_unsubscribe_url(caffeinate_campaign_subscription, **options)
7
- opts = (::ActionMailer::Base.default_url_options || {}).merge(options)
8
- Caffeinate::Engine.routes.url_helpers.caffeinate_unsubscribe_url(token: caffeinate_campaign_subscription.token, **opts)
9
- end
10
- end
11
- end
12
- end