noticed 2.2.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70482becaedf2461851b7c9f8f0afd9c37a2c4caa9c2d5622cf007b212988730
|
4
|
+
data.tar.gz: '023579ed0635603e27fe99473bb77b17bda4bce7a0ac9ad0533179a6570693c3'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 923f424527ae03b0a9cb24d3fc83f59b9b7d914d7b0f53db928cc9d12b6757ee20fa1a7b810735d2a1657f7ee8a5b7efdee03d69de5b73c8fa31dae6c5400dd0
|
7
|
+
data.tar.gz: 2fd06825b9afabd447c867b54c8e31207b7c180d32a5f1ff341b543cf90d1cf9f4a1b65d398e230789e51d9b40cce42e3ebd04611f5970e520e9086e3eeae85f
|
data/README.md
CHANGED
@@ -331,6 +331,7 @@ class IosNotifier < Noticed::Event
|
|
331
331
|
config.before_enqueue = ->{ throw(:abort) unless recipient.registered_ios? }
|
332
332
|
end
|
333
333
|
end
|
334
|
+
```
|
334
335
|
|
335
336
|
#### Tip: Extracting Delivery Method Configurations
|
336
337
|
|
@@ -644,7 +645,7 @@ class DeliveryMethods::WhatsApp < Noticed::DeliveryMethod
|
|
644
645
|
def deliver
|
645
646
|
# ...
|
646
647
|
config.day #=> #<Proc:0x000f7c8 (lambda)>
|
647
|
-
evaluate_option(
|
648
|
+
evaluate_option(:day) #=> "Tuesday"
|
648
649
|
end
|
649
650
|
end
|
650
651
|
```
|
@@ -693,12 +694,6 @@ user.notifications.mark_as_unread
|
|
693
694
|
|
694
695
|
#### Instance methods
|
695
696
|
|
696
|
-
Convert back into a Noticed notifier object:
|
697
|
-
|
698
|
-
```ruby
|
699
|
-
@notification.to_notifier
|
700
|
-
```
|
701
|
-
|
702
697
|
Mark notification as read / unread:
|
703
698
|
|
704
699
|
```ruby
|
@@ -70,8 +70,12 @@ module Noticed
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def with(params)
|
73
|
-
|
74
|
-
|
73
|
+
if self < Ephemeral
|
74
|
+
new(params: params)
|
75
|
+
else
|
76
|
+
record = params.delete(:record)
|
77
|
+
new(params: params, record: record)
|
78
|
+
end
|
75
79
|
end
|
76
80
|
|
77
81
|
def deliver(recipients = nil, **options)
|
@@ -4,11 +4,15 @@ module Noticed
|
|
4
4
|
required_options :message
|
5
5
|
|
6
6
|
def deliver
|
7
|
-
channel
|
8
|
-
|
9
|
-
|
7
|
+
channel.broadcast_to stream, evaluate_option(:message)
|
8
|
+
end
|
9
|
+
|
10
|
+
def channel
|
11
|
+
fetch_constant(:channel) || Noticed::NotificationChannel
|
12
|
+
end
|
10
13
|
|
11
|
-
|
14
|
+
def stream
|
15
|
+
evaluate_option(:stream) || recipient
|
12
16
|
end
|
13
17
|
end
|
14
18
|
end
|
@@ -3,6 +3,12 @@ module Noticed
|
|
3
3
|
class TwilioMessaging < DeliveryMethod
|
4
4
|
def deliver
|
5
5
|
post_request url, basic_auth: {user: account_sid, pass: auth_token}, form: json.stringify_keys
|
6
|
+
rescue Noticed::ResponseUnsuccessful => exception
|
7
|
+
if exception.response.code.start_with?("4") && config[:error_handler]
|
8
|
+
notification.instance_exec(exception.response, &config[:error_handler])
|
9
|
+
else
|
10
|
+
raise
|
11
|
+
end
|
6
12
|
end
|
7
13
|
|
8
14
|
def json
|
data/lib/noticed/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: noticed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Oliver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
|
-
rubygems_version: 3.5.
|
103
|
+
rubygems_version: 3.5.10
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: Notifications for Ruby on Rails applications
|