pushr-gcm 1.0.0.pre.3 → 1.0.0.pre.4

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
  SHA1:
3
- metadata.gz: c6e0fb322944faa0719ef0273234e542e01697df
4
- data.tar.gz: c81c6715c276e596f6c740d7d9a942b37a2fcb87
3
+ metadata.gz: 55ef9497405d8415d4a814f670165a5542e8e89d
4
+ data.tar.gz: efe1a18d46c7d2205aa2ed5effb8a9af004539cd
5
5
  SHA512:
6
- metadata.gz: c7c13fa82e5849b8164c62a15027ad3d0dd26c35356a4bbbfa4992b58d01a777bfa974c6c497d61b3f3d4b02c998ad4c7b1096472a4cd68d31650c6b02e5cb16
7
- data.tar.gz: f827d8925363e06b830cf427e2b30fb05eafa540d482cc3a3135f149043094d1e2b194c359a5cf83ab893d680550448f31afcbd43a5686b2622b6283d8fb5915
6
+ metadata.gz: 155cb8dba85a0b4ef221274950c36a2eafebd5353ec7dd32e01deb228c3b3f5801bcba6f6e23e0356bb951596b788e2967cfa8b081963dee9660c662142f61c1
7
+ data.tar.gz: 8ae2dfcb65d580f13f75559dda231c94dc59ef9129fd383f6af07c363972f2bef0f1137a4bdefd4952e947ebf81ceec23f083061fcf3c8b142a7aece99142742
@@ -1,3 +1,3 @@
1
1
  module PushrGcm
2
- VERSION = '1.0.0.pre.3'
2
+ VERSION = '1.0.0.pre.4'
3
3
  end
@@ -1,17 +1,26 @@
1
1
  module Pushr
2
2
  module Daemon
3
3
  class Gcm
4
- attr_accessor :configuration
4
+ attr_accessor :configuration, :handlers
5
+
5
6
  def initialize(options)
6
- self.configuration = options
7
+ @configuration = options
8
+ @handlers = []
7
9
  end
8
10
 
9
- def connectiontype
10
- GcmSupport::ConnectionGcm
11
+ def start
12
+ configuration.connections.times do |i|
13
+ connection = GcmSupport::ConnectionGcm.new(configuration, i + 1)
14
+ connection.connect
15
+
16
+ handler = MessageHandler.new("pushr:#{configuration.app}:#{configuration.name}", connection, configuration.app, i + 1)
17
+ handler.start
18
+ @handlers << handler
19
+ end
11
20
  end
12
21
 
13
22
  def stop
14
- true
23
+ @handlers.map(&:stop)
15
24
  end
16
25
  end
17
26
  end
@@ -7,8 +7,6 @@ describe Pushr::Daemon::Gcm do
7
7
 
8
8
  describe 'responds to' do
9
9
  it 'configuration' do
10
- expect(gcm.connectiontype).to eql(Pushr::Daemon::GcmSupport::ConnectionGcm)
11
- expect(gcm.stop).to eql(true)
12
10
  expect(gcm.configuration).to eql(test: 'test')
13
11
  end
14
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushr-gcm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.3
4
+ version: 1.0.0.pre.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Pesman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-19 00:00:00.000000000 Z
11
+ date: 2014-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json