fat_fingers 0.1.29 → 0.1.34

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7b6296289b057635d8270208857c0e2d548718c4
4
- data.tar.gz: 38861570ab7b127c63898cebcdad00c2062a779b
2
+ SHA256:
3
+ metadata.gz: c9e2fb174d542b7693f48077cf739a0c4bc640a2134c1d00d471f059e9cd327a
4
+ data.tar.gz: d1f0cc6d93d1dfcae7cf181b9bcbdb37a0af197006daf867fdd4870f34a0efcb
5
5
  SHA512:
6
- metadata.gz: fed3b60932fd28ae5d7dd395c3177b1ec02d17231c7319e1650b9c94cb8d08a77bb4d9d3c0434a0c4e00487d6bebfdc1590d787772fa3d507550e952fa9c4719
7
- data.tar.gz: de40efd876f319b36c9570e89777553f00cc542f2e698a6062c0e73492372b38a73604147e87d0d43eca6d2dcf90c98b27d03e2e8aa0c90a6d29aabd771b8ccd
6
+ metadata.gz: 4fec6a9e549ff1aa059b50b5242b113b5034bcc0258852f9a3f887260647a716d685783a2e6eac0bf339899d4d908687a0e36f9773a9eb1eee91392d01a73062
7
+ data.tar.gz: fd89cad6a08f5cbf4428a85681f773731b875c660d5bdab5dca57a1b3ada43c5f08dd732c984a9353ae3ed59365d56763228396189ee34473651beb7e039409c
@@ -33,11 +33,11 @@ class String
33
33
  end
34
34
 
35
35
  protected
36
-
36
+
37
37
  def remove_mailto
38
38
  gsub(/\Amailto:/, "")
39
39
  end
40
-
40
+
41
41
  def remove_invalid_characters
42
42
  gsub(/(\s|\#|\'|\"|\\)*/, "").
43
43
  gsub(/(\,|\.\.)/, ".").
@@ -67,8 +67,8 @@ protected
67
67
  end
68
68
 
69
69
  def clean_up_funky_coms
70
- gsub(/\.c*(c|ci|coi|l|m|n|o|op|cp|0|9)*m+o*$/,".com").
71
- gsub(/\.(c|v|x)o+(m|n)$/,".com")
70
+ gsub(/\.c*(c|ck|ci|coi|l|m|n|o|op|cp|0|9)*m+o*$/,".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
@@ -84,11 +84,11 @@ protected
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)/,"@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}oud\./,"@icloud.").
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|googlemail|gmail|hotmail|yahoo|icloud|outlook)\.(co|net|org)$/, '\1.com')
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
@@ -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
@@ -192,9 +204,11 @@ class StringTest < MiniTest::Unit::TestCase
192
204
  "test@something.coom",
193
205
  "test@something.copm",
194
206
  "test@something.cpm",
207
+ "test@something.ckm",
195
208
  "test@something.ocm",
196
209
  "test@something.vom",
197
210
  "test@something.xom",
211
+ "test@something.fom",
198
212
  "test@something.con.com",
199
213
  "test@something.com.com",
200
214
  "test@something.com'",
@@ -217,7 +231,9 @@ class StringTest < MiniTest::Unit::TestCase
217
231
  "test@something.com ",
218
232
  "TEST@SOMETHING.COM",
219
233
  "test@something.c9m",
220
- "mailto:test@something.com"
234
+ "mailto:test@something.com",
235
+ "test@something.vcom",
236
+ "test@something.xcom"
221
237
  ]
222
238
  },
223
239
  # generic .net
@@ -259,6 +275,10 @@ class StringTest < MiniTest::Unit::TestCase
259
275
  "test.com@gmail.com",
260
276
  "test.comisky@gmail.com",
261
277
  "test+spamfilter@gmail.com",
278
+ "test@gmx.com",
279
+ "test@gao.gov",
280
+ "test@gial.edu",
281
+ "test@googlemail.com",
262
282
  "test@something.cn",
263
283
  "test@something.com.co",
264
284
  "test@something.co",
@@ -267,9 +287,6 @@ class StringTest < MiniTest::Unit::TestCase
267
287
  "test@aol.com",
268
288
  "test@att.net",
269
289
  "test@facebook.com",
270
- "test@gmx.com",
271
- "test@gao.gov",
272
- "test@googlemail.com",
273
290
  "test@hotmail.co.uk",
274
291
  "test@live.com",
275
292
  "test@mac.com",
@@ -281,7 +298,9 @@ class StringTest < MiniTest::Unit::TestCase
281
298
  "test@ymail.com",
282
299
  "test@army.mil",
283
300
  "test@anything.comcast.com",
284
- "test@anything.comcastbiz.net"
301
+ "test@anything.comcastbiz.net",
302
+ "test@dogmail.net",
303
+ "test@engaol.net"
285
304
  ]
286
305
 
287
306
 
@@ -316,4 +335,4 @@ class StringTest < MiniTest::Unit::TestCase
316
335
  refute_equal "test@something.#{tld}", "test@something.#{tld}".clean_up_typoed_email
317
336
  end
318
337
  end
319
- end
338
+ 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.29
4
+ version: 0.1.34
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: 2017-09-18 00:00:00.000000000 Z
12
+ date: 2020-09-08 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
- rubyforge_project:
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').