spam_email 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -3
- data/Rakefile +9 -0
- data/data/provider_list.txt +858 -0
- data/lib/spam_email/blacklist.rb +558 -0
- data/lib/spam_email/list_compiler.rb +36 -0
- data/lib/spam_email/version.rb +1 -1
- data/lib/spam_email.rb +10 -6
- data/spam_email.gemspec +1 -0
- data/spec/spam_email_validator_spec.rb +22 -12
- metadata +31 -15
- data/lib/spam_email/domains.rb +0 -775
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 577da8114f1ffb9ace8045cf16db492156415c27
|
4
|
+
data.tar.gz: 72417ef2f5f5df8e3d32f6d6a52533963ba9f237
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: def45d8cee3201f3d705a190b83f8ec74acf4c436f6472110cd63b8208a4b246104ed9bc57a12fb0d82c2d93c0fc3bb4acdb9ee996379385746af1b8a9d62866
|
7
|
+
data.tar.gz: 0e8e78abbaa3cca446a997bf4c6b1cf8693af06156b824a86d7959d7540163e2deb31dc38fded38e38c3e657882fd4484e08852a0f586282e4ecb9c32a675325
|
data/README.md
CHANGED
@@ -24,15 +24,20 @@ Or install it yourself as:
|
|
24
24
|
Validation will pass with empty string/`nil` value! Checking the input with
|
25
25
|
`valid_email` or at least checking `presence: true` is strongly recommendend!**
|
26
26
|
|
27
|
-
|
27
|
+
```
|
28
|
+
class User < ActiveRecord::Base
|
28
29
|
validates :email, presence: true, spam_email: true
|
29
30
|
end
|
30
|
-
|
31
|
+
```
|
31
32
|
|
32
33
|
or specify a custom message with (the gem comes with en/de/fr locales):
|
33
34
|
|
34
35
|
`validates :email, presence: true, spam_email: { message: "is a blacklisted provider!" }`
|
35
36
|
|
37
|
+
If you want to add/remove providers you can use an initializer and modify `SpamEmail::Blacklist`.
|
38
|
+
To disable a provider just set the hash value for the domain to false.
|
39
|
+
You can add new domainsby modifing the hash.
|
40
|
+
|
36
41
|
## Contributing
|
37
42
|
|
38
43
|
1. Fork it
|
@@ -44,4 +49,4 @@ or specify a custom message with (the gem comes with en/de/fr locales):
|
|
44
49
|
## Thanks
|
45
50
|
|
46
51
|
Thanks go to Chris Birner (cbhp@lima-city.de) for the (inital) blacklist and
|
47
|
-
to https://github.com/hallelujah/valid_email for inspiration.
|
52
|
+
to https://github.com/hallelujah/valid_email for inspiration.
|
data/Rakefile
CHANGED
@@ -1,9 +1,18 @@
|
|
1
|
+
require 'bundler'
|
1
2
|
require "bundler/gem_tasks"
|
3
|
+
require 'rspec/core/rake_task'
|
4
|
+
require 'spam_email/list_compiler'
|
2
5
|
|
3
6
|
desc "Run specs"
|
4
7
|
RSpec::Core::RakeTask.new do |t|
|
5
8
|
t.pattern = 'spec/**/*_spec.rb'
|
6
9
|
end
|
7
10
|
|
11
|
+
desc "Compile provider list"
|
12
|
+
task :compile do |t|
|
13
|
+
SpamEmail::ListCompiler.compile_list
|
14
|
+
end
|
15
|
+
|
16
|
+
|
8
17
|
task :default => [:spec]
|
9
18
|
task :build => [:spec]
|