firering 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -80,7 +80,9 @@ For more details take a look at spec/fixtures/load_server.rb file.
80
80
 
81
81
  == Contributors
82
82
 
83
- * indirect (Andre Arko), https://github.com/EmmanuelOga/firering/pull/1 and https://github.com/EmmanuelOga/firering/pull/2/files
83
+ * indirect (Andre Arko), https://github.com/EmmanuelOga/firering/pull/1 ,
84
+ https://github.com/EmmanuelOga/firering/pull/2 ,
85
+ https://github.com/EmmanuelOga/firering/pull/3
84
86
 
85
87
  == Copyright
86
88
 
data/firering.gemspec CHANGED
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
4
4
  s.rubygems_version = '1.3.5'
5
5
 
6
6
  s.name = 'firering'
7
- s.version = '1.0.5'
8
- s.date = '2011-02-25'
7
+ s.version = '1.0.6'
8
+ s.date = '2011-03-01'
9
9
  s.rubyforge_project = 'firering'
10
10
 
11
11
  s.summary = "Campfire API interface powered by eventmachine em-http-request and yajl-ruby."
@@ -107,6 +107,16 @@ module Firering
107
107
  # disruptions. Upon unexpected disconnection, API clients should wait for a
108
108
  # few seconds before trying to reconnect.
109
109
  http.errback do
110
+ logger.error("http error #{http.error}. Trying again in #{retry_delay} seconds...")
111
+ perform_retry(http) do
112
+ room.stream(&callback)
113
+ end
114
+ end
115
+
116
+ # Campfire will _also_ actively close the connection. Correctly. Presumably,
117
+ # this only happens when they deploy, but it does actually happen.
118
+ http.callback do
119
+ logger.error("http connection closed. Trying again in #{retry_delay} seconds...")
110
120
  perform_retry(http) do
111
121
  room.stream(&callback)
112
122
  end
@@ -126,8 +136,6 @@ module Firering
126
136
  logger.error("Firering performed #{performed_retries} but did not get any answer. Increase Firering::Connection.max_retries or check your internet connection.")
127
137
  raise Firering::Connection::HTTPError.new(http)
128
138
  else
129
- logger.error("http error #{http.error}. Trying again in #{retry_delay} seconds...")
130
-
131
139
  EventMachine::add_timer(retry_delay) do
132
140
  logger.info("Reconnecting...")
133
141
  increase_retries_counter
data/lib/firering.rb CHANGED
@@ -5,7 +5,7 @@ require 'yajl'
5
5
  require 'em-http'
6
6
 
7
7
  module Firering
8
- VERSION = '1.0.5'
8
+ VERSION = '1.0.6'
9
9
 
10
10
  Error = Class.new(StandardError)
11
11
 
@@ -41,7 +41,7 @@ describe Firering::Connection do
41
41
  end
42
42
 
43
43
  it "raises an exception if the connection drops and performed enough retries" do
44
- conn.retry_delay = 1
44
+ conn.retry_delay = 0
45
45
  make_fixture_server_fail_times(conn.max_retries + 1)
46
46
  messages = []
47
47
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firering
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 5
10
- version: 1.0.5
9
+ - 6
10
+ version: 1.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Emmanuel Oga
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-25 00:00:00 -03:00
18
+ date: 2011-03-01 00:00:00 -03:00
19
19
  default_executable: campf-notify
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency