despamilator 2.1.2 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/despamilator/filter/no_vowels.rb +24 -0
- data/lib/despamilator/version.rb +1 -1
- metadata +5 -4
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'despamilator/filter'
|
2
|
+
|
3
|
+
module DespamilatorFilter
|
4
|
+
|
5
|
+
class NoVowels < Despamilator::Filter
|
6
|
+
|
7
|
+
NO_VOWELS_REGEX = /^[b-df-hj-np-tv-xzB-DF-HJ-NP-TV-XZ]+$/
|
8
|
+
|
9
|
+
def name
|
10
|
+
'No Vowels'
|
11
|
+
end
|
12
|
+
|
13
|
+
def description
|
14
|
+
'Detects things that are all letters but no vowels and separated by spaces'
|
15
|
+
end
|
16
|
+
|
17
|
+
def parse(subject)
|
18
|
+
words = subject.text.split(/\s+/).select{|str| str.match(NO_VOWELS_REGEX)}
|
19
|
+
unless words.empty?
|
20
|
+
subject.register_match!({:score => ((words.length ** 2).to_f / 100) , :filter => self})
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/despamilator/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: despamilator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-11-30 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: domainatrix
|
16
|
-
requirement: &
|
16
|
+
requirement: &70293214287340 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70293214287340
|
25
25
|
description: ! 'Despamilator is a plugin based spam detector designed for use on your
|
26
26
|
web forms borne out of two annoyances: Spam being submitted in my web forms and
|
27
27
|
CAPTCHAS being intrusive. Despamilator will apply some commonly used heuristics
|
@@ -39,6 +39,7 @@ files:
|
|
39
39
|
- lib/despamilator/filter/long_words.rb
|
40
40
|
- lib/despamilator/filter/mixed_case.rb
|
41
41
|
- lib/despamilator/filter/naughty_words.rb
|
42
|
+
- lib/despamilator/filter/no_vowels.rb
|
42
43
|
- lib/despamilator/filter/numbers_and_words.rb
|
43
44
|
- lib/despamilator/filter/obfuscated_urls.rb
|
44
45
|
- lib/despamilator/filter/prices.rb
|