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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +58 -1
- data/LICENSE.txt +19 -17
- data/README.md +503 -32
- data/lib/.rbnext/3.0/active_delivery/base.rb +124 -0
- data/lib/.rbnext/3.0/active_delivery/callbacks.rb +97 -0
- data/lib/.rbnext/3.0/active_delivery/lines/base.rb +63 -0
- data/lib/.rbnext/3.0/active_delivery/lines/mailer.rb +25 -0
- data/lib/.rbnext/3.1/active_delivery/base.rb +124 -0
- data/lib/.rbnext/3.1/active_delivery/lines/base.rb +63 -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 +178 -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 +49 -0
- data/lib/abstract_notifier/version.rb +5 -0
- data/lib/abstract_notifier.rb +74 -0
- data/lib/active_delivery/base.rb +156 -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 +24 -17
- 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 +61 -56
- 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: e9c65eedb249c1a52253ad6e2155271e8931b55e2e7e429baf9f72682a4bd60a
|
4
|
+
data.tar.gz: '048565d99b6da3903905740b90c726f1805376237e7af4cb7f526b83bea0857e'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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.
|