valid_email2 3.0.4 → 3.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/lib/valid_email2/address.rb +3 -1
- data/lib/valid_email2/version.rb +1 -1
- data/spec/valid_email2_spec.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3579df33c2e2b6f61deb537f9b53429419c8e3eeee9c2f7983c73587b7831d4e
|
4
|
+
data.tar.gz: a8438e557f74f5ca789e1d45de65a2e7202232f9b69b34d4639946f55eb504bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1a23d4278a946a56bb105839a3b4b6e4cc87830d160d7ca7ed6c82e3ae28638be3d6eb0868af73862cd0819099f36163eb42c5496ffd066c16cd547271fd907
|
7
|
+
data.tar.gz: 9c513901af108ac87275cb162eb832be8205c095b2da12486c67f479e08fdc5c113129c7dc2432058c2a4e88c487ad70fee44af87f2fa27f1cb33ff3fbb4abf8
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Validate emails with the help of the `mail` gem instead of some clunky regexp.
|
6
6
|
Aditionally validate that the domain has a MX record.
|
7
|
-
Optionally validate against a static [list of disposable email services](
|
7
|
+
Optionally validate against a static [list of disposable email services](config/disposable_email_domains.yml).
|
8
8
|
Optionally validate that the email is not subaddressed ([RFC5233](https://tools.ietf.org/html/rfc5233)).
|
9
9
|
|
10
10
|
### Why?
|
data/lib/valid_email2/address.rb
CHANGED
@@ -34,7 +34,9 @@ module ValidEmail2
|
|
34
34
|
# Domain may not have two consecutive dots
|
35
35
|
domain !~ /\.{2,}/ &&
|
36
36
|
# Domain may not start with a dot
|
37
|
-
domain !~ /^\./
|
37
|
+
domain !~ /^\./ &&
|
38
|
+
# Address may not contain a dot directly before @
|
39
|
+
address.address !~ /\.@/
|
38
40
|
else
|
39
41
|
false
|
40
42
|
end
|
data/lib/valid_email2/version.rb
CHANGED
data/spec/valid_email2_spec.rb
CHANGED
@@ -75,6 +75,11 @@ describe ValidEmail2 do
|
|
75
75
|
user = TestUser.new(email: "foo🙈@gmail.com")
|
76
76
|
expect(user.valid?).to be_falsy
|
77
77
|
end
|
78
|
+
|
79
|
+
it "is invalid if the domain contains .@ consecutively" do
|
80
|
+
user = TestUser.new(email: "foo.@gmail.com")
|
81
|
+
expect(user.valid?).to be_falsy
|
82
|
+
end
|
78
83
|
end
|
79
84
|
|
80
85
|
describe "with disposable validation" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: valid_email2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micke Lisinge
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|