noticed 1.2.4 → 1.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -0
- data/lib/noticed/base.rb +6 -2
- data/lib/noticed/coder.rb +9 -1
- data/lib/noticed/delivery_methods/action_cable.rb +13 -5
- data/lib/noticed/delivery_methods/slack.rb +1 -1
- data/lib/noticed/delivery_methods/twilio.rb +1 -1
- data/lib/noticed/translation.rb +1 -1
- 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: aab5129001fd96625a6a4141dfcf8aa93263b691fb663faa25e66153c5df9244
|
4
|
+
data.tar.gz: 22d30af822563d150c933bc5aeb2116386db73bcb114d82cf46059ae53c9407e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ecf9ce4e2be01cbb171a86f1fe10feb2931e2035c8f857f2b98951c5f8e299b9eadef7b0b1086f53b971f5fa5a31f266491c57f5715cf615b7acc7cf828f518
|
7
|
+
data.tar.gz: 8f896e1e98893d611697c10ebb30e6359a5cafefc9b54d6eff7a434b05eef90d055ed82e9e1d3ed61fcb76dbc2c0be4b5845ebdff799527e745507c919070585
|
data/Rakefile
CHANGED
@@ -18,6 +18,10 @@ require "bundler/gem_tasks"
|
|
18
18
|
|
19
19
|
require "rake/testtask"
|
20
20
|
|
21
|
+
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
|
22
|
+
load "rails/tasks/engine.rake"
|
23
|
+
load "rails/tasks/statistics.rake"
|
24
|
+
|
21
25
|
Rake::TestTask.new(:test) do |t|
|
22
26
|
t.libs << "test"
|
23
27
|
t.pattern = "test/**/*_test.rb"
|
data/lib/noticed/base.rb
CHANGED
@@ -29,9 +29,10 @@ module Noticed
|
|
29
29
|
new(params)
|
30
30
|
end
|
31
31
|
|
32
|
-
def
|
33
|
-
param_names.
|
32
|
+
def params(*names)
|
33
|
+
param_names.concat Array.wrap(names)
|
34
34
|
end
|
35
|
+
alias param params
|
35
36
|
end
|
36
37
|
|
37
38
|
def initialize(params = {})
|
@@ -68,6 +69,9 @@ module Noticed
|
|
68
69
|
def run_delivery(recipient, enqueue: true)
|
69
70
|
delivery_methods = self.class.delivery_methods.dup
|
70
71
|
|
72
|
+
# Set recipient to instance var so it is available to Notification class
|
73
|
+
@recipient = recipient
|
74
|
+
|
71
75
|
# Run database delivery inline first if it exists so other methods have access to the record
|
72
76
|
if (index = delivery_methods.find_index { |m| m[:name] == :database })
|
73
77
|
delivery_method = delivery_methods.delete_at(index)
|
data/lib/noticed/coder.rb
CHANGED
@@ -1,11 +1,19 @@
|
|
1
1
|
module Noticed
|
2
2
|
class Coder
|
3
3
|
def self.load(data)
|
4
|
+
return if data.nil?
|
5
|
+
|
6
|
+
# Text columns need JSON parsing
|
7
|
+
if data.is_a?(String)
|
8
|
+
data = JSON.parse(data)
|
9
|
+
end
|
10
|
+
|
4
11
|
ActiveJob::Arguments.send(:deserialize_argument, data)
|
5
12
|
end
|
6
13
|
|
7
14
|
def self.dump(data)
|
8
|
-
|
15
|
+
return if data.nil?
|
16
|
+
ActiveJob::Arguments.send(:serialize_argument, data).to_json
|
9
17
|
end
|
10
18
|
end
|
11
19
|
end
|
@@ -16,11 +16,19 @@ module Noticed
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def channel
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
@channel ||= begin
|
20
|
+
value = options[:channel]
|
21
|
+
case value
|
22
|
+
when String
|
23
|
+
value.constantize
|
24
|
+
when Symbol
|
25
|
+
notification.send(value)
|
26
|
+
when Class
|
27
|
+
value
|
28
|
+
else
|
29
|
+
Noticed::NotificationChannel
|
30
|
+
end
|
31
|
+
end
|
24
32
|
end
|
25
33
|
end
|
26
34
|
end
|
data/lib/noticed/translation.rb
CHANGED
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.2.
|
4
|
+
version: 1.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Oliver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|