firering 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -0
- data/firering.gemspec +2 -2
- data/lib/firering/connection.rb +3 -3
- data/lib/firering.rb +1 -1
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -11,6 +11,7 @@ Campfire API interface powered by eventmachine, em-http-request and yajl-ruby.
|
|
11
11
|
conn = Firering::Connection.new("http://#{subdomain}.campfirenow.com") do |c|
|
12
12
|
c.login = login
|
13
13
|
c.password = password
|
14
|
+
c.max_retries = 10 # default to -1, which means perform connection retries on drop forever.
|
14
15
|
end
|
15
16
|
|
16
17
|
EM.run do
|
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.
|
8
|
-
s.date = '2011-03-
|
7
|
+
s.version = '1.0.7'
|
8
|
+
s.date = '2011-03-03'
|
9
9
|
s.rubyforge_project = 'firering'
|
10
10
|
|
11
11
|
s.summary = "Campfire API interface powered by eventmachine em-http-request and yajl-ruby."
|
data/lib/firering/connection.rb
CHANGED
@@ -15,7 +15,7 @@ module Firering
|
|
15
15
|
attr_reader :performed_retries
|
16
16
|
|
17
17
|
def initialize(host, streaming_host = "https://streaming.campfirenow.com")
|
18
|
-
@retry_delay, @redirects, @max_retries, @performed_retries = 2, 1,
|
18
|
+
@retry_delay, @redirects, @max_retries, @performed_retries = 2, 1, -1, 0
|
19
19
|
self.host, self.streaming_host = host, streaming_host
|
20
20
|
yield self if block_given?
|
21
21
|
end
|
@@ -126,14 +126,14 @@ module Firering
|
|
126
126
|
end
|
127
127
|
|
128
128
|
def max_retries_reached?
|
129
|
-
@performed_retries && @performed_retries >= @max_retries
|
129
|
+
@performed_retries && @max_retries > 0 && @performed_retries >= @max_retries
|
130
130
|
end
|
131
131
|
|
132
132
|
def perform_retry(http, &callback)
|
133
133
|
if EventMachine.reactor_running?
|
134
134
|
|
135
135
|
if max_retries_reached?
|
136
|
-
logger.error("Firering performed #{performed_retries} but did not get any answer. Increase Firering::Connection.max_retries or check your internet connection.")
|
136
|
+
logger.error("Firering performed #{performed_retries} but did not get any answer. Increase Firering::Connection.max_retries (< 0 means retry forever) or check your internet connection.")
|
137
137
|
raise Firering::Connection::HTTPError.new(http)
|
138
138
|
else
|
139
139
|
EventMachine::add_timer(retry_delay) do
|
data/lib/firering.rb
CHANGED
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:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 7
|
10
|
+
version: 1.0.7
|
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-03-
|
18
|
+
date: 2011-03-03 00:00:00 -03:00
|
19
19
|
default_executable: campf-notify
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|