active_delivery 0.4.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +62 -0
  3. data/LICENSE.txt +19 -17
  4. data/README.md +595 -33
  5. data/lib/.rbnext/3.0/abstract_notifier/async_adapters/active_job.rb +27 -0
  6. data/lib/.rbnext/3.0/active_delivery/base.rb +248 -0
  7. data/lib/.rbnext/3.0/active_delivery/callbacks.rb +101 -0
  8. data/lib/.rbnext/3.0/active_delivery/lines/base.rb +89 -0
  9. data/lib/.rbnext/3.0/active_delivery/lines/mailer.rb +26 -0
  10. data/lib/.rbnext/3.0/active_delivery/testing.rb +62 -0
  11. data/lib/.rbnext/3.1/abstract_notifier/base.rb +217 -0
  12. data/lib/.rbnext/3.1/active_delivery/base.rb +248 -0
  13. data/lib/.rbnext/3.1/active_delivery/lines/base.rb +89 -0
  14. data/lib/abstract_notifier/async_adapters/active_job.rb +27 -0
  15. data/lib/abstract_notifier/async_adapters.rb +16 -0
  16. data/lib/abstract_notifier/base.rb +217 -0
  17. data/lib/abstract_notifier/callbacks.rb +94 -0
  18. data/lib/abstract_notifier/testing/minitest.rb +51 -0
  19. data/lib/abstract_notifier/testing/rspec.rb +164 -0
  20. data/lib/abstract_notifier/testing.rb +53 -0
  21. data/lib/abstract_notifier/version.rb +5 -0
  22. data/lib/abstract_notifier.rb +75 -0
  23. data/lib/active_delivery/base.rb +147 -27
  24. data/lib/active_delivery/callbacks.rb +25 -25
  25. data/lib/active_delivery/ext/string_constantize.rb +24 -0
  26. data/lib/active_delivery/lines/base.rb +42 -16
  27. data/lib/active_delivery/lines/mailer.rb +7 -18
  28. data/lib/active_delivery/lines/notifier.rb +53 -0
  29. data/lib/active_delivery/raitie.rb +9 -0
  30. data/lib/active_delivery/testing/rspec.rb +59 -12
  31. data/lib/active_delivery/testing.rb +19 -5
  32. data/lib/active_delivery/version.rb +1 -1
  33. data/lib/active_delivery.rb +8 -0
  34. metadata +63 -54
  35. data/.gem_release.yml +0 -3
  36. data/.github/ISSUE_TEMPLATE/bug_report.md +0 -24
  37. data/.github/ISSUE_TEMPLATE/feature_request.md +0 -24
  38. data/.github/PULL_REQUEST_TEMPLATE.md +0 -23
  39. data/.github/workflows/docs-lint.yml +0 -72
  40. data/.github/workflows/rspec-jruby.yml +0 -35
  41. data/.github/workflows/rspec.yml +0 -51
  42. data/.github/workflows/rubocop.yml +0 -21
  43. data/.gitignore +0 -43
  44. data/.mdlrc +0 -1
  45. data/.rspec +0 -2
  46. data/.rubocop-md.yml +0 -16
  47. data/.rubocop.yml +0 -28
  48. data/Gemfile +0 -17
  49. data/RELEASING.md +0 -43
  50. data/Rakefile +0 -20
  51. data/active_delivery.gemspec +0 -35
  52. data/forspell.dict +0 -8
  53. data/gemfiles/jruby.gemfile +0 -5
  54. data/gemfiles/rails42.gemfile +0 -8
  55. data/gemfiles/rails5.gemfile +0 -5
  56. data/gemfiles/rails50.gemfile +0 -8
  57. data/gemfiles/rails6.gemfile +0 -5
  58. data/gemfiles/railsmaster.gemfile +0 -6
  59. data/gemfiles/rubocop.gemfile +0 -4
  60. data/lefthook.yml +0 -18
  61. data/lib/active_delivery/action_mailer/parameterized.rb +0 -92
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6fa9d6ec097fb92f08a8d1cefb9991db7dfd939d0431f300f7f4db7dbf5a949
4
- data.tar.gz: e08797cf4116d876180b08e962e4b7f54668a5a1557c74a1430af1b14ef4b9a9
3
+ metadata.gz: 34afeceddc78be6864aed136f68bc0a0f0eb43c203ef1520260fe94a8c934b39
4
+ data.tar.gz: dab4270f8b7a4c5e14b18c3fd36ceb081587425f26a50060191778bab768d688
5
5
  SHA512:
6
- metadata.gz: 797c2584376d3a388ff1e40f769962e84d5dfc6b181413f06ac53758183e4451128722fa0108d13497da27e4d2662cf6dbcb303c3fc6130a17647694e3865747
7
- data.tar.gz: d5ada86fae7f8fe428bda32d82d5741023e77f45cf53de1320d41d3351137ecd63c05ba3449204527ed6d9ce27c96d2e0212a17cae3c1029ce1d1188dfc05dbe
6
+ metadata.gz: 67992b515155ae977dd2f839448b3fe89d8c1391906e3c20bd425782241378f70d0b933834433a5e30904a7f3a1176c1313cd690267f001258f9584b078f0367
7
+ data.tar.gz: c811abf777c5c0c7552749fcedd228e7914bc80ded1a14129f4194097d74049f72e80c229c59549ac09141fed3145ab4c4199706ca29055ce6a405c3c16e13a2
data/CHANGELOG.md CHANGED
@@ -2,6 +2,68 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 📬 1.0.0 (2023-08-29)
6
+
7
+ - Add `resolver_pattern` option to specify naming pattern for notifiers without using Procs. ([@palkan][])
8
+
9
+ - [!IMPORTANT] Notifier's `#notify_later` now do not process the action right away, only enqueue the job. ([@palkan][]).
10
+
11
+ This matches the Action Mailer behaviour. Now, the action is only invoked before the delivery attempt.
12
+
13
+ - Add callbacks support to Abstract Notifier (`before_action`, `after_deliver`, etc.). ([@palkan][])
14
+
15
+ - **Merge in abstract_notifier** ([@palkan][])
16
+
17
+ [Abstract Notifier](https://github.com/palkan/abstract_notifier) is now a part of Active Delivery.
18
+
19
+ - Add ability to specify delivery actions explicitly and disable implicit proxying. ([@palkan][])
20
+
21
+ You can disable default Active Delivery behaviour of proxying action methods to underlying lines via the `ActiveDelivery.deliver_actions_required = true` configuration option. Then, in each delivery class, you can specify the available actions via the `.delivers` method:
22
+
23
+ ```ruby
24
+ class PostMailer < ApplicationMailer
25
+ def published(post)
26
+ # ...
27
+ end
28
+
29
+ def whatever(post)
30
+ # ...
31
+ end
32
+ end
33
+
34
+ ActiveDelivery.deliver_actions_required = true
35
+
36
+ class PostDelivery < ApplicationDelivery
37
+ delivers :published
38
+ end
39
+
40
+ PostDelivery.published(post) #=> ok
41
+ PostDelivery.whatever(post) #=> raises NoMethodError
42
+ ```
43
+
44
+ - Add `#deliver_via(*lines)` RSpec matcher. ([@palkan][])
45
+
46
+ - Provide ActionMailer-like interface to trigger notifications. ([@palkan][])
47
+
48
+ Now you can send notifications as follows:
49
+
50
+ ```ruby
51
+ MyDelivery.with(user:).new_notification(payload).deliver_later
52
+
53
+ # Equals to the old (and still supported)
54
+ MyDelivery.with(user:).notify(:new_notification, payload)
55
+ ```
56
+
57
+ - Support passing a string class name as a handler class. ([@palkan][])
58
+
59
+ - Allow disabled handler classes cache and do not cache when Rails cache_classes is false. ([@palkan][])
60
+
61
+ - Add `skip_{before,around,after}_notify` support. ([@palkan][])
62
+
63
+ - Rails <6 is no longer supported.
64
+
65
+ - Ruby 2.7+ is required.
66
+
5
67
  ## 0.4.4 (2020-09-01)
6
68
 
7
69
  - Added `ActiveDelivery::Base.unregister_line` ([@thornomad][])
data/LICENSE.txt CHANGED
@@ -1,21 +1,23 @@
1
- The MIT License (MIT)
1
+ Copyright (c) 2018-2023 Vladimir Dementyev
2
2
 
3
- Copyright (c) 2018 Vladimir Dementyev
3
+ MIT License
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
11
12
 
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
23
 
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.