em_apn_manager 0.1.4 → 0.1.5

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
  SHA1:
3
- metadata.gz: b8f217f2b3bf59e177774a969b44ea0be246200a
4
- data.tar.gz: 5b00c33b1c2ef03bb00ed59f02adf30401b96eef
3
+ metadata.gz: 4957b75a273ab6103fc63b403b37cb9ed3bdfee8
4
+ data.tar.gz: bc257de6a6859ac694d676735d15308bd414a336
5
5
  SHA512:
6
- metadata.gz: 7122330e3bbf01c8099e653be545a3dbda6bd9925ef116017ecaeb355332121c3c737d46cd8e11907b1f00a2f580c72164b9dea9819cf096bc203a5bc8512b8c
7
- data.tar.gz: 6257993ed048113299a73715ff44ba4fe9aef074396c1de70d18a8d6e84f259aba185847139e7ceb3a4dd141c4c780543186da905341c07820aa2a8cf1b6ac33
6
+ metadata.gz: a1ee1b4368fb081e23964fba9c05a566b67e9b9158e87386fd76e9c97538cf8c081f5f54eb9af8cd8d5352fedaeb1b0b08815bcc417f5f68fbe2ec60d5395a72
7
+ data.tar.gz: f5b939984b671706f8fc85b3dfabc9776af33ec7c5b4b30e70b02f3c4b4f8b2c8d50c7fdf56756753c87fd4d75fd331a5e2750db76a95a1604777fce86221053
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "em_apn_manager"
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael He"]
@@ -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
- client = EM::ApnManager::Client.new({env: msg_hash["env"], cert: cert_filename}.merge! options)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: em_apn_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael He