valid_email2 1.1.5 → 1.1.6

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
2
  SHA1:
3
- metadata.gz: 89124fcb3dcff8c5eb8833cfa0f4bc7e52777974
4
- data.tar.gz: 4d11dd11352a95f1965d838567081839531b5859
3
+ metadata.gz: dd308777bd64592b2de0a1af1308fd80b197d1b7
4
+ data.tar.gz: 11545bb3afeb1885a8513121d59a55955408392f
5
5
  SHA512:
6
- metadata.gz: cbc8d2a1282dc1603bb086af4707500d8cb71e2f231d25a0bca4218762f8a9212ebe78ef8318ceb09b0ea75faed07a5b584dd6ee34cd868111688a2ce6f4bae5
7
- data.tar.gz: 7ba94266099a2e3a453251d89d74b8d04f47f329d5d54b16787e06030edab5323a04da8769e32534fc9cf641e6791b928dd5da824bbd48b4d5e1597e3aa848be
6
+ metadata.gz: 04d4aefcd05f9e893203c686ce9ac0c87a0cc81ec711ebae25b10b2f4f59d738d5dc9001d852524fd9e297a4d8796bebff199217d7e083942aca79141117f101
7
+ data.tar.gz: d035191846afc8fc0327d7429adfa228d1bfef8b71ba51c96d3ccca05743216fd47f10809944f6e590de77e5ec6458437ce83cc5a075b79b2bf58b9afc3e579c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## Version 1.1.6
2
+ Fix a regression which changed validation on domains that caused domains with
3
+ multiple consecutive dots to be valid.
4
+
1
5
  ## Version 1.1.5
2
6
  Be more lenient on the mail gem version dependency to allow people to use v2.6.
3
7
  Added more disposable email domains (https://github.com/lisinge/valid_email2/pull/14 and https://github.com/lisinge/valid_email2/pull/15)
@@ -21,8 +21,9 @@ module ValidEmail2
21
21
  return false if @parse_error
22
22
 
23
23
  if address.domain && address.address == @raw_address
24
+ domain = address.domain
24
25
  # Valid address needs to have a dot in the domain
25
- !!address.domain.match(/\./)
26
+ !!domain.match(/\./) && !domain.match(/\.{2,}/)
26
27
  else
27
28
  false
28
29
  end
@@ -1,3 +1,3 @@
1
1
  module ValidEmail2
2
- VERSION = "1.1.5"
2
+ VERSION = "1.1.6"
3
3
  end
@@ -39,6 +39,11 @@ describe ValidEmail2 do
39
39
  Mail::Address.stub(:new).and_raise(Mail::Field::ParseError.new(nil, nil, nil))
40
40
  user.valid?.should be_false
41
41
  end
42
+
43
+ it "shouldn't be valid if the domain constains consecutives dots" do
44
+ user = TestUser.new(email: "foo@bar..com")
45
+ user.valid?.should be_false
46
+ end
42
47
  end
43
48
 
44
49
  describe "disposable emails" 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: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micke Lisinge
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-04 00:00:00.000000000 Z
11
+ date: 2015-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler