fat_fingers 0.1.30 → 0.1.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/fat_fingers.rb +7 -7
- data/test/test_fat_fingers.rb +27 -8
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 62cbeca39129b05b857c99e73667f3796a6a132a3479ebed0c692cc26ced1e9f
|
4
|
+
data.tar.gz: 7870519d781db7f5e979308508019b1b9b008cd1fb8ee863df96c02eb48adae8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25049cafe5a2138e964699965d6a3e88f44c64a90b59eada5a11e38d9bd796b250220c185327fb55dc9cb6505a0ea3ff050b414a2e699dc433066cd26720e0c7
|
7
|
+
data.tar.gz: 9d5f4d1a2e2494c2ab05a6dcef2e7f60043418aebe9af06706e770a601ac742be518512be8395d9bda028fc23da456ba3794e0e4608332aa3cb13dc569159a68
|
data/lib/fat_fingers.rb
CHANGED
@@ -68,7 +68,7 @@ protected
|
|
68
68
|
|
69
69
|
def clean_up_funky_coms
|
70
70
|
gsub(/\.c*(c|ck|ci|coi|l|m|n|o|op|cp|0|9)*m+o*$/,".com").
|
71
|
-
gsub(/\.(c|f|v|x)o+(m|n)$/,".com")
|
71
|
+
gsub(/\.(c|f|v|x|vc|xc)o+(m|n)$/,".com")
|
72
72
|
end
|
73
73
|
|
74
74
|
def clean_up_funky_nets
|
@@ -80,15 +80,15 @@ protected
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def clean_up_googlemail
|
83
|
-
gsub(/@go{0,3}g{0,2}o?le?[mn]?[ail]{1,2}m?[aikl]{0,3}
|
83
|
+
gsub(/@go{0,3}g{0,2}o?le?[mn]?[ail]{1,2}m?[aikl]{0,3}\.(?!gov)(?!edu)(?!ac.in)/,"@googlemail.")
|
84
84
|
end
|
85
85
|
|
86
86
|
def clean_up_gmail
|
87
|
-
gsub(/@g[nm]{0,2}s?[ail]{1,2}[aiklmou]{0,3}\.(?!gov)/,"@gmail.") # match a broad variety of mispellings of gmail, but not if it's .gov
|
87
|
+
gsub(/@ga?e?i?o?r?g?[nm]{0,2}s?[ail]{1,2}[aiklmou]{0,3}\.(?!gov)(?!edu)(?!ac.in)/,"@gmail.") # match a broad variety of mispellings of gmail, but not if it's .gov or .edu
|
88
88
|
end
|
89
89
|
|
90
90
|
def clean_up_hotmail
|
91
|
-
gsub(/@h(i|o|p)?y?t?o?a?m?n?t?[aikl]{1,3}l?\./,"@hotmail.")
|
91
|
+
gsub(/@h(i|o|p)?y?t?o?a?r?m?n?t?m?[aikl]{1,3}l?\./,"@hotmail.")
|
92
92
|
end
|
93
93
|
|
94
94
|
def clean_up_yahoo
|
@@ -103,16 +103,16 @@ protected
|
|
103
103
|
gsub(/@co?(m|n)a?cas?t{0,2}\./,"@comcast.").
|
104
104
|
gsub(/@sbc?gl?ob[al]{0,2}l?\./, "@sbcglobal.").
|
105
105
|
gsub(/@ver?i?z?on\./,"@verizon.").
|
106
|
-
gsub(/@icl{0,2}
|
106
|
+
gsub(/@icl{0,2}o?u?d\./,"@icloud.").
|
107
107
|
gsub(/@outl?ook?\./,"@outlook.")
|
108
108
|
end
|
109
109
|
|
110
110
|
def clean_up_known_coms
|
111
|
-
gsub(/(aol
|
111
|
+
gsub(/(@aol|@googlemail|@gmail|@hotmail|@yahoo|@icloud|@outlook)\.(co|net|org)$/, '\1.com')
|
112
112
|
end
|
113
113
|
|
114
114
|
def add_a_period_if_they_forgot_it
|
115
115
|
gsub(/([^\.])(com|org|net)$/, '\1.\2')
|
116
116
|
end
|
117
117
|
|
118
|
-
end
|
118
|
+
end
|
data/test/test_fat_fingers.rb
CHANGED
@@ -24,6 +24,12 @@ class StringTest < MiniTest::Unit::TestCase
|
|
24
24
|
"test@gmaill.com",
|
25
25
|
"test@gamil.com",
|
26
26
|
"test@gnail.com",
|
27
|
+
"test@gamail.com",
|
28
|
+
"test@gemail.com",
|
29
|
+
"test@gimail.com",
|
30
|
+
"test@gomail.com",
|
31
|
+
"test@ggmail.com",
|
32
|
+
"test@grmail.com",
|
27
33
|
"test@gmailc.om",
|
28
34
|
"test.@gmail.com",
|
29
35
|
"test.@gmail.co",
|
@@ -100,13 +106,16 @@ class StringTest < MiniTest::Unit::TestCase
|
|
100
106
|
"test@hotmaill.com",
|
101
107
|
"test@hotmaik.com",
|
102
108
|
"test@hoymail.com",
|
109
|
+
"test@hormail.com",
|
110
|
+
"test@hortmail.com",
|
103
111
|
"test@hptmail.com",
|
104
112
|
"test@hitmail.com",
|
105
113
|
"test@hotnail.com",
|
106
114
|
"test@htomali.com",
|
107
115
|
"test@homtail.com",
|
108
116
|
"test@hotmail.co",
|
109
|
-
"test@hotmail.net"
|
117
|
+
"test@hotmail.net",
|
118
|
+
"test@hotmail.vcom"
|
110
119
|
]
|
111
120
|
},
|
112
121
|
# aol.com
|
@@ -146,7 +155,10 @@ class StringTest < MiniTest::Unit::TestCase
|
|
146
155
|
bad: [
|
147
156
|
"test@icoud.com",
|
148
157
|
"test@icloud.co",
|
149
|
-
"test@icloud.net"
|
158
|
+
"test@icloud.net",
|
159
|
+
"test@iclod.com",
|
160
|
+
"test@iclud.com",
|
161
|
+
"test@icld.com"
|
150
162
|
]
|
151
163
|
},
|
152
164
|
# outlook.com
|
@@ -219,7 +231,9 @@ class StringTest < MiniTest::Unit::TestCase
|
|
219
231
|
"test@something.com ",
|
220
232
|
"TEST@SOMETHING.COM",
|
221
233
|
"test@something.c9m",
|
222
|
-
"mailto:test@something.com"
|
234
|
+
"mailto:test@something.com",
|
235
|
+
"test@something.vcom",
|
236
|
+
"test@something.xcom"
|
223
237
|
]
|
224
238
|
},
|
225
239
|
# generic .net
|
@@ -261,6 +275,12 @@ class StringTest < MiniTest::Unit::TestCase
|
|
261
275
|
"test.com@gmail.com",
|
262
276
|
"test.comisky@gmail.com",
|
263
277
|
"test+spamfilter@gmail.com",
|
278
|
+
"test@gmx.com",
|
279
|
+
"test@gao.gov",
|
280
|
+
"test@gial.edu",
|
281
|
+
"test@gial.ac.in",
|
282
|
+
"test@gla.gov",
|
283
|
+
"test@googlemail.com",
|
264
284
|
"test@something.cn",
|
265
285
|
"test@something.com.co",
|
266
286
|
"test@something.co",
|
@@ -269,9 +289,6 @@ class StringTest < MiniTest::Unit::TestCase
|
|
269
289
|
"test@aol.com",
|
270
290
|
"test@att.net",
|
271
291
|
"test@facebook.com",
|
272
|
-
"test@gmx.com",
|
273
|
-
"test@gao.gov",
|
274
|
-
"test@googlemail.com",
|
275
292
|
"test@hotmail.co.uk",
|
276
293
|
"test@live.com",
|
277
294
|
"test@mac.com",
|
@@ -283,7 +300,9 @@ class StringTest < MiniTest::Unit::TestCase
|
|
283
300
|
"test@ymail.com",
|
284
301
|
"test@army.mil",
|
285
302
|
"test@anything.comcast.com",
|
286
|
-
"test@anything.comcastbiz.net"
|
303
|
+
"test@anything.comcastbiz.net",
|
304
|
+
"test@dogmail.net",
|
305
|
+
"test@engaol.net"
|
287
306
|
]
|
288
307
|
|
289
308
|
|
@@ -318,4 +337,4 @@ class StringTest < MiniTest::Unit::TestCase
|
|
318
337
|
refute_equal "test@something.#{tld}", "test@something.#{tld}".clean_up_typoed_email
|
319
338
|
end
|
320
339
|
end
|
321
|
-
end
|
340
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fat_fingers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charlie Park
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-10-01 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Makes sure users don't accidentally create an account for the wrong e-mail
|
15
15
|
address. Because 'gmial' isn't actually what they meant to type. Similarly, 'yaho.com',
|
@@ -42,8 +42,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '0'
|
44
44
|
requirements: []
|
45
|
-
|
46
|
-
rubygems_version: 2.6.12
|
45
|
+
rubygems_version: 3.0.6
|
47
46
|
signing_key:
|
48
47
|
specification_version: 4
|
49
48
|
summary: Clean up e-mail strings when the user's made a typo (like 'gmail.cmo').
|