em_apn_manager 0.1.4 → 0.1.5
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/VERSION +1 -1
- data/em_apn_manager.gemspec +1 -1
- data/lib/em_apn_manager/client.rb +2 -2
- data/lib/em_apn_manager/connection.rb +1 -2
- data/lib/em_apn_manager/manager.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4957b75a273ab6103fc63b403b37cb9ed3bdfee8
|
4
|
+
data.tar.gz: bc257de6a6859ac694d676735d15308bd414a336
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1ee1b4368fb081e23964fba9c05a566b67e9b9158e87386fd76e9c97538cf8c081f5f54eb9af8cd8d5352fedaeb1b0b08815bcc417f5f68fbe2ec60d5395a72
|
7
|
+
data.tar.gz: f5b939984b671706f8fc85b3dfabc9776af33ec7c5b4b30e70b02f3c4b4f8b2c8d50c7fdf56756753c87fd4d75fd331a5e2750db76a95a1604777fce86221053
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
data/em_apn_manager.gemspec
CHANGED
@@ -10,7 +10,7 @@ module EventMachine
|
|
10
10
|
TEST_GATEWAY = "127.0.0.1"
|
11
11
|
PORT = 2195
|
12
12
|
|
13
|
-
attr_reader :gateway, :port, :cert, :connection, :error_callback, :close_callback, :open_callback
|
13
|
+
attr_reader :gateway, :port, :cert, :connection, :error_callback, :close_callback, :open_callback, :environment
|
14
14
|
|
15
15
|
# A convenience method for creating and connecting.
|
16
16
|
def self.connect(options = {})
|
@@ -22,7 +22,7 @@ module EventMachine
|
|
22
22
|
def initialize(options = {})
|
23
23
|
@cert = options[:cert]
|
24
24
|
@port = options[:port] || PORT
|
25
|
-
@environment = options[:env]
|
25
|
+
@environment = options[:env] || "development"
|
26
26
|
@gateway = options[:gateway]
|
27
27
|
@gateway ||= case @environment
|
28
28
|
when "test"
|
@@ -18,8 +18,7 @@ module EventMachine
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def post_init
|
21
|
-
EM::ApnManager.logger.info("Connecting...")
|
22
|
-
|
21
|
+
EM::ApnManager.logger.info("Connecting... #{client.gateway} for #{client.environment}")
|
23
22
|
start_tls(
|
24
23
|
:private_key_file => client.cert,
|
25
24
|
:cert_chain_file => client.cert,
|
@@ -34,7 +34,8 @@ module EventMachine
|
|
34
34
|
|
35
35
|
### Create client connection if doesn't exist in pool.
|
36
36
|
if client.nil?
|
37
|
-
|
37
|
+
opts = {:env => msg_hash["env"], :cert => cert_filename}
|
38
|
+
client = EM::ApnManager::Client.new(options.merge(opts))
|
38
39
|
# Store the connection to pool
|
39
40
|
$connection_pool[cert_filename] = client
|
40
41
|
end
|