email_repair 2.0.0 → 2.0.1
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.
- checksums.yaml +4 -4
- data/lib/email_repair/mechanic.rb +3 -0
- data/lib/email_repair/version.rb +1 -1
- data/spec/lib/email_repair/mechanic_spec.rb +4 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b61b1b2063f88892f084765ac14f503779b4b8ec762d913be9fa0c8e37c4e9e3
|
4
|
+
data.tar.gz: e5dc3b00f01d7f403e7bf2a3424d6054d24980003f3f72232a612b812b17f58a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e2a4144f8eda61738f62bdfe3f2530143eb75aca458f9f580e90f5342d9d006aefb87c58bca26784fb5fa8ce82acdc8c69c94ce33f1867849ec5a7d4f8e52a9
|
7
|
+
data.tar.gz: 521aaa4e93c7d06e75541d1e2841d60672b453b48a87223984d3972b618ead34b45d89af0fc5d6cdf2943b972358bfe56b8b5a8f79a9d98003ff7bc103bc6149
|
@@ -96,8 +96,11 @@ module EmailRepair
|
|
96
96
|
|
97
97
|
class CommonDomainAtAdder < CommonDomainRepair
|
98
98
|
def self.repair(email)
|
99
|
+
return email if email.match('.+@.+\..+')
|
100
|
+
|
99
101
|
common_domains.each do |name, suffix|
|
100
102
|
punc_regex = /[.#-]#{name}.#{suffix}$/
|
103
|
+
|
101
104
|
if email.match(punc_regex)
|
102
105
|
email = email.sub(punc_regex, "@#{name}.#{suffix}")
|
103
106
|
elsif email.match?(/[^@]#{name}.#{suffix}$/)
|
data/lib/email_repair/version.rb
CHANGED
@@ -123,6 +123,10 @@ module EmailRepair
|
|
123
123
|
end
|
124
124
|
end
|
125
125
|
|
126
|
+
it 'does not add an extra @ if there is already one' do
|
127
|
+
expect(mechanic.repair('bloo@myyahoo.com')).to eq 'bloo@myyahoo.com'
|
128
|
+
end
|
129
|
+
|
126
130
|
it 'replaces , with .' do
|
127
131
|
expect(mechanic.repair('b@b,com')).to eq 'b@b.com'
|
128
132
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: email_repair
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Holman Gao
|
8
8
|
- JT Bowler
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-08-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: coveralls
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: 1.50.2
|
70
|
-
description:
|
70
|
+
description:
|
71
71
|
email:
|
72
72
|
- holman@golmansax.com
|
73
73
|
- jbowler2400@gmail.com
|
@@ -88,7 +88,7 @@ homepage: https://github.com/ChalkSchools/email-repair
|
|
88
88
|
licenses:
|
89
89
|
- MIT
|
90
90
|
metadata: {}
|
91
|
-
post_install_message:
|
91
|
+
post_install_message:
|
92
92
|
rdoc_options: []
|
93
93
|
require_paths:
|
94
94
|
- lib
|
@@ -103,8 +103,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
rubygems_version: 3.4.
|
107
|
-
signing_key:
|
106
|
+
rubygems_version: 3.4.10
|
107
|
+
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Library to fix invalid emails
|
110
110
|
test_files:
|