notification-pusher 1.0.0.beta10 → 1.0.0.beta11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85507c35f9a208143b6c60d0619a2451ee338ff647bf387d6a35d68d710013df
4
- data.tar.gz: 10a5c1cf5effbc81e8307afcc28d18f32e453a1a6bf644e8c6efcd9bac7d3d1b
3
+ metadata.gz: 3389befe3b78fc16d567501785c291d3df968498f45703a109650dc4f6fcaa24
4
+ data.tar.gz: 3887f3617fa6da2c532c62f86df358be8d1872a231d8f0cbcf21d829da69cbc3
5
5
  SHA512:
6
- metadata.gz: 9948eff2f69db1e4062c83e526d058a50b01b79e91e1e927873078228ac52885eb079e9cbf352283333ce980c043e9cfbb083091bbcec3c29dadc1fd0093fe4a
7
- data.tar.gz: b74d4e8fac75032fd8ebccc9ae37f1dcadb870a8ef3aef7c4618d12d471b00a93d77964fd1f16f5d635deea342bf65be45bbf2dc0c9de360c0e6da59d4a67871
6
+ metadata.gz: 1f6ebeb06eb9c23c24ea539ea1def734569f2308e62a5470a7a1c01a86784d006d4363e9d4f5ffb96fcebbb29564f2271ad81e295fe2d62d4f8ea241de78c4cc
7
+ data.tar.gz: 73df929584ab73f5192c3203de279828be712e01282501f827784dc894b4ac9110cd34baec97f6f4e8a91f7a2b57fff26b43728ecc0aea017e67bc1f9bbf12a4
@@ -11,8 +11,14 @@ module NotificationPusher
11
11
 
12
12
  class Configuration
13
13
 
14
+ attr_accessor :pushers
15
+
16
+ def initialize
17
+ @pushers = []
18
+ end
19
+
14
20
  def define_pusher name, options = {}
15
- ::NotificationPusher::Pusher.new name, options
21
+ self.pushers << ::NotificationPusher::Pusher.new(name, options)
16
22
  end
17
23
 
18
24
  end
@@ -1,3 +1,6 @@
1
+ require 'notification-handler'
2
+ require 'active_support'
3
+
1
4
  module NotificationPusher
2
5
  module NotificationLibrary
3
6
 
@@ -13,15 +13,15 @@ module NotificationPusher
13
13
 
14
14
  def push notification, options = {}
15
15
  default_options = self.options
16
- options = default_options.merge! options
17
- if defined?(NotificationPusher.const_get(pusher.name))
16
+ options = options.nil? ? default_options : default_options.merge!(options)
17
+ if defined?(NotificationPusher.const_get(self.name))
18
18
  instance = NotificationPusher.const_get(self.name).new notification, options
19
19
  self.instances << instance
20
20
  end
21
21
  end
22
22
 
23
23
  def self.find_by_name name
24
- ObjectSpace.each_object(NotificationPusher::Pusher).select { |pusher| pusher.name == name }
24
+ NotificationPusher.configuration.pushers.select { |pusher| pusher.name == name }
25
25
  end
26
26
 
27
27
  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.beta10
4
+ version: 1.0.0.beta11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Hübotter
@@ -10,20 +10,34 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2017-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '5.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '5.0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: notification-handler
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - '='
18
32
  - !ruby/object:Gem::Version
19
- version: 1.0.0.beta10
33
+ version: 1.0.0.beta11
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - '='
25
39
  - !ruby/object:Gem::Version
26
- version: 1.0.0.beta10
40
+ version: 1.0.0.beta11
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rspec
29
43
  requirement: !ruby/object:Gem::Requirement