racoon 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/racoon.rb +1 -1
  2. data/lib/racoon/firehose.rb +4 -3
  3. metadata +9 -9
@@ -8,5 +8,5 @@ require 'racoon/worker'
8
8
  require 'racoon/firehose'
9
9
 
10
10
  module Racoon
11
- VERSION = "1.0.0"
11
+ VERSION = "1.0.1"
12
12
  end
@@ -10,13 +10,14 @@ require 'yaml'
10
10
 
11
11
  module Racoon
12
12
  class Firehose
13
- attr_accessor :connections, :feedback_callback
13
+ attr_accessor :connections, :feedback_callback, :error_callback
14
14
 
15
15
  def initialize(reactor, address = ZM::Address.new('*', 11555, :tcp), &feedback_callback)
16
16
  @connections = {}
17
17
  @reactor = reactor
18
18
  @address = address
19
19
  @feedback_callback = feedback_callback
20
+ @error_callback = nil
20
21
  end
21
22
 
22
23
  def on_attach(socket)
@@ -32,7 +33,7 @@ module Racoon
32
33
 
33
34
  private
34
35
 
35
- def apns(project, bytes, retries=2, &error_callback)
36
+ def apns(project, bytes, retries=2)
36
37
  uri = "gateway.#{project[:sandbox] ? 'sandbox.' : ''}push.apple.com"
37
38
  hash = Digest::SHA1.hexdigest("#{project[:name]}-#{project[:certificate]}")
38
39
 
@@ -44,7 +45,7 @@ module Racoon
44
45
 
45
46
  connection.connect! unless connection.connected?
46
47
  connection.write(bytes)
47
- connection.read.each(&error_callback) unless error_callback.nil?
48
+ connection.read.each(&@error_callback) if @error_callback
48
49
  rescue Errno::EPIPE, OpenSSL::SSL::SSLError, Errno::ECONNRESET
49
50
  connection.disconnect!
50
51
  retry if (retries -= 1) > 0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: racoon
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: yajl-ruby
17
- requirement: &70296020668120 !ruby/object:Gem::Requirement
17
+ requirement: &70143217232660 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 0.7.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70296020668120
25
+ version_requirements: *70143217232660
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: beanstalk-client
28
- requirement: &70296020667620 !ruby/object:Gem::Requirement
28
+ requirement: &70143217232100 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 1.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70296020667620
36
+ version_requirements: *70143217232100
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: ffi-rzmq
39
- requirement: &70296020667140 !ruby/object:Gem::Requirement
39
+ requirement: &70143217231580 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 0.8.0
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *70296020667140
47
+ version_requirements: *70143217231580
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: bundler
50
- requirement: &70296020666680 !ruby/object:Gem::Requirement
50
+ requirement: &70143217231100 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -55,7 +55,7 @@ dependencies:
55
55
  version: 1.0.0
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *70296020666680
58
+ version_requirements: *70143217231100
59
59
  description: A distributed Apple Push Notification Service (APNs) provider developed
60
60
  for hosting multiple projects.
61
61
  email: jeremy.tregunna@me.com