defender 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/defender/document.rb +10 -0
- data/lib/defender/version.rb +1 -1
- metadata +3 -3
data/lib/defender/document.rb
CHANGED
@@ -33,6 +33,14 @@ module Defender
|
|
33
33
|
# @return [String]
|
34
34
|
attr_reader :signature
|
35
35
|
|
36
|
+
##
|
37
|
+
# A float denoting how spammy a document is.
|
38
|
+
#
|
39
|
+
# This could be useful for sorting document in an admin interface.
|
40
|
+
#
|
41
|
+
# @return[Float<0.0,1.0>]
|
42
|
+
attr_reader :spaminess
|
43
|
+
|
36
44
|
##
|
37
45
|
# Retrieves the status of a document back from Defensio.
|
38
46
|
#
|
@@ -49,6 +57,7 @@ module Defender
|
|
49
57
|
document.instance_variable_set(:@saved, true)
|
50
58
|
document.instance_variable_set(:@allow, ret.last['allow'])
|
51
59
|
document.instance_variable_set(:@signature, signature)
|
60
|
+
document.instance_variable_set(:@spaminess, ret.last['spaminess'])
|
52
61
|
|
53
62
|
document
|
54
63
|
else
|
@@ -91,6 +100,7 @@ module Defender
|
|
91
100
|
data = ret.last
|
92
101
|
@allow = data['allow']
|
93
102
|
@signature = data['signature']
|
103
|
+
@spaminess = data['spaminess']
|
94
104
|
|
95
105
|
@saved = true # This will also return true, since nothing failed as we got here
|
96
106
|
end
|
data/lib/defender/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 2
|
9
|
+
version: 1.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Henrik Hodne
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-25 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|