valid_email2 3.7.0 → 4.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yaml +28 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +28 -0
- data/README.md +13 -18
- data/config/disposable_email_domains.txt +113251 -6
- data/gemfiles/activemodel7.gemfile +5 -0
- data/lib/valid_email2/address.rb +8 -5
- data/lib/valid_email2/email_validator.rb +2 -2
- data/lib/valid_email2/version.rb +1 -1
- data/pull_mailchecker_emails.rb +10 -5
- data/spec/address_spec.rb +37 -0
- data/valid_email2.gemspec +3 -2
- metadata +25 -8
- data/.travis.yml +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afb90257f63f378fa9e5ad744b1ca65ec0172f73c78e534656b1513c5e8aede6
|
4
|
+
data.tar.gz: d087cdefa7ea9c6cb9b6e64e814c5b1c1f8a78d86833998ad00b3c7e23f8c090
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41c4f605b9aa4eeb4f99085e044475b8fb18f8d46a0f4267286bf9d096017fab8d24259195051e2ec783e6c1ece8d005d3495690a5f202c21a71d922ea69b169
|
7
|
+
data.tar.gz: 38c34de1f4dc828601f8fb05c711ce5ddfbcf6f7ea7a3de19c4620b696e3ca20c93ee061fad4a86b294b8715e7763f3b91f3a257328f972ab0b82ae7d15755f7
|
@@ -0,0 +1,28 @@
|
|
1
|
+
name: CI
|
2
|
+
on: [push, pull_request]
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
strategy:
|
6
|
+
fail-fast: false
|
7
|
+
matrix:
|
8
|
+
gemfile: [ activemodel5, activemodel6, activemodel7 ]
|
9
|
+
ruby: [2.5, 2.6, 2.7, "3.0", 3.1]
|
10
|
+
exclude:
|
11
|
+
- gemfile: activemodel7
|
12
|
+
ruby: 2.5
|
13
|
+
- gemfile: activemodel7
|
14
|
+
ruby: 2.6
|
15
|
+
- gemfile: activemodel5
|
16
|
+
ruby: "3.0"
|
17
|
+
- gemfile: activemodel5
|
18
|
+
ruby: 3.1
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
env:
|
21
|
+
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
|
22
|
+
steps:
|
23
|
+
- uses: actions/checkout@v2
|
24
|
+
- uses: ruby/setup-ruby@v1
|
25
|
+
with:
|
26
|
+
ruby-version: ${{ matrix.ruby }}
|
27
|
+
bundler-cache: true
|
28
|
+
- run: bundle exec rake
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,31 @@
|
|
1
|
+
## Version 4.0.6
|
2
|
+
* Remove false positives https://github.com/micke/valid_email2/pull/200
|
3
|
+
* Remove unused default option https://github.com/micke/valid_email2/pull/201
|
4
|
+
* Pull new domains
|
5
|
+
|
6
|
+
## Version 4.0.5
|
7
|
+
* Remove false positive mail2word.com
|
8
|
+
* Pull new domains
|
9
|
+
|
10
|
+
## Version 4.0.4
|
11
|
+
* Add new domains https://github.com/micke/valid_email2/pull/196
|
12
|
+
* Pull new domains
|
13
|
+
|
14
|
+
## Version 4.0.3
|
15
|
+
* Remove false positive (139.com) #188
|
16
|
+
* Pull new domains
|
17
|
+
|
18
|
+
## Version 4.0.2
|
19
|
+
* Remove false positive (freemail.hu) #187
|
20
|
+
* Pull new domains
|
21
|
+
|
22
|
+
## Version 4.0.1
|
23
|
+
* Remove false positives (onit.com, asics.com)
|
24
|
+
* Pull new domains
|
25
|
+
|
26
|
+
## Version 4.0.0
|
27
|
+
* Support setting a timout for DNS lookups and default to 5 seconds https://github.com/micke/valid_email2/pull/181
|
28
|
+
|
1
29
|
## Version 3.7.0
|
2
30
|
* Support validating arrays https://github.com/micke/valid_email2/pull/178
|
3
31
|
* Pull new domains
|
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
# ValidEmail2
|
2
|
-
[](https://travis-ci.org/micke/valid_email2)
|
3
2
|
[](http://badge.fury.io/rb/valid_email2)
|
4
3
|
|
5
4
|
Validate emails with the help of the `mail` gem instead of some clunky regexp.
|
@@ -47,10 +46,16 @@ To validate that the domain has an MX record or A record:
|
|
47
46
|
```ruby
|
48
47
|
validates :email, 'valid_email_2/email': { mx: true }
|
49
48
|
```
|
49
|
+
|
50
50
|
To validate strictly that the domain has an MX record:
|
51
51
|
```ruby
|
52
52
|
validates :email, 'valid_email_2/email': { strict_mx: true }
|
53
53
|
```
|
54
|
+
`strict_mx` and `mx` both default to a 5 second timeout for DNS lookups. To
|
55
|
+
override this timeout, specify a `dns_timeout` option:
|
56
|
+
```ruby
|
57
|
+
validates :email, 'valid_email_2/email': { strict_mx: true, dns_timeout: 10 }
|
58
|
+
```
|
54
59
|
|
55
60
|
To validate that the domain is not a disposable email (checks domain and MX server):
|
56
61
|
```ruby
|
@@ -83,7 +88,7 @@ To validate that email is not subaddressed:
|
|
83
88
|
validates :email, 'valid_email_2/email': { disallow_subaddressing: true }
|
84
89
|
```
|
85
90
|
|
86
|
-
To validate that email does not contain a dot before the @:
|
91
|
+
To validate that email does not contain a dot anywhere before the @:
|
87
92
|
```ruby
|
88
93
|
validates :email, 'valid_email_2/email': { disallow_dotted: true }
|
89
94
|
```
|
@@ -124,27 +129,17 @@ It is a good idea to stub out that validation in your test environment.
|
|
124
129
|
Do so by adding this in your `spec_helper`:
|
125
130
|
```ruby
|
126
131
|
config.before(:each) do
|
127
|
-
allow_any_instance_of(ValidEmail2::Address).to
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
Validating `disposable` e-mails triggers a `mx` validation alongside checking if
|
133
|
-
the domain is disposable. The above stub does not apply to the `disposable`
|
134
|
-
validation and should therefore be individually stubbed with:
|
135
|
-
```ruby
|
136
|
-
config.before(:each) do
|
137
|
-
allow_any_instance_of(ValidEmail2::Address).to receive(:mx_server_is_in?).and_return(false)
|
132
|
+
allow_any_instance_of(ValidEmail2::Address).to receive_messages(
|
133
|
+
valid_mx?: true,
|
134
|
+
valid_strict_mx?: true,
|
135
|
+
mx_server_is_in?: false
|
136
|
+
)
|
138
137
|
end
|
139
138
|
```
|
140
139
|
|
141
140
|
## Requirements
|
142
141
|
|
143
|
-
This gem
|
144
|
-
* Ruby-2.5
|
145
|
-
* Ruby-2.6
|
146
|
-
* Ruby-2.7
|
147
|
-
* Ruby-3.0
|
142
|
+
This gem is tested against currently supported Ruby and Rails versions. For an up to date list, check the build matrix in the [workflow](.github/workflows/ci.yaml).
|
148
143
|
|
149
144
|
## Upgrading to v3.0.0
|
150
145
|
|