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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +62 -0
- data/LICENSE.txt +19 -17
- data/README.md +595 -33
- data/lib/.rbnext/3.0/abstract_notifier/async_adapters/active_job.rb +27 -0
- data/lib/.rbnext/3.0/active_delivery/base.rb +248 -0
- data/lib/.rbnext/3.0/active_delivery/callbacks.rb +101 -0
- data/lib/.rbnext/3.0/active_delivery/lines/base.rb +89 -0
- data/lib/.rbnext/3.0/active_delivery/lines/mailer.rb +26 -0
- data/lib/.rbnext/3.0/active_delivery/testing.rb +62 -0
- data/lib/.rbnext/3.1/abstract_notifier/base.rb +217 -0
- data/lib/.rbnext/3.1/active_delivery/base.rb +248 -0
- data/lib/.rbnext/3.1/active_delivery/lines/base.rb +89 -0
- data/lib/abstract_notifier/async_adapters/active_job.rb +27 -0
- data/lib/abstract_notifier/async_adapters.rb +16 -0
- data/lib/abstract_notifier/base.rb +217 -0
- data/lib/abstract_notifier/callbacks.rb +94 -0
- data/lib/abstract_notifier/testing/minitest.rb +51 -0
- data/lib/abstract_notifier/testing/rspec.rb +164 -0
- data/lib/abstract_notifier/testing.rb +53 -0
- data/lib/abstract_notifier/version.rb +5 -0
- data/lib/abstract_notifier.rb +75 -0
- data/lib/active_delivery/base.rb +147 -27
- data/lib/active_delivery/callbacks.rb +25 -25
- data/lib/active_delivery/ext/string_constantize.rb +24 -0
- data/lib/active_delivery/lines/base.rb +42 -16
- data/lib/active_delivery/lines/mailer.rb +7 -18
- data/lib/active_delivery/lines/notifier.rb +53 -0
- data/lib/active_delivery/raitie.rb +9 -0
- data/lib/active_delivery/testing/rspec.rb +59 -12
- data/lib/active_delivery/testing.rb +19 -5
- data/lib/active_delivery/version.rb +1 -1
- data/lib/active_delivery.rb +8 -0
- metadata +63 -54
- data/.gem_release.yml +0 -3
- data/.github/ISSUE_TEMPLATE/bug_report.md +0 -24
- data/.github/ISSUE_TEMPLATE/feature_request.md +0 -24
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -23
- data/.github/workflows/docs-lint.yml +0 -72
- data/.github/workflows/rspec-jruby.yml +0 -35
- data/.github/workflows/rspec.yml +0 -51
- data/.github/workflows/rubocop.yml +0 -21
- data/.gitignore +0 -43
- data/.mdlrc +0 -1
- data/.rspec +0 -2
- data/.rubocop-md.yml +0 -16
- data/.rubocop.yml +0 -28
- data/Gemfile +0 -17
- data/RELEASING.md +0 -43
- data/Rakefile +0 -20
- data/active_delivery.gemspec +0 -35
- data/forspell.dict +0 -8
- data/gemfiles/jruby.gemfile +0 -5
- data/gemfiles/rails42.gemfile +0 -8
- data/gemfiles/rails5.gemfile +0 -5
- data/gemfiles/rails50.gemfile +0 -8
- data/gemfiles/rails6.gemfile +0 -5
- data/gemfiles/railsmaster.gemfile +0 -6
- data/gemfiles/rubocop.gemfile +0 -4
- data/lefthook.yml +0 -18
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34afeceddc78be6864aed136f68bc0a0f0eb43c203ef1520260fe94a8c934b39
|
4
|
+
data.tar.gz: dab4270f8b7a4c5e14b18c3fd36ceb081587425f26a50060191778bab768d688
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
1
|
+
Copyright (c) 2018-2023 Vladimir Dementyev
|
2
2
|
|
3
|
-
|
3
|
+
MIT License
|
4
4
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
of this software and associated documentation files (the
|
7
|
-
in the Software without restriction, including
|
8
|
-
to use, copy, modify, merge, publish,
|
9
|
-
copies of the Software, and to
|
10
|
-
furnished to do so, subject to
|
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
|
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.
|