email_inquire 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec.travis +3 -0
- data/.rubocop.yml +4 -0
- data/.travis.yml +13 -7
- data/CHANGELOG.md +64 -0
- data/README.md +4 -2
- data/Rakefile +4 -0
- data/data/br_tld.txt +72 -0
- data/email_inquire.gemspec +2 -2
- data/lib/email_inquire/email_validator.rb +3 -0
- data/lib/email_inquire/inquirer.rb +4 -2
- data/lib/email_inquire/version.rb +1 -1
- metadata +11 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe9ac8b676dfdb16bbd211a8d7616a37752a3c07
|
4
|
+
data.tar.gz: 9e39ac212dc83d513b12727aad1c41ce6e99a7da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 466cdad79e77d22aba5f912b8c4a950aa60b7661f1527d61e7ecfad159fbe16146585a754e05865c5d10602d1bfd4101b02c0f9e5900f0011b7dd4f4254a91c4
|
7
|
+
data.tar.gz: 76329acb8ade58a24294a64a0d3a32982dc3dc6546d2aff0961e077099e10f11106b22c777bcdadaa94a1f45bb3914cbbd661380c901d9167af41f640ba42d1f
|
data/.rspec.travis
ADDED
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -1,9 +1,15 @@
|
|
1
|
-
|
1
|
+
before_install:
|
2
|
+
- gem install bundler -v 1.14.6
|
3
|
+
before_script:
|
4
|
+
- cp -f .rspec.travis .rspec
|
5
|
+
bundler_args: --without local
|
6
|
+
dist: trusty
|
2
7
|
language: ruby
|
3
8
|
rvm:
|
4
|
-
- 2.1.
|
5
|
-
- 2.2.
|
6
|
-
- 2.3.
|
7
|
-
- 2.4.
|
8
|
-
|
9
|
-
|
9
|
+
- 2.1.10
|
10
|
+
- 2.2.7
|
11
|
+
- 2.3.4
|
12
|
+
- 2.4.1
|
13
|
+
script:
|
14
|
+
- bundle exec rake ci
|
15
|
+
sudo: false
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
## [Unreleased]
|
4
|
+
[Full Changelog](https://github.com/maximeg/email_inquire/compare/v0.6.0...master)
|
5
|
+
|
6
|
+
## [v0.6.0](https://github.com/maximeg/email_inquire/tree/v0.6.0) (2017-04-16)
|
7
|
+
[Full Changelog](https://github.com/maximeg/email_inquire/compare/v0.5.0...v0.6.0)
|
8
|
+
|
9
|
+
**Added:**
|
10
|
+
|
11
|
+
- Add Brazilian TLD support ([PR #6](https://github.com/maximeg/email_inquire/pull/6) from [willianveiga](https://github.com/willianveiga))
|
12
|
+
- Add a change log ([maximeg](https://github.com/maximeg) for [issue #5](https://github.com/maximeg/email_inquire/issues/5) from [maximeg](https://github.com/maximeg))
|
13
|
+
|
14
|
+
## [v0.5.0](https://github.com/maximeg/email_inquire/tree/v0.5.0) (2017-04-02)
|
15
|
+
[Full Changelog](https://github.com/maximeg/email_inquire/compare/v0.4.0...v0.5.0)
|
16
|
+
|
17
|
+
**Added:**
|
18
|
+
|
19
|
+
- Validate email for format ([maximeg](https://github.com/maximeg) for [issue #2](https://github.com/maximeg/email_inquire/issues/2) from [Sathors](https://github.com/Sathors))
|
20
|
+
|
21
|
+
**Changed:**
|
22
|
+
|
23
|
+
- Refactor ccTLD handling to prepare for .com.br ([maximeg](https://github.com/maximeg))
|
24
|
+
|
25
|
+
## [v0.4.0](https://github.com/maximeg/email_inquire/tree/v0.4.0) (2017-03-28)
|
26
|
+
[Full Changelog](https://github.com/maximeg/email_inquire/compare/v0.3.0...v0.4.0)
|
27
|
+
|
28
|
+
**Added:**
|
29
|
+
|
30
|
+
- Add Japanese TLD support ([PR #1](https://github.com/maximeg/email_inquire/pull/1) from [ninoseki](https://github.com/ninoseki))
|
31
|
+
|
32
|
+
## [v0.3.0](https://github.com/maximeg/email_inquire/tree/v0.3.0) (2017-03-21)
|
33
|
+
[Full Changelog](https://github.com/maximeg/email_inquire/compare/v0.2.0...v0.3.0)
|
34
|
+
|
35
|
+
**Changed:**
|
36
|
+
|
37
|
+
- Improve .co.uk cases ([maximeg](https://github.com/maximeg))
|
38
|
+
|
39
|
+
## [v0.2.0](https://github.com/maximeg/email_inquire/tree/v0.2.0) (2017-03-19)
|
40
|
+
[Full Changelog](https://github.com/maximeg/email_inquire/compare/v0.1.0...v0.2.0)
|
41
|
+
|
42
|
+
**Added:**
|
43
|
+
|
44
|
+
- Add 1374 one-time providers ([maximeg](https://github.com/maximeg))
|
45
|
+
|
46
|
+
**Changed:**
|
47
|
+
|
48
|
+
- Extract data into their own files ([maximeg](https://github.com/maximeg))
|
49
|
+
|
50
|
+
## [v0.1.0](https://github.com/maximeg/email_inquire/tree/v0.1.0) (2017-03-19)
|
51
|
+
[Full Changelog](https://github.com/maximeg/email_inquire/compare/v0.0.0...v0.1.0)
|
52
|
+
|
53
|
+
**Added:**
|
54
|
+
|
55
|
+
- First version ([maximeg](https://github.com/maximeg))
|
56
|
+
|
57
|
+
**Dev:**
|
58
|
+
|
59
|
+
- Quality: Add Rubocop ([maximeg](https://github.com/maximeg))
|
60
|
+
- Dev: Add Guard ([maximeg](https://github.com/maximeg))
|
61
|
+
|
62
|
+
## [v0.0.0](https://github.com/maximeg/email_inquire/tree/v0.0.0) (2016-10-03)
|
63
|
+
|
64
|
+
- Reserve gem name
|
data/README.md
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
# EmailInquire
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/email_inquire.svg)](https://badge.fury.io/rb/email_inquire) [![Build Status](https://travis-ci.org/maximeg/email_inquire.svg?branch=master)](https://travis-ci.org/maximeg/email_inquire) [![Code Climate](https://codeclimate.com/github/maximeg/email_inquire/badges/gpa.svg)](https://codeclimate.com/github/maximeg/email_inquire)
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/email_inquire.svg)](https://badge.fury.io/rb/email_inquire) [![Build Status](https://travis-ci.org/maximeg/email_inquire.svg?branch=master)](https://travis-ci.org/maximeg/email_inquire) [![Dependency Status](https://gemnasium.com/badges/github.com/maximeg/email_inquire.svg)](https://gemnasium.com/github.com/maximeg/email_inquire) [![Code Climate](https://codeclimate.com/github/maximeg/email_inquire/badges/gpa.svg)](https://codeclimate.com/github/maximeg/email_inquire)
|
4
4
|
|
5
5
|
EmailInquire is a library to validate email for format, common typos and one-time email providers.
|
6
6
|
|
7
|
+
[Changelog](https://github.com/maximeg/email_inquire/blob/master/CHANGELOG.md)
|
8
|
+
|
7
9
|
## Why?
|
8
10
|
|
9
11
|
Before a user is a user, they are a visitor. And they must register to be so. What if they makes a typo while
|
@@ -51,7 +53,7 @@ ccTLD specificity, like United Kingdom `.xx.uk` domains:
|
|
51
53
|
- `foo.judiciary.uk` => ok!
|
52
54
|
- ...
|
53
55
|
|
54
|
-
...and same thing with `.co.jp` domains.
|
56
|
+
...and same thing with `.co.jp` & `.com.br` domains.
|
55
57
|
|
56
58
|
Providers with an unique domain:
|
57
59
|
|
data/Rakefile
CHANGED
data/data/br_tld.txt
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
.adm.br
|
2
|
+
.adv.br
|
3
|
+
.agr.br
|
4
|
+
.am.br
|
5
|
+
.arq.br
|
6
|
+
.art.br
|
7
|
+
.ato.br
|
8
|
+
.b.br
|
9
|
+
.bio.br
|
10
|
+
.blog.br
|
11
|
+
.bmd.br
|
12
|
+
.cim.br
|
13
|
+
.cng.br
|
14
|
+
.cnt.br
|
15
|
+
.com.br
|
16
|
+
.coop.br
|
17
|
+
.cri.br
|
18
|
+
.def.br
|
19
|
+
.ecn.br
|
20
|
+
.eco.br
|
21
|
+
.edu.br
|
22
|
+
.emp.br
|
23
|
+
.eng.br
|
24
|
+
.esp.br
|
25
|
+
.etc.br
|
26
|
+
.eti.br
|
27
|
+
.far.br
|
28
|
+
.flog.br
|
29
|
+
.fm.br
|
30
|
+
.fnd.br
|
31
|
+
.fot.br
|
32
|
+
.fst.br
|
33
|
+
.g12.br
|
34
|
+
.ggf.br
|
35
|
+
.gov.br
|
36
|
+
.imb.br
|
37
|
+
.ind.br
|
38
|
+
.inf.br
|
39
|
+
.jor.br
|
40
|
+
.jus.br
|
41
|
+
.leg.br
|
42
|
+
.lel.br
|
43
|
+
.mat.br
|
44
|
+
.med.br
|
45
|
+
.mil.br
|
46
|
+
.mp.br
|
47
|
+
.mus.br
|
48
|
+
.net.br
|
49
|
+
.nom.br
|
50
|
+
.not.br
|
51
|
+
.ntr.br
|
52
|
+
.odo.br
|
53
|
+
.org.br
|
54
|
+
.ppg.br
|
55
|
+
.pro.br
|
56
|
+
.psc.br
|
57
|
+
.psi.br
|
58
|
+
.qsl.br
|
59
|
+
.radio.br
|
60
|
+
.rec.br
|
61
|
+
.slg.br
|
62
|
+
.srv.br
|
63
|
+
.taxi.br
|
64
|
+
.teo.br
|
65
|
+
.tmp.br
|
66
|
+
.trd.br
|
67
|
+
.tur.br
|
68
|
+
.tv.br
|
69
|
+
.vet.br
|
70
|
+
.vlog.br
|
71
|
+
.wiki.br
|
72
|
+
.zlg.br
|
data/email_inquire.gemspec
CHANGED
@@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
|
|
27
27
|
|
28
28
|
spec.add_runtime_dependency "damerau-levenshtein", "~> 1.2"
|
29
29
|
|
30
|
-
spec.add_development_dependency "bundler", "~> 1.
|
30
|
+
spec.add_development_dependency "bundler", "~> 1.14"
|
31
31
|
spec.add_development_dependency "rake", "~> 10.0"
|
32
32
|
spec.add_development_dependency "rspec", "~> 3.0"
|
33
|
-
spec.add_development_dependency "rubocop", "
|
33
|
+
spec.add_development_dependency "rubocop", "0.48.1"
|
34
34
|
end
|
@@ -29,14 +29,14 @@ module EmailInquire
|
|
29
29
|
|
30
30
|
attr_reader :domain, :email, :name
|
31
31
|
|
32
|
-
VALIDATORS = %i
|
32
|
+
VALIDATORS = %i[
|
33
33
|
validate_common_domains
|
34
34
|
validate_one_time_providers
|
35
35
|
validate_common_domain_mistakes
|
36
36
|
validate_cc_tld
|
37
37
|
validate_common_tld_mistakes
|
38
38
|
validate_domains_with_unique_tld
|
39
|
-
|
39
|
+
].freeze
|
40
40
|
|
41
41
|
def validate
|
42
42
|
email_validator = EmailValidator.new(email)
|
@@ -99,6 +99,7 @@ module EmailInquire
|
|
99
99
|
end
|
100
100
|
|
101
101
|
COMMON_TLD_MISTAKES = {
|
102
|
+
".combr" => ".com.br",
|
102
103
|
".cojp" => ".co.jp",
|
103
104
|
".couk" => ".co.uk",
|
104
105
|
".com.com" => ".com",
|
@@ -118,6 +119,7 @@ module EmailInquire
|
|
118
119
|
VALID_CC_TLDS = [
|
119
120
|
[".jp", ".co.jp", load_data("jp_tld").freeze],
|
120
121
|
[".uk", ".co.uk", load_data("uk_tld").freeze],
|
122
|
+
[".br", ".com.br", load_data("br_tld").freeze],
|
121
123
|
].freeze
|
122
124
|
|
123
125
|
def validate_cc_tld
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: email_inquire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxime Garcia
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: damerau-levenshtein
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.14'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.14'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: rubocop
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.48.1
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 0.48.1
|
83
83
|
description: Library to validate email for format, common typos and one-time email
|
84
84
|
providers
|
85
85
|
email:
|
@@ -90,8 +90,10 @@ extra_rdoc_files: []
|
|
90
90
|
files:
|
91
91
|
- ".gitignore"
|
92
92
|
- ".rspec"
|
93
|
+
- ".rspec.travis"
|
93
94
|
- ".rubocop.yml"
|
94
95
|
- ".travis.yml"
|
96
|
+
- CHANGELOG.md
|
95
97
|
- Gemfile
|
96
98
|
- Guardfile
|
97
99
|
- LICENSE.txt
|
@@ -99,6 +101,7 @@ files:
|
|
99
101
|
- Rakefile
|
100
102
|
- bin/console
|
101
103
|
- bin/setup
|
104
|
+
- data/br_tld.txt
|
102
105
|
- data/common_providers.txt
|
103
106
|
- data/jp_tld.txt
|
104
107
|
- data/one_time_email_providers.txt
|