fake_email_validator 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +25 -0
- data/Rakefile +8 -0
- data/config/fake_domains.list +512 -0
- data/config/locales/en.yml +6 -0
- data/fake_email_validator.gemspec +26 -0
- data/lib/fake_email_validator.rb +30 -0
- data/test/minitest_helper.rb +6 -0
- data/test/test_fake_email_validator.rb +37 -0
- metadata +152 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 91aa0cb3a29078d9e6ec8a95dfa99e1ec17601e3
|
4
|
+
data.tar.gz: 6b34b44bb0f66e9822f429507ecc88005ebef13a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fc819f07c9dd47d72441dc9983ca2311b84cf5ae2049ffed88ee90c6e67ece3144734b9eb36f09a889b4e8449997cc55ab7f7a8dc2dfe59292f0771afe09c80f
|
7
|
+
data.tar.gz: f8e02a197ac1819caafc929d3aff70c95cc4317536aec058539ddedb9b797e15e57a6ba5d47464cbd23845ec51d2a11c3c67533b531146fadfbdc52c6374b8c8
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Maxim Dobryakov
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# fake_email_validator
|
2
|
+
|
3
|
+
E-Mail validator for Rails to block services like mailinator.com
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'fake_email_validator'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install fake_email_validator
|
18
|
+
|
19
|
+
## Contributing
|
20
|
+
|
21
|
+
1. Fork it ( http://github.com/maxd/fake_email_validator/fork )
|
22
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
23
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
24
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
25
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,512 @@
|
|
1
|
+
0-mail.com
|
2
|
+
0815.ru
|
3
|
+
0clickemail.com
|
4
|
+
0wnd.net
|
5
|
+
0wnd.org
|
6
|
+
10minutemail.com
|
7
|
+
20minutemail.com
|
8
|
+
2prong.com
|
9
|
+
30minutemail.com
|
10
|
+
33mail.com
|
11
|
+
3d-painting.com
|
12
|
+
4warding.com
|
13
|
+
4warding.net
|
14
|
+
4warding.org
|
15
|
+
60minutemail.com
|
16
|
+
675hosting.com
|
17
|
+
675hosting.net
|
18
|
+
675hosting.org
|
19
|
+
6url.com
|
20
|
+
75hosting.com
|
21
|
+
75hosting.net
|
22
|
+
75hosting.org
|
23
|
+
7tags.com
|
24
|
+
9ox.net
|
25
|
+
a-bc.net
|
26
|
+
afrobacon.com
|
27
|
+
ajaxapp.net
|
28
|
+
amilegit.com
|
29
|
+
amiri.net
|
30
|
+
amiriindustries.com
|
31
|
+
anonbox.net
|
32
|
+
anonymbox.com
|
33
|
+
antichef.com
|
34
|
+
antichef.net
|
35
|
+
antispam.de
|
36
|
+
armyspy.com
|
37
|
+
azmeil.tk
|
38
|
+
baxomale.ht.cx
|
39
|
+
beefmilk.com
|
40
|
+
binkmail.com
|
41
|
+
bio-muesli.net
|
42
|
+
bobmail.info
|
43
|
+
bodhi.lawlita.com
|
44
|
+
bofthew.com
|
45
|
+
brefmail.com
|
46
|
+
broadbandninja.com
|
47
|
+
bsnow.net
|
48
|
+
bugmenot.com
|
49
|
+
bumpymail.com
|
50
|
+
casualdx.com
|
51
|
+
centermail.com
|
52
|
+
centermail.net
|
53
|
+
chammy.info
|
54
|
+
chogmail.com
|
55
|
+
choicemail1.com
|
56
|
+
cool.fr.nf
|
57
|
+
correo.blogos.net
|
58
|
+
cosmorph.com
|
59
|
+
courriel.fr.nf
|
60
|
+
courrieltemporaire.com
|
61
|
+
cubiclink.com
|
62
|
+
curryworld.de
|
63
|
+
cust.in
|
64
|
+
cuvox.de
|
65
|
+
dacoolest.com
|
66
|
+
dandikmail.com
|
67
|
+
dayrep.com
|
68
|
+
deadaddress.com
|
69
|
+
deadspam.com
|
70
|
+
despam.it
|
71
|
+
despammed.com
|
72
|
+
devnullmail.com
|
73
|
+
dfgh.net
|
74
|
+
digitalsanctuary.com
|
75
|
+
discardmail.com
|
76
|
+
discardmail.de
|
77
|
+
disposableaddress.com
|
78
|
+
disposableemailaddresses:emailmiser.com
|
79
|
+
disposeamail.com
|
80
|
+
disposemail.com
|
81
|
+
dispostable.com
|
82
|
+
dm.w3internet.co.ukexample.com
|
83
|
+
dodgeit.com
|
84
|
+
dodgit.com
|
85
|
+
dodgit.org
|
86
|
+
donemail.ru
|
87
|
+
dontreg.com
|
88
|
+
dontsendmespam.de
|
89
|
+
drdrb.com
|
90
|
+
dropmail.me
|
91
|
+
dump-email.info
|
92
|
+
dumpandjunk.com
|
93
|
+
dumpmail.de
|
94
|
+
dumpyemail.com
|
95
|
+
e4ward.com
|
96
|
+
einrot.com
|
97
|
+
email60.com
|
98
|
+
emaildienst.de
|
99
|
+
emailias.com
|
100
|
+
emailigo.de
|
101
|
+
emailinfive.com
|
102
|
+
emailmiser.com
|
103
|
+
emailsensei.com
|
104
|
+
emailtemporario.com.br
|
105
|
+
emailto.de
|
106
|
+
emailwarden.com
|
107
|
+
emailx.at.hm
|
108
|
+
emailxfer.com
|
109
|
+
emeil.in
|
110
|
+
emeil.ir
|
111
|
+
emz.net
|
112
|
+
enterto.com
|
113
|
+
ephemail.net
|
114
|
+
etranquil.com
|
115
|
+
etranquil.net
|
116
|
+
etranquil.org
|
117
|
+
explodemail.com
|
118
|
+
fakeinbox.com
|
119
|
+
fakeinformation.com
|
120
|
+
fastacura.com
|
121
|
+
fastchevy.com
|
122
|
+
fastchrysler.com
|
123
|
+
fastkawasaki.com
|
124
|
+
fastmazda.com
|
125
|
+
fastmitsubishi.com
|
126
|
+
fastnissan.com
|
127
|
+
fastsubaru.com
|
128
|
+
fastsuzuki.com
|
129
|
+
fasttoyota.com
|
130
|
+
fastyamaha.com
|
131
|
+
filzmail.com
|
132
|
+
fizmail.com
|
133
|
+
fleckens.hu
|
134
|
+
fr33mail.info
|
135
|
+
frapmail.com
|
136
|
+
front14.org
|
137
|
+
fux0ringduh.com
|
138
|
+
garliclife.com
|
139
|
+
get1mail.com
|
140
|
+
get2mail.fr
|
141
|
+
getonemail.com
|
142
|
+
getonemail.net
|
143
|
+
ghosttexter.de
|
144
|
+
girlsundertheinfluence.com
|
145
|
+
gishpuppy.com
|
146
|
+
gowikibooks.com
|
147
|
+
gowikicampus.com
|
148
|
+
gowikicars.com
|
149
|
+
gowikifilms.com
|
150
|
+
gowikigames.com
|
151
|
+
gowikimusic.com
|
152
|
+
gowikinetwork.com
|
153
|
+
gowikitravel.com
|
154
|
+
gowikitv.com
|
155
|
+
great-host.in
|
156
|
+
greensloth.com
|
157
|
+
gsrv.co.uk
|
158
|
+
guerillamail.biz
|
159
|
+
guerillamail.com
|
160
|
+
guerillamail.net
|
161
|
+
guerillamail.org
|
162
|
+
guerrillamail.biz
|
163
|
+
guerrillamail.com
|
164
|
+
guerrillamail.de
|
165
|
+
guerrillamail.net
|
166
|
+
guerrillamail.org
|
167
|
+
guerrillamailblock.com
|
168
|
+
gustr.com
|
169
|
+
h.mintemail.com
|
170
|
+
h8s.org
|
171
|
+
haltospam.com
|
172
|
+
hatespam.org
|
173
|
+
hidemail.de
|
174
|
+
hochsitze.com
|
175
|
+
hotpop.com
|
176
|
+
hulapla.de
|
177
|
+
ieatspam.eu
|
178
|
+
ieatspam.info
|
179
|
+
ihateyoualot.info
|
180
|
+
iheartspam.org
|
181
|
+
imails.info
|
182
|
+
inbax.tk
|
183
|
+
inboxalias.com
|
184
|
+
inboxclean.com
|
185
|
+
inboxclean.org
|
186
|
+
incognitomail.com
|
187
|
+
incognitomail.net
|
188
|
+
incognitomail.org
|
189
|
+
insorg-mail.info
|
190
|
+
ipoo.org
|
191
|
+
irish2me.com
|
192
|
+
iwi.net
|
193
|
+
jetable.com
|
194
|
+
jetable.fr.nf
|
195
|
+
jetable.net
|
196
|
+
jetable.org
|
197
|
+
jnxjn.com
|
198
|
+
jourrapide.com
|
199
|
+
junk1e.com
|
200
|
+
kasmail.com
|
201
|
+
kaspop.com
|
202
|
+
keepmymail.com
|
203
|
+
killmail.com
|
204
|
+
killmail.net
|
205
|
+
kir.ch.tc
|
206
|
+
klassmaster.com
|
207
|
+
klassmaster.net
|
208
|
+
klzlk.com
|
209
|
+
koszmail.pl
|
210
|
+
kulturbetrieb.info
|
211
|
+
kurzepost.de
|
212
|
+
letthemeatspam.com
|
213
|
+
lhsdv.com
|
214
|
+
lifebyfood.com
|
215
|
+
link2mail.net
|
216
|
+
litedrop.com
|
217
|
+
lol.ovpn.to
|
218
|
+
lookugly.com
|
219
|
+
lopl.co.cc
|
220
|
+
lortemail.dk
|
221
|
+
lr78.com
|
222
|
+
m4ilweb.info
|
223
|
+
maboard.com
|
224
|
+
mail-temporaire.fr
|
225
|
+
mail.by
|
226
|
+
mail.mezimages.net
|
227
|
+
mail2rss.org
|
228
|
+
mail333.com
|
229
|
+
mail4trash.com
|
230
|
+
mailbidon.com
|
231
|
+
mailblocks.com
|
232
|
+
mailcatch.com
|
233
|
+
maildrop.cc
|
234
|
+
maileater.com
|
235
|
+
mailexpire.com
|
236
|
+
mailfa.tk
|
237
|
+
mailforspam.com
|
238
|
+
mailfreeonline.com
|
239
|
+
mailin8r.com
|
240
|
+
mailinater.com
|
241
|
+
mailinator.com
|
242
|
+
mailinator.net
|
243
|
+
mailinator2.com
|
244
|
+
mailincubator.com
|
245
|
+
mailismagic.com
|
246
|
+
mailme.ir
|
247
|
+
mailme.lv
|
248
|
+
mailmetrash.com
|
249
|
+
mailmoat.com
|
250
|
+
mailnator.com
|
251
|
+
mailnesia.com
|
252
|
+
mailnull.com
|
253
|
+
mailshell.com
|
254
|
+
mailsiphon.com
|
255
|
+
mailslite.com
|
256
|
+
mailtothis.com
|
257
|
+
mailzilla.com
|
258
|
+
mailzilla.org
|
259
|
+
mbx.cc
|
260
|
+
mega.zik.dj
|
261
|
+
meinspamschutz.de
|
262
|
+
meltmail.com
|
263
|
+
messagebeamer.de
|
264
|
+
mierdamail.com
|
265
|
+
mintemail.com
|
266
|
+
moburl.com
|
267
|
+
moncourrier.fr.nf
|
268
|
+
monemail.fr.nf
|
269
|
+
monmail.fr.nf
|
270
|
+
monumentmail.com
|
271
|
+
msa.minsmail.com
|
272
|
+
mt2009.com
|
273
|
+
mx0.wwwnew.eu
|
274
|
+
mycleaninbox.net
|
275
|
+
mypartyclip.de
|
276
|
+
myphantomemail.com
|
277
|
+
myspaceinc.com
|
278
|
+
myspaceinc.net
|
279
|
+
myspaceinc.org
|
280
|
+
myspacepimpedup.com
|
281
|
+
myspamless.com
|
282
|
+
mytrashmail.com
|
283
|
+
neomailbox.com
|
284
|
+
nepwk.com
|
285
|
+
nervmich.net
|
286
|
+
nervtmich.net
|
287
|
+
netmails.com
|
288
|
+
netmails.net
|
289
|
+
netzidiot.de
|
290
|
+
neverbox.com
|
291
|
+
no-spam.ws
|
292
|
+
nobulk.com
|
293
|
+
noclickemail.com
|
294
|
+
nogmailspam.info
|
295
|
+
nomail.xl.cx
|
296
|
+
nomail2me.com
|
297
|
+
nomorespamemails.com
|
298
|
+
nospam.ze.tc
|
299
|
+
nospam4.us
|
300
|
+
nospamfor.us
|
301
|
+
nospamthanks.info
|
302
|
+
notmailinator.com
|
303
|
+
nowmymail.com
|
304
|
+
nurfuerspam.de
|
305
|
+
nus.edu.sg
|
306
|
+
nwldx.com
|
307
|
+
objectmail.com
|
308
|
+
obobbo.com
|
309
|
+
oneoffemail.com
|
310
|
+
onewaymail.com
|
311
|
+
online.ms
|
312
|
+
oopi.org
|
313
|
+
ordinaryamerican.net
|
314
|
+
otherinbox.com
|
315
|
+
ourklips.com
|
316
|
+
outlawspam.com
|
317
|
+
ovpn.to
|
318
|
+
owlpic.com
|
319
|
+
pancakemail.com
|
320
|
+
pimpedupmyspace.com
|
321
|
+
pjjkp.com
|
322
|
+
politikerclub.de
|
323
|
+
poofy.org
|
324
|
+
pookmail.com
|
325
|
+
privacy.net
|
326
|
+
proxymail.eu
|
327
|
+
prtnx.com
|
328
|
+
punkass.com
|
329
|
+
putthisinyourspamdatabase.com
|
330
|
+
qq.com
|
331
|
+
quickinbox.com
|
332
|
+
rcpt.at
|
333
|
+
reallymymail.com
|
334
|
+
recode.me
|
335
|
+
recursor.net
|
336
|
+
regbypass.com
|
337
|
+
regbypass.comsafe-mail.net
|
338
|
+
rejectmail.com
|
339
|
+
rhyta.com
|
340
|
+
rklips.com
|
341
|
+
rmqkr.net
|
342
|
+
rppkn.com
|
343
|
+
rtrtr.com
|
344
|
+
s0ny.net
|
345
|
+
safe-mail.net
|
346
|
+
safersignup.de
|
347
|
+
safetymail.info
|
348
|
+
safetypost.de
|
349
|
+
sandelf.de
|
350
|
+
saynotospams.com
|
351
|
+
selfdestructingmail.com
|
352
|
+
sendspamhere.com
|
353
|
+
sharklasers.com
|
354
|
+
shiftmail.com
|
355
|
+
shitmail.me
|
356
|
+
shortmail.net
|
357
|
+
sibmail.com
|
358
|
+
skeefmail.com
|
359
|
+
slaskpost.se
|
360
|
+
slopsbox.com
|
361
|
+
smellfear.com
|
362
|
+
snakemail.com
|
363
|
+
sneakemail.com
|
364
|
+
sofimail.com
|
365
|
+
sofort-mail.de
|
366
|
+
sogetthis.com
|
367
|
+
soodonims.com
|
368
|
+
spam.la
|
369
|
+
spam.su
|
370
|
+
spam4.me
|
371
|
+
spamavert.com
|
372
|
+
spambob.com
|
373
|
+
spambob.net
|
374
|
+
spambob.org
|
375
|
+
spambog.com
|
376
|
+
spambog.de
|
377
|
+
spambog.ru
|
378
|
+
spambox.info
|
379
|
+
spambox.irishspringrealty.com
|
380
|
+
spambox.us
|
381
|
+
spamcannon.com
|
382
|
+
spamcannon.net
|
383
|
+
spamcero.com
|
384
|
+
spamcon.org
|
385
|
+
spamcorptastic.com
|
386
|
+
spamcowboy.com
|
387
|
+
spamcowboy.net
|
388
|
+
spamcowboy.org
|
389
|
+
spamday.com
|
390
|
+
spamex.com
|
391
|
+
spamfree24.com
|
392
|
+
spamfree24.de
|
393
|
+
spamfree24.eu
|
394
|
+
spamfree24.info
|
395
|
+
spamfree24.net
|
396
|
+
spamfree24.org
|
397
|
+
spamgoes.in
|
398
|
+
spamgourmet.com
|
399
|
+
spamgourmet.net
|
400
|
+
spamgourmet.org
|
401
|
+
spamherelots.com
|
402
|
+
spamhereplease.com
|
403
|
+
spamhole.com
|
404
|
+
spamify.com
|
405
|
+
spaminator.de
|
406
|
+
spamkill.info
|
407
|
+
spaml.com
|
408
|
+
spaml.de
|
409
|
+
spammotel.com
|
410
|
+
spamobox.com
|
411
|
+
spamoff.de
|
412
|
+
spamslicer.com
|
413
|
+
spamspot.com
|
414
|
+
spamthis.co.uk
|
415
|
+
spamthisplease.com
|
416
|
+
spamtrail.com
|
417
|
+
speed.1s.fr
|
418
|
+
supergreatmail.com
|
419
|
+
supermailer.jp
|
420
|
+
superrito.com
|
421
|
+
suremail.info
|
422
|
+
tagyourself.com
|
423
|
+
teewars.org
|
424
|
+
teleworm.com
|
425
|
+
teleworm.us
|
426
|
+
temp-mail.ru
|
427
|
+
tempalias.com
|
428
|
+
tempe-mail.com
|
429
|
+
tempemail.biz
|
430
|
+
tempemail.com
|
431
|
+
tempemail.net
|
432
|
+
tempinbox.co.uk
|
433
|
+
tempinbox.com
|
434
|
+
tempmail.it
|
435
|
+
tempmail2.com
|
436
|
+
tempomail.fr
|
437
|
+
temporarily.de
|
438
|
+
temporarioemail.com.br
|
439
|
+
temporaryemail.net
|
440
|
+
temporaryforwarding.com
|
441
|
+
temporaryinbox.com
|
442
|
+
thanksnospam.info
|
443
|
+
thankyou2010.com
|
444
|
+
thisisnotmyrealemail.com
|
445
|
+
thismail.ru
|
446
|
+
throwawayemailaddress.com
|
447
|
+
tilien.com
|
448
|
+
tmailinator.com
|
449
|
+
tradermail.info
|
450
|
+
trash-amil.com
|
451
|
+
trash-mail.at
|
452
|
+
trash-mail.com
|
453
|
+
trash-mail.de
|
454
|
+
trash2009.com
|
455
|
+
trashemail.de
|
456
|
+
trashmail.at
|
457
|
+
trashmail.com
|
458
|
+
trashmail.de
|
459
|
+
trashmail.me
|
460
|
+
trashmail.net
|
461
|
+
trashmail.org
|
462
|
+
trashmail.ws
|
463
|
+
trashmailer.com
|
464
|
+
trashymail.com
|
465
|
+
trashymail.net
|
466
|
+
trillianpro.com
|
467
|
+
turual.com
|
468
|
+
twinmail.de
|
469
|
+
tyldd.com
|
470
|
+
uggsrock.com
|
471
|
+
unmail.ru
|
472
|
+
upliftnow.com
|
473
|
+
uplipht.com
|
474
|
+
venompen.com
|
475
|
+
veryrealemail.com
|
476
|
+
viditag.com
|
477
|
+
viewcastmedia.com
|
478
|
+
viewcastmedia.net
|
479
|
+
viewcastmedia.org
|
480
|
+
webm4il.info
|
481
|
+
wegwerfadresse.de
|
482
|
+
wegwerfemail.de
|
483
|
+
wegwerfmail.de
|
484
|
+
wegwerfmail.net
|
485
|
+
wegwerfmail.org
|
486
|
+
wetrainbayarea.com
|
487
|
+
wetrainbayarea.org
|
488
|
+
wh4f.org
|
489
|
+
whatpaas.com
|
490
|
+
whyspam.me
|
491
|
+
willselfdestruct.com
|
492
|
+
winemaven.info
|
493
|
+
wronghead.com
|
494
|
+
wuzup.net
|
495
|
+
wuzupmail.net
|
496
|
+
wwwnew.eu
|
497
|
+
xagloo.com
|
498
|
+
xemaps.com
|
499
|
+
xents.com
|
500
|
+
xmaily.com
|
501
|
+
xoxy.net
|
502
|
+
yep.it
|
503
|
+
yogamaven.com
|
504
|
+
yopmail.com
|
505
|
+
yopmail.fr
|
506
|
+
yopmail.net
|
507
|
+
ypmail.webarnak.fr.eu.org
|
508
|
+
yuurok.com
|
509
|
+
zehnminutenmail.de
|
510
|
+
zippymail.info
|
511
|
+
zoaxe.com
|
512
|
+
zoemail.org
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'fake_email_validator'
|
7
|
+
spec.version = '0.0.1'
|
8
|
+
spec.authors = ['Maxim Dobryakov']
|
9
|
+
spec.email = ['maxim.dobryakov@gmail.com']
|
10
|
+
spec.summary = %q{E-Mail validator for Rails to block fake emails}
|
11
|
+
spec.description = %q{E-Mail validator for Rails to block services like mailinator.com}
|
12
|
+
spec.homepage = 'https://github.com/maxd/fake_email_validator'
|
13
|
+
spec.license = 'MIT'
|
14
|
+
|
15
|
+
spec.files = `git ls-files`.split($/)
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ['lib']
|
19
|
+
|
20
|
+
spec.add_development_dependency 'bundler', '~> 1.5'
|
21
|
+
spec.add_development_dependency 'rake', '~> 10.2', '> 10.2.0'
|
22
|
+
spec.add_development_dependency 'minitest', '~> 5.3', '> 5.3.1'
|
23
|
+
|
24
|
+
spec.add_runtime_dependency 'activemodel', '~> 4.0', '> 4.0.0'
|
25
|
+
spec.add_runtime_dependency 'mail', '~> 2.5', '> 2.5.3'
|
26
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'active_model'
|
2
|
+
require 'mail'
|
3
|
+
|
4
|
+
class FakeEmailValidator < ActiveModel::EachValidator
|
5
|
+
|
6
|
+
I18N_SCOPE = 'fake_email_validator.validations.email'
|
7
|
+
|
8
|
+
def initialize(options)
|
9
|
+
super(options)
|
10
|
+
|
11
|
+
fake_domains_file = File.expand_path('../../config/fake_domains.list', __FILE__)
|
12
|
+
@fake_domains = File.readlines(fake_domains_file).map {|fd| fd.strip.downcase }
|
13
|
+
end
|
14
|
+
|
15
|
+
def validate_each(record, attribute, value)
|
16
|
+
email = Mail::Address.new(value)
|
17
|
+
|
18
|
+
domain = email.domain.strip.downcase
|
19
|
+
is_fake = @fake_domains.include?(domain)
|
20
|
+
|
21
|
+
record.errors.add attribute, I18n.t(:fake, scope: I18N_SCOPE) if is_fake
|
22
|
+
rescue Mail::Field::ParseError
|
23
|
+
record.errors.add attribute, I18n.t(:invalid, scope: I18N_SCOPE)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
ActiveSupport.on_load(:i18n) do
|
29
|
+
I18n.load_path << File.expand_path('../../config/locales/en.yml', __FILE__)
|
30
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
class TestFakeEmailValidator < MiniTest::Unit::TestCase
|
4
|
+
|
5
|
+
@@user_class = Class.new do
|
6
|
+
include ActiveModel::Validations
|
7
|
+
|
8
|
+
attr_accessor :email
|
9
|
+
|
10
|
+
validates :email, fake_email: true
|
11
|
+
end
|
12
|
+
|
13
|
+
def setup
|
14
|
+
@user = @@user_class.new
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_incorrect_email
|
18
|
+
@user.email = 'test@b@d.com'
|
19
|
+
|
20
|
+
assert !@user.valid?
|
21
|
+
assert_equal 'is invalid format', @user.errors[:email].first
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_fake_email
|
25
|
+
@user.email = 'test@mailinator.com'
|
26
|
+
|
27
|
+
assert !@user.valid?
|
28
|
+
assert_equal 'is fake domain', @user.errors[:email].first
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_real_email
|
32
|
+
@user.email = 'test@gmail.com'
|
33
|
+
|
34
|
+
assert @user.valid?
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
metadata
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fake_email_validator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Maxim Dobryakov
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-03-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.5'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.2'
|
34
|
+
- - '>'
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 10.2.0
|
37
|
+
type: :development
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '10.2'
|
44
|
+
- - '>'
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 10.2.0
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: minitest
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '5.3'
|
54
|
+
- - '>'
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 5.3.1
|
57
|
+
type: :development
|
58
|
+
prerelease: false
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ~>
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '5.3'
|
64
|
+
- - '>'
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 5.3.1
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: activemodel
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ~>
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '4.0'
|
74
|
+
- - '>'
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 4.0.0
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ~>
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '4.0'
|
84
|
+
- - '>'
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 4.0.0
|
87
|
+
- !ruby/object:Gem::Dependency
|
88
|
+
name: mail
|
89
|
+
requirement: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '2.5'
|
94
|
+
- - '>'
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 2.5.3
|
97
|
+
type: :runtime
|
98
|
+
prerelease: false
|
99
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '2.5'
|
104
|
+
- - '>'
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: 2.5.3
|
107
|
+
description: E-Mail validator for Rails to block services like mailinator.com
|
108
|
+
email:
|
109
|
+
- maxim.dobryakov@gmail.com
|
110
|
+
executables: []
|
111
|
+
extensions: []
|
112
|
+
extra_rdoc_files: []
|
113
|
+
files:
|
114
|
+
- .gitignore
|
115
|
+
- .travis.yml
|
116
|
+
- Gemfile
|
117
|
+
- LICENSE.txt
|
118
|
+
- README.md
|
119
|
+
- Rakefile
|
120
|
+
- config/fake_domains.list
|
121
|
+
- config/locales/en.yml
|
122
|
+
- fake_email_validator.gemspec
|
123
|
+
- lib/fake_email_validator.rb
|
124
|
+
- test/minitest_helper.rb
|
125
|
+
- test/test_fake_email_validator.rb
|
126
|
+
homepage: https://github.com/maxd/fake_email_validator
|
127
|
+
licenses:
|
128
|
+
- MIT
|
129
|
+
metadata: {}
|
130
|
+
post_install_message:
|
131
|
+
rdoc_options: []
|
132
|
+
require_paths:
|
133
|
+
- lib
|
134
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - '>='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
|
+
requirements:
|
141
|
+
- - '>='
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '0'
|
144
|
+
requirements: []
|
145
|
+
rubyforge_project:
|
146
|
+
rubygems_version: 2.2.2
|
147
|
+
signing_key:
|
148
|
+
specification_version: 4
|
149
|
+
summary: E-Mail validator for Rails to block fake emails
|
150
|
+
test_files:
|
151
|
+
- test/minitest_helper.rb
|
152
|
+
- test/test_fake_email_validator.rb
|