notification-pusher 1.0.0.beta8 → 1.0.0.beta9
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: c7bd278a400f98567d17b9e39887e5e8960ddbfd99b9c2ad9edb6a462cf12f7c
|
4
|
+
data.tar.gz: bcd25f7e997fae9a09a75cec3b8994bacd4ba15c7500b786db314efff13b3f81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9188a46b341e911a926f67256f9ce958bc4fa20bd2dca0fd6d1dffb14374e89c4fc2634e07cb01851c195ad914edf76d03de9c8187a3e94bd98340f5eb37190c
|
7
|
+
data.tar.gz: f6a1df4e1b7640c06682282b01bb983f6f0a81ddb97e613e9ab3314c453733ab8d5d41dbd51aab73c20c09558db84f8162b5ead8645ffc49a1eda4d7c18a3afb
|
@@ -1,37 +1,47 @@
|
|
1
1
|
module NotificationPusher
|
2
2
|
module NotificationLibrary
|
3
3
|
|
4
|
-
|
5
|
-
attr_accessor :push_options
|
4
|
+
extend ActiveSupport::Concern
|
6
5
|
|
7
|
-
|
6
|
+
included do
|
7
|
+
attr_accessor :push
|
8
|
+
attr_accessor :push_options
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
self.initialize_pusher
|
10
|
+
after_create_commit :initialize_pusher
|
11
|
+
|
12
|
+
include NotificationPusher::NotificationLibrary::InstanceMethods
|
13
13
|
end
|
14
14
|
|
15
|
-
|
15
|
+
module InstanceMethods
|
16
|
+
|
17
|
+
def push name, options = {}
|
18
|
+
self.push = class_name
|
19
|
+
self.push_options = options
|
20
|
+
self.initialize_pusher
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
16
24
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
25
|
+
def initialize_pusher
|
26
|
+
unless self.push.nil?
|
27
|
+
if self.push.kind_of(Array)
|
28
|
+
self.push.each do |class_name|
|
29
|
+
pusher = NotificationPusher::Pusher.find_by_name(class_name).last
|
30
|
+
if defined?(NotificationPusher.const_get(pusher.name))
|
31
|
+
options = pusher.options.merge! self.push_options[class_name.to_sym]
|
32
|
+
pusher.instances << NotificationPusher.const_get(pusher.name).new self, options
|
33
|
+
end
|
34
|
+
end
|
35
|
+
else
|
36
|
+
pusher = NotificationPusher::Pusher.find_by_name(self.push).last
|
22
37
|
if defined?(NotificationPusher.const_get(pusher.name))
|
23
|
-
options = pusher.options.merge! self.push_options
|
24
|
-
pusher.instances << NotificationPusher.const_get(pusher.name).new options
|
38
|
+
options = pusher.options.merge! self.push_options
|
39
|
+
pusher.instances << NotificationPusher.const_get(pusher.name).new self, options
|
25
40
|
end
|
26
41
|
end
|
27
|
-
else
|
28
|
-
pusher = NotificationPusher::Pusher.find_by_name(self.push).last
|
29
|
-
if defined?(NotificationPusher.const_get(pusher.name))
|
30
|
-
options = pusher.options.merge! self.push_options
|
31
|
-
pusher.instances << NotificationPusher.const_get(pusher.name).new self, options
|
32
|
-
end
|
33
42
|
end
|
34
43
|
end
|
44
|
+
|
35
45
|
end
|
36
46
|
|
37
47
|
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.beta9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Hübotter
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0.0.
|
19
|
+
version: 1.0.0.beta9
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0.0.
|
26
|
+
version: 1.0.0.beta9
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|