noticed 1.6.2 → 1.6.3
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 +4 -4
- data/README.md +1 -1
- data/lib/generators/noticed/model/base_generator.rb +0 -1
- data/lib/noticed/delivery_methods/base.rb +6 -4
- data/lib/noticed/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dca9fddb81724156c172bcb7ac9bdcbc7d3571554dd3b906d3df02395c730b23
|
4
|
+
data.tar.gz: 5a8676aa3224c61b6623b81db22aecde7fa175c5514da465dfd735269b91394a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 582f1a4e7282af29b7a66fcf322f13e2af6880757a3871a7cb74a44b3cc5fb9de6e404e5a62d78349cd7283caab14445bb63a508595878d98cadc352ea8bcbc1
|
7
|
+
data.tar.gz: 3764af8b5240a7b7de561512086497ea60ff9fecb1ff49d85ce2ea42509b97188519a97d9e05c884e0d48aebbfdca3cb27022b88347160e066942fd00b191ec5
|
data/README.md
CHANGED
@@ -109,7 +109,7 @@ end
|
|
109
109
|
* `if: :method_name` - Calls `method_name` and cancels delivery method if `false` is returned
|
110
110
|
* `unless: :method_name` - Calls `method_name` and cancels delivery method if `true` is returned
|
111
111
|
* `delay: ActiveSupport::Duration` - Delays the delivery for the given duration of time
|
112
|
-
* `delay: :method_name` - Calls `method_name which should return an `ActiveSupport::Duration` and delays the delivery for the given duration of time
|
112
|
+
* `delay: :method_name` - Calls `method_name` which should return an `ActiveSupport::Duration` and delays the delivery for the given duration of time
|
113
113
|
|
114
114
|
##### Helper Methods
|
115
115
|
|
@@ -16,7 +16,6 @@ module Noticed
|
|
16
16
|
argument :attributes, type: :array, default: [], banner: "field:type field:type"
|
17
17
|
|
18
18
|
def generate_notification
|
19
|
-
binding.irb
|
20
19
|
generate :model, name, "recipient:references{polymorphic}", "type", "params:#{json_column_type}", "read_at:datetime:index", *attributes
|
21
20
|
end
|
22
21
|
|
@@ -6,7 +6,7 @@ module Noticed
|
|
6
6
|
|
7
7
|
class_attribute :option_names, instance_writer: false, default: []
|
8
8
|
|
9
|
-
attr_reader :notification, :options, :params, :recipient, :record
|
9
|
+
attr_reader :notification, :options, :params, :recipient, :record, :logger
|
10
10
|
|
11
11
|
class << self
|
12
12
|
# Copy option names from parent
|
@@ -36,6 +36,9 @@ module Noticed
|
|
36
36
|
@recipient = args[:recipient]
|
37
37
|
@record = args[:record]
|
38
38
|
|
39
|
+
# Set the default logger
|
40
|
+
@logger = @options.fetch(:logger, Rails.logger)
|
41
|
+
|
39
42
|
# Make notification aware of database record and recipient during delivery
|
40
43
|
@notification.record = args[:record]
|
41
44
|
@notification.recipient = args[:recipient]
|
@@ -65,7 +68,6 @@ module Noticed
|
|
65
68
|
# post("http://example.com", basic_auth: {user:, pass:}, headers: {}, json: {}, form: {})
|
66
69
|
#
|
67
70
|
def post(url, args = {})
|
68
|
-
options ||= {}
|
69
71
|
basic_auth = args.delete(:basic_auth)
|
70
72
|
headers = args.delete(:headers)
|
71
73
|
|
@@ -76,8 +78,8 @@ module Noticed
|
|
76
78
|
response = request.post(url, args)
|
77
79
|
|
78
80
|
if options[:debug]
|
79
|
-
|
80
|
-
|
81
|
+
logger.debug("POST #{url}")
|
82
|
+
logger.debug("Response: #{response.code}: #{response}")
|
81
83
|
end
|
82
84
|
|
83
85
|
if !options[:ignore_failure] && !response.status.success?
|
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: 1.6.
|
4
|
+
version: 1.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Oliver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|