valid_email2 3.7.0 → 4.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4cb2c121fd6702c7060c30c6b79be1bd4f08c40ed94f06aa3f360c333b28a5d6
4
- data.tar.gz: '09ed3d5c345731baaf90bda8bf5fca432c753277cdd909e19e58feef7525f404'
3
+ metadata.gz: afb90257f63f378fa9e5ad744b1ca65ec0172f73c78e534656b1513c5e8aede6
4
+ data.tar.gz: d087cdefa7ea9c6cb9b6e64e814c5b1c1f8a78d86833998ad00b3c7e23f8c090
5
5
  SHA512:
6
- metadata.gz: 6718851acadedad38dd94c423a9fe84b71469fd9ee14b97687b4400f36edc7f31eeeb2fe63b973a3e451f6bcb3f8fda32f448571d1590e0b23319a78fcff3b7e
7
- data.tar.gz: f794802a5e7e4ee12a5c840e900d167e6d7ccaf3cefce4eaa285cf6b4d3fc100f364c37ebd9a00f4ab9368444745d0bc72e8237e3372f69145c5a471478a6f47
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
@@ -5,6 +5,7 @@
5
5
  .config
6
6
  .yardoc
7
7
  Gemfile.lock
8
+ gemfiles/*.gemfile.lock
8
9
  InstalledFiles
9
10
  _yardoc
10
11
  coverage
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
- [![Build Status](https://travis-ci.org/micke/valid_email2.svg?branch=master)](https://travis-ci.org/micke/valid_email2)
3
2
  [![Gem Version](https://badge.fury.io/rb/valid_email2.png)](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 receive(:valid_mx?).and_return(true)
128
- allow_any_instance_of(ValidEmail2::Address).to receive(:valid_strict_mx?).and_return(true)
129
- end
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 should work with Rails 3.2 or higher. It is tested against Rails 5 and 6 using:
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