active_delivery 0.4.3 → 1.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +58 -1
  3. data/LICENSE.txt +19 -17
  4. data/README.md +503 -32
  5. data/lib/.rbnext/3.0/active_delivery/base.rb +124 -0
  6. data/lib/.rbnext/3.0/active_delivery/callbacks.rb +97 -0
  7. data/lib/.rbnext/3.0/active_delivery/lines/base.rb +63 -0
  8. data/lib/.rbnext/3.0/active_delivery/lines/mailer.rb +25 -0
  9. data/lib/.rbnext/3.1/active_delivery/base.rb +124 -0
  10. data/lib/.rbnext/3.1/active_delivery/lines/base.rb +63 -0
  11. data/lib/abstract_notifier/async_adapters/active_job.rb +27 -0
  12. data/lib/abstract_notifier/async_adapters.rb +16 -0
  13. data/lib/abstract_notifier/base.rb +178 -0
  14. data/lib/abstract_notifier/testing/minitest.rb +51 -0
  15. data/lib/abstract_notifier/testing/rspec.rb +164 -0
  16. data/lib/abstract_notifier/testing.rb +49 -0
  17. data/lib/abstract_notifier/version.rb +5 -0
  18. data/lib/abstract_notifier.rb +74 -0
  19. data/lib/active_delivery/base.rb +156 -27
  20. data/lib/active_delivery/callbacks.rb +25 -25
  21. data/lib/active_delivery/ext/string_constantize.rb +24 -0
  22. data/lib/active_delivery/lines/base.rb +24 -17
  23. data/lib/active_delivery/lines/mailer.rb +7 -18
  24. data/lib/active_delivery/lines/notifier.rb +53 -0
  25. data/lib/active_delivery/raitie.rb +9 -0
  26. data/lib/active_delivery/testing/rspec.rb +59 -12
  27. data/lib/active_delivery/testing.rb +19 -5
  28. data/lib/active_delivery/version.rb +1 -1
  29. data/lib/active_delivery.rb +8 -0
  30. metadata +61 -56
  31. data/.gem_release.yml +0 -3
  32. data/.github/ISSUE_TEMPLATE/bug_report.md +0 -24
  33. data/.github/ISSUE_TEMPLATE/feature_request.md +0 -24
  34. data/.github/PULL_REQUEST_TEMPLATE.md +0 -23
  35. data/.github/workflows/docs-lint.yml +0 -72
  36. data/.github/workflows/rspec-jruby.yml +0 -35
  37. data/.github/workflows/rspec.yml +0 -51
  38. data/.github/workflows/rubocop.yml +0 -21
  39. data/.gitignore +0 -43
  40. data/.mdlrc +0 -1
  41. data/.rspec +0 -2
  42. data/.rubocop-md.yml +0 -16
  43. data/.rubocop.yml +0 -28
  44. data/Gemfile +0 -17
  45. data/RELEASING.md +0 -43
  46. data/Rakefile +0 -20
  47. data/active_delivery.gemspec +0 -35
  48. data/forspell.dict +0 -8
  49. data/gemfiles/jruby.gemfile +0 -5
  50. data/gemfiles/rails42.gemfile +0 -8
  51. data/gemfiles/rails5.gemfile +0 -5
  52. data/gemfiles/rails50.gemfile +0 -8
  53. data/gemfiles/rails6.gemfile +0 -5
  54. data/gemfiles/railsmaster.gemfile +0 -6
  55. data/gemfiles/rubocop.gemfile +0 -4
  56. data/lefthook.yml +0 -18
  57. 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: 5798b0d549774cc32295198d1f1ebcd155c07e0624ff8260b427d437cd0ac465
4
- data.tar.gz: '086acc7c7080f9170663353740d462acbd065d4eb105a23193aa9150bdb84327'
3
+ metadata.gz: e9c65eedb249c1a52253ad6e2155271e8931b55e2e7e429baf9f72682a4bd60a
4
+ data.tar.gz: '048565d99b6da3903905740b90c726f1805376237e7af4cb7f526b83bea0857e'
5
5
  SHA512:
6
- metadata.gz: b74b9673fd219caec608b4a20cfc0cd94eb55df0b4a52b95edd799d5aea9552e0913c9861d06412494cd160fa7fd6f77c27bae603e60659bf58ad5adda9b71f0
7
- data.tar.gz: 3a0e73e048db14768401cc0f1406ad0aaa09888ef2c18c739d15b2daaf0199375eee437b229e60b8aab7af38659d2bd815a7cd8402620618def7498a6d1373ac
6
+ metadata.gz: 0c753da1c2b0abf43e3361eff188c87e2f3eefa9f1c1a35c3a238810b8fd399e0f91196c5af94a3d50a66ccd1439adb166be95e416b531b00ffa4021550c1608
7
+ data.tar.gz: 225e522994457b30caad32e7ae5d0c93df5f2bca295fe63c460d3aa87f52478d387fc30950bc0b95a1f5ce93e42352588bc5310075bd55765cd67bb31b6e839f
data/CHANGELOG.md CHANGED
@@ -2,6 +2,62 @@
2
2
 
3
3
  ## master
4
4
 
5
+ - **Merge in abstract_notifier** ([@palkan][])
6
+
7
+ [Abstract Notifier](https://github.com/palkan/abstract_notifier) is now a part of Active Delivery.
8
+
9
+ - Add ability to specify delivery actions explicitly and disable implicit proxying. ([@palkan][])
10
+
11
+ 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:
12
+
13
+ ```ruby
14
+ class PostMailer < ApplicationMailer
15
+ def published(post)
16
+ # ...
17
+ end
18
+
19
+ def whatever(post)
20
+ # ...
21
+ end
22
+ end
23
+
24
+ ActiveDelivery.deliver_actions_required = true
25
+
26
+ class PostDelivery < ApplicationDelivery
27
+ delivers :published
28
+ end
29
+
30
+ PostDelivery.published(post) #=> ok
31
+ PostDelivery.whatever(post) #=> raises NoMethodError
32
+ ```
33
+
34
+ - Add `#deliver_via(*lines)` RSpec matcher. ([@palkan][])
35
+
36
+ - Provide ActionMailer-like interface to trigger notifications. ([@palkan][])
37
+
38
+ Now you can send notifications as follows:
39
+
40
+ ```ruby
41
+ MyDelivery.with(user:).new_notification(payload).deliver_later
42
+
43
+ # Equals to the old (and still supported)
44
+ MyDelivery.with(user:).notify(:new_notification, payload)
45
+ ```
46
+
47
+ - Support passing a string class name as a handler class. ([@palkan][])
48
+
49
+ - Allow disabled handler classes cache and do not cache when Rails cache_classes is false. ([@palkan][])
50
+
51
+ - Add `skip_{before,around,after}_notify` support. ([@palkan][])
52
+
53
+ - Rails <6 is no longer supported.
54
+
55
+ - Ruby 2.7+ is required.
56
+
57
+ ## 0.4.4 (2020-09-01)
58
+
59
+ - Added `ActiveDelivery::Base.unregister_line` ([@thornomad][])
60
+
5
61
  ## 0.4.3 (2020-08-21)
6
62
 
7
63
  - Fix parameterized mailers support in Rails >= 5.0, <5.2 ([@dmitryzuev][])
@@ -52,4 +108,5 @@ Initial version.
52
108
  [@curpeng]: https://github.com/curpeng
53
109
  [@iBublik]: https://github.com/ibublik
54
110
  [@brovikov]: https://github.com/brovikov
55
- [@dmitryzuev]: https://github.com/dmitryzuev
111
+ [@dmitryzuev]: https://github.com/dmitryzuev
112
+ [@thornomad]: https://github.com/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.