apnd 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -62,6 +62,7 @@ module APND
62
62
  rescue Errno::EPIPE, OpenSSL::SSL::SSLError
63
63
  ohai "Error, notification has been added back to the queue"
64
64
  @queue.push(notification)
65
+ @apple.reconnect!
65
66
  rescue RuntimeError => error
66
67
  ohai "Error: #{error}"
67
68
  end
@@ -53,6 +53,13 @@ module APND
53
53
  @sock = nil
54
54
  end
55
55
 
56
+ #
57
+ # Disconnect/connect to Apple
58
+ #
59
+ def reconnect!
60
+ disconnect! && connect!
61
+ end
62
+
56
63
  #
57
64
  # Establishes a connection if needed and yields it
58
65
  #
@@ -54,7 +54,7 @@ module APND
54
54
  # Creates a new socket to upstream_host:upstream_port
55
55
  #
56
56
  def self.upstream_socket
57
- @socket ||= TCPSocket.new(upstream_host, upstream_port)
57
+ @socket = TCPSocket.new(upstream_host, upstream_port)
58
58
  end
59
59
 
60
60
  #
@@ -2,7 +2,7 @@ module APND
2
2
  class Version #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  def self.to_s
8
8
  [MAJOR, MINOR, TINY].join('.')
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Joshua Priddle
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-02 00:00:00 -04:00
17
+ date: 2010-10-05 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency