notification-pusher 1.0.0.beta11 → 1.0.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +2 -2
- data/lib/notification_pusher/notification_library.rb +11 -11
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ba50c03c7d5d3e209e8185002e5dcbcd756f55528c2e484223d2d12b53bf205
|
4
|
+
data.tar.gz: 3d2646830fccda54fa8831f9beb7c59807ebf913d5d88a375291b2b0fdccefb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3428c5bb1dd2943de8254f995227c56f1954a002a69a286009203d56ce5ac17a81ede9d4205a88567c4b14d6d18cdb8b1b219c685c43ecbcd5557d7e001d98dd
|
7
|
+
data.tar.gz: 24bf19a1eb7d8cdd2ec4c10f02f5dcb156174c09d38fcf4008d6b554e83dac587b1255fe90b0d14df2854449728e7ee8650ff113ad4374ac4711c754c3a242d0
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -86,7 +86,7 @@ Where `name` is the name of the defined pusher and `custom_options` are the opti
|
|
86
86
|
You are also able to do the exact same in just one line of code:
|
87
87
|
|
88
88
|
```ruby
|
89
|
-
notification = Notification.create target: User.first, object: Recipe.first,
|
89
|
+
notification = Notification.create target: User.first, object: Recipe.first, pusher: name, pusher_options: custom_options
|
90
90
|
```
|
91
91
|
|
92
92
|
**Note:** In this case, pass `custom_options` as a `Hash`.
|
@@ -107,7 +107,7 @@ class NotificationPusher::CustomPusher
|
|
107
107
|
def initialize notification, options = {}
|
108
108
|
# ...
|
109
109
|
end
|
110
|
-
|
110
|
+
|
111
111
|
end
|
112
112
|
```
|
113
113
|
|
@@ -7,8 +7,8 @@ module NotificationPusher
|
|
7
7
|
extend ActiveSupport::Concern
|
8
8
|
|
9
9
|
included do
|
10
|
-
attr_accessor :
|
11
|
-
attr_accessor :
|
10
|
+
attr_accessor :pusher
|
11
|
+
attr_accessor :pusher_options
|
12
12
|
|
13
13
|
after_create_commit :initialize_pusher
|
14
14
|
|
@@ -18,23 +18,23 @@ module NotificationPusher
|
|
18
18
|
module InstanceMethods
|
19
19
|
|
20
20
|
def push name, options = {}
|
21
|
-
self.
|
22
|
-
self.
|
21
|
+
self.pusher = name
|
22
|
+
self.pusher_options = options
|
23
23
|
self.initialize_pusher
|
24
24
|
end
|
25
25
|
|
26
|
-
|
26
|
+
protected
|
27
27
|
|
28
28
|
def initialize_pusher
|
29
|
-
unless self.
|
30
|
-
if self.
|
31
|
-
self.
|
29
|
+
unless self.pusher.nil?
|
30
|
+
if self.pusher.kind_of?(Array)
|
31
|
+
self.pusher.each do |class_name|
|
32
32
|
pusher = NotificationPusher::Pusher.find_by_name(class_name).first
|
33
|
-
pusher.push(self, self.
|
33
|
+
pusher.push(self, self.pusher_options[class_name.to_sym])
|
34
34
|
end
|
35
35
|
else
|
36
|
-
pusher = NotificationPusher::Pusher.find_by_name(self.
|
37
|
-
pusher.push(self, self.
|
36
|
+
pusher = NotificationPusher::Pusher.find_by_name(self.pusher).first
|
37
|
+
pusher.push(self, self.pusher_options)
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notification-pusher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Hübotter
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.0.0
|
33
|
+
version: 1.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.0.0
|
40
|
+
version: 1.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -97,9 +97,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
97
97
|
version: '2.3'
|
98
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- - "
|
100
|
+
- - ">="
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version:
|
102
|
+
version: '0'
|
103
103
|
requirements: []
|
104
104
|
rubyforge_project:
|
105
105
|
rubygems_version: 2.7.3
|