noticed 2.4.0 → 2.4.1

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: 6c98658561b5afec24269bdf1f1a8217b000dcf4db2abb5007319833141edbd9
4
- data.tar.gz: 99503d35717b87ae0cdad18d475bba9715ecaa4b84fbec49ee3be94237388c45
3
+ metadata.gz: 5d2028c8acaa806c4ce94491efc21e4cef94756bed16fbcb6ac26d03844d8965
4
+ data.tar.gz: 7b8842063ae43ec9bc9ea1630c912c6529546c3ece674b5f61a55d066a331de5
5
5
  SHA512:
6
- metadata.gz: 7a85e749ddd781f5296cee3a891ed7a928e2c2051c80b44375509e4d39741e3e251a3a23665e623070f8f4a1beae9340cf696f9be1f1f1f6bc97363825ad2ed7
7
- data.tar.gz: 71ed6f70d6770bc47f733ff290cdf0aecdae8083438707f018d6a0f215ec2fa104d97382e9f8faefe51db3662158da675f0c74ee11c188aad0e4c5380d83938e
6
+ metadata.gz: 335ae225976b95869a72ba274a37000279161045826afcce6f966e3ef7fd42bfaf94acc754667823ea3ec5f0ac526b2b67f9244ce79c6dd20a8e7e7b7c9193b6
7
+ data.tar.gz: 1aef782254a0421f905519871b5c553d0b3ae85c119347016a9b0805f8af6c349105991bf0ace186bb71349a6f767f22ff4a46a08765b46df17c7c5aa60fd942
data/README.md CHANGED
@@ -85,7 +85,7 @@ rails generate noticed:notifier NewCommentNotifier
85
85
  - [Tip: Capture User Preferences](#tip-capture-user-preferences)
86
86
  - [Tip: Extracting Delivery Method Configurations](#tip-extracting-delivery-method-configurations)
87
87
  - [Shared Delivery Method Options](#shared-delivery-method-options)
88
- - [Sending Notifications](#sending-notifications)
88
+ - [Sending Notifications](#-sending-notifications)
89
89
  - [Custom Noticed Model Methods](#custom-noticed-model-methods)
90
90
 
91
91
  ### Notifier Objects
@@ -525,7 +525,7 @@ If you want to build your own delivery method to deliver notifications to a spec
525
525
 
526
526
  `rails generate noticed:delivery_method Discord`
527
527
 
528
- This will generate a new `DeliveryMethods::Discord` class inside the `app/notifiers/delivery_methods` folder, which can be used to deliver notifications to Discord.
528
+ This will generate a new `ApplicationDeliveryMethod` and `DeliveryMethods::Discord` class inside the `app/notifiers/delivery_methods` folder, which can be used to deliver notifications to Discord.
529
529
 
530
530
  ```ruby
531
531
  class DeliveryMethods::Discord < ApplicationDeliveryMethod
@@ -5,7 +5,7 @@ module Noticed
5
5
  def perform(event)
6
6
  # Enqueue bulk deliveries
7
7
  event.bulk_delivery_methods.each_value do |deliver_by|
8
- deliver_by.perform_later(event)
8
+ deliver_by.perform_later(event) if deliver_by.perform?(event)
9
9
  end
10
10
 
11
11
  # Enqueue individual deliveries
@@ -32,7 +32,7 @@ module Noticed
32
32
 
33
33
  if option.respond_to?(:call)
34
34
  context.instance_exec(&option)
35
- elsif option.is_a?(Symbol) && context.respond_to?(option)
35
+ elsif option.is_a?(Symbol) && context.respond_to?(option, true)
36
36
  context.send(option)
37
37
  else
38
38
  option
@@ -40,7 +40,7 @@ module Noticed
40
40
  event.instance_exec(&option)
41
41
 
42
42
  # Call method if symbol and matching method
43
- elsif option.is_a?(Symbol) && event.respond_to?(option)
43
+ elsif option.is_a?(Symbol) && event.respond_to?(option, true)
44
44
  event.send(option)
45
45
 
46
46
  # Return the value
@@ -50,7 +50,7 @@ module Noticed
50
50
  notification.instance_exec(&option)
51
51
 
52
52
  # Call method if symbol and matching method on Notifier
53
- elsif option.is_a?(Symbol) && event.respond_to?(option)
53
+ elsif option.is_a?(Symbol) && event.respond_to?(option, true)
54
54
  event.send(option, notification)
55
55
 
56
56
  # Return the value
@@ -25,7 +25,7 @@ module Noticed
25
25
 
26
26
  def format_notification(device_token)
27
27
  method = config[:json]
28
- if method.is_a?(Symbol) && event.respond_to?(method)
28
+ if method.is_a?(Symbol) && event.respond_to?(method, true)
29
29
  event.send(method, device_token)
30
30
  else
31
31
  notification.instance_exec(device_token, &method)
@@ -34,7 +34,7 @@ module Noticed
34
34
 
35
35
  method = config[:format]
36
36
  # Call method on Notifier if defined
37
- if method&.is_a?(Symbol) && event.respond_to?(method)
37
+ if method&.is_a?(Symbol) && event.respond_to?(method, true)
38
38
  event.send(method, notification, apn)
39
39
  # If Proc, evaluate it on the Notification
40
40
  elsif method&.respond_to?(:call)
@@ -1,3 +1,3 @@
1
1
  module Noticed
2
- VERSION = "2.4.0"
2
+ VERSION = "2.4.1"
3
3
  end
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.0
4
+ version: 2.4.1
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-06-27 00:00:00.000000000 Z
11
+ date: 2024-07-31 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.14
103
+ rubygems_version: 3.5.15
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: Notifications for Ruby on Rails applications