bradleypriest-mollom 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bradleypriest-mollom.gemspec +46 -0
- data/lib/mollom.rb +5 -2
- metadata +6 -8
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.4
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{bradleypriest-mollom}
|
8
|
+
s.version = "0.2.4"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = [%q{Jan De Poorter}]
|
12
|
+
s.date = %q{2011-07-15}
|
13
|
+
s.description = %q{Ruby class for easy interfacing with the mollom.com open API for spam detection and content quality assesment.}
|
14
|
+
s.email = %q{mollom@openminds.be}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"README.rdoc"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
"MIT-LICENSE",
|
20
|
+
"README.rdoc",
|
21
|
+
"Rakefile",
|
22
|
+
"VERSION",
|
23
|
+
"bradleypriest-mollom.gemspec",
|
24
|
+
"lib/mollom.rb",
|
25
|
+
"lib/mollom/api_compatibility.rb",
|
26
|
+
"lib/mollom/content_response.rb",
|
27
|
+
"mollom.gemspec",
|
28
|
+
"pkg/mollom-0.1.1.gem",
|
29
|
+
"test/content_response_test.rb",
|
30
|
+
"test/mollom_test.rb"
|
31
|
+
]
|
32
|
+
s.homepage = %q{http://mollom.rubyforge.com}
|
33
|
+
s.require_paths = [%q{lib}]
|
34
|
+
s.rubygems_version = %q{1.8.5}
|
35
|
+
s.summary = %q{Ruby class for easy interfacing with the mollom.com open API for spam detection and content quality assesment.}
|
36
|
+
|
37
|
+
if s.respond_to? :specification_version then
|
38
|
+
s.specification_version = 3
|
39
|
+
|
40
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
41
|
+
else
|
42
|
+
end
|
43
|
+
else
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
data/lib/mollom.rb
CHANGED
@@ -168,12 +168,14 @@ class Mollom
|
|
168
168
|
end
|
169
169
|
|
170
170
|
def send_command(command, data = {})
|
171
|
+
last_error = nil
|
171
172
|
server_list.each do |server|
|
172
173
|
begin
|
173
174
|
client = XMLRPC::Client.new(server[:host], "/#{API_VERSION}")
|
174
175
|
return client.call(command, data.merge(authentication_hash))
|
175
176
|
# TODO: Rescue more stuff (Connection Timeout and such)
|
176
|
-
rescue RuntimeError
|
177
|
+
rescue RuntimeError => e
|
178
|
+
last_error = e
|
177
179
|
next
|
178
180
|
rescue XMLRPC::FaultException => error
|
179
181
|
case error.faultCode
|
@@ -185,11 +187,12 @@ class Mollom
|
|
185
187
|
when Errors::TooBusy # Server is too busy, take the next one
|
186
188
|
next
|
187
189
|
else
|
190
|
+
last_error = error
|
188
191
|
next
|
189
192
|
end
|
190
193
|
end
|
191
194
|
end
|
192
|
-
raise Mollom::NoAvailableServers
|
195
|
+
raise last_error || Mollom::NoAvailableServers
|
193
196
|
rescue XMLRPC::FaultException
|
194
197
|
# We know it is Errors::Refresh
|
195
198
|
server_list(true)
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: bradleypriest-mollom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jan De Poorter
|
@@ -10,8 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
14
|
-
default_executable:
|
13
|
+
date: 2011-07-15 00:00:00 Z
|
15
14
|
dependencies: []
|
16
15
|
|
17
16
|
description: Ruby class for easy interfacing with the mollom.com open API for spam detection and content quality assesment.
|
@@ -27,6 +26,7 @@ files:
|
|
27
26
|
- README.rdoc
|
28
27
|
- Rakefile
|
29
28
|
- VERSION
|
29
|
+
- bradleypriest-mollom.gemspec
|
30
30
|
- lib/mollom.rb
|
31
31
|
- lib/mollom/api_compatibility.rb
|
32
32
|
- lib/mollom/content_response.rb
|
@@ -34,7 +34,6 @@ files:
|
|
34
34
|
- pkg/mollom-0.1.1.gem
|
35
35
|
- test/content_response_test.rb
|
36
36
|
- test/mollom_test.rb
|
37
|
-
has_rdoc: true
|
38
37
|
homepage: http://mollom.rubyforge.com
|
39
38
|
licenses: []
|
40
39
|
|
@@ -58,10 +57,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
57
|
requirements: []
|
59
58
|
|
60
59
|
rubyforge_project:
|
61
|
-
rubygems_version: 1.5
|
60
|
+
rubygems_version: 1.8.5
|
62
61
|
signing_key:
|
63
62
|
specification_version: 3
|
64
63
|
summary: Ruby class for easy interfacing with the mollom.com open API for spam detection and content quality assesment.
|
65
|
-
test_files:
|
66
|
-
|
67
|
-
- test/mollom_test.rb
|
64
|
+
test_files: []
|
65
|
+
|