mollom 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/mollom.rb +8 -5
- data/test/mollom_test.rb +1 -1
- metadata +2 -2
data/lib/mollom.rb
CHANGED
@@ -137,6 +137,9 @@ class Mollom
|
|
137
137
|
raise(Error.new("Can't get mollom server-list"))
|
138
138
|
end
|
139
139
|
|
140
|
+
# Sets the server list used to contact Mollom. This should be used to set the list of cached servers.
|
141
|
+
#
|
142
|
+
# If you try to set a faulty server list, the function will silently fail, so we can get the server-list from Mollom.
|
140
143
|
def server_list=(list)
|
141
144
|
# Check if we get an actual serverlist-array
|
142
145
|
if list.is_a?(Array) && list.all? {|hash| hash.has_key?(:host) && hash.has_key?(:proto) }
|
@@ -230,14 +233,14 @@ class Mollom
|
|
230
233
|
# Returns 'unknown', 'ham', 'unsure' or 'spam', depending on what the content is.
|
231
234
|
def to_s
|
232
235
|
case @spam_response
|
233
|
-
when Unknown
|
234
|
-
when Ham
|
235
|
-
when Unsure
|
236
|
-
when Spam
|
236
|
+
when Unknown then 'unknown'
|
237
|
+
when Ham then 'ham'
|
238
|
+
when Unsure then 'unsure'
|
239
|
+
when Spam then 'spam'
|
237
240
|
end
|
238
241
|
end
|
239
242
|
end
|
240
243
|
|
241
244
|
class Error < StandardError; end
|
242
245
|
class NoAvailableServers < Error; end
|
243
|
-
end
|
246
|
+
end
|
data/test/mollom_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mollom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan De Poorter
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-11-17 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|