fat_fingers 0.1.20 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/fat_fingers.rb CHANGED
@@ -25,6 +25,7 @@ class String
25
25
  clean_up_hotmail.
26
26
  clean_up_yahoo.
27
27
  clean_up_other_providers.
28
+ clean_up_known_coms.
28
29
  add_a_period_if_they_forgot_it
29
30
  end
30
31
 
@@ -88,6 +89,10 @@ protected
88
89
  gsub(/@veri*z*on\.net/,"@verizon.net")
89
90
  end
90
91
 
92
+ def clean_up_known_coms
93
+ gsub(/(aol|gmail|hotmail|yahoo).co$/){|w| w+"m"}
94
+ end
95
+
91
96
  def add_a_period_if_they_forgot_it
92
97
  gsub(/([^\.])(com|org|net)$/, '\1.\2')
93
98
  end
@@ -18,7 +18,8 @@ class StringTest < MiniTest::Unit::TestCase
18
18
  "test@gamil.com",
19
19
  "test@gnail.com",
20
20
  "test@gmailc.om",
21
- "test.@gmail.com"
21
+ "test.@gmail.com",
22
+ "test.@gmail.co"
22
23
  ]
23
24
 
24
25
  @good_intl_gmail = "test@gmail.co.uk"
@@ -51,7 +52,8 @@ class StringTest < MiniTest::Unit::TestCase
51
52
  "test@yhooo.com",
52
53
  "test@yao.com",
53
54
  "test@yaooo.com",
54
- "test@yahooc.om"
55
+ "test@yahooc.om",
56
+ "test@yahoo.co"
55
57
  ]
56
58
 
57
59
  @good_hotmail = "test@hotmail.com"
@@ -63,9 +65,18 @@ class StringTest < MiniTest::Unit::TestCase
63
65
  "test@hoymail.com",
64
66
  "test@hptmail.com",
65
67
  "test@htomali.com",
66
- "test@homtail.com"
68
+ "test@homtail.com",
69
+ "test@hotmail.co"
67
70
  ]
68
71
 
72
+ @good_aol = "test@aol.com"
73
+ @bad_aol = [
74
+ "test@aol.co",
75
+ "test@aol.co",
76
+ "test@aol.cm"
77
+ ]
78
+
79
+
69
80
  @good_com = "test@something.com"
70
81
  @bad_com = [
71
82
  "test@somethingc.om",
@@ -234,7 +245,7 @@ class StringTest < MiniTest::Unit::TestCase
234
245
  end
235
246
 
236
247
  def cases
237
- [ "gmail", "intl_gmail", "yahoo", "hotmail", "com", "net", "org", "comcast", "sbcglobal", "gm", "tld_cn", "tld_co",
248
+ [ "gmail", "intl_gmail", "yahoo", "hotmail", "aol", "com", "net", "org", "comcast", "sbcglobal", "gm", "tld_cn", "tld_co",
238
249
  "random_co", "tld_gr", "tld_jp", "tld_coop", "gmail_with_dots", "gmail_with_plus", "aol_com", "att_net", "facebook_com",
239
250
  "gmx_com", "googlemail_com", "hotmail_co_uk", "live_com", "mac_com", "mail_com", "me_com", "msn_com", "verizon_net",
240
251
  "yahoo_co_uk", "ymail_com", "mil"]
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.20
4
+ version: 0.1.21
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-03 00:00:00.000000000 Z
12
+ date: 2013-12-12 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',