valid_email2 5.0.5 → 5.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/config/disposable_email_domains.txt +0 -3
- data/lib/valid_email2/email_validator.rb +3 -1
- data/lib/valid_email2/version.rb +1 -1
- data/pull_mailchecker_emails.rb +1 -1
- data/spec/valid_email2_spec.rb +33 -7
- 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: 925627af7072ddf7e2f82482253520d9bef1111e605317106afbf84b951c5a57
|
4
|
+
data.tar.gz: 7eb5251aa7f5cf9e2bcd24c63f23fb45ea6770581d8e1ceebf00933f64f24498
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f02e361ed0c985a4f770a09222fef9179de6a9f01995ac84c57ae6b9a843172afaf80116d01dc1ad9a9b5959dfcc6a089ce5b2ea2d6340701308b8e3b8a9817
|
7
|
+
data.tar.gz: f05c620994e0aaf353dfc4227cc317d20d2bd9be59e1b85ba4ab70db5d0cf0522ed939dab7fff625ad5701c710da33f037ba37e44123d9f1989b14b3faa64980
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## Version 5.1.1
|
2
|
+
* Remove false positives [#223](https://github.com/micke/valid_email2/issues/223)
|
3
|
+
|
4
|
+
## Version 5.1.0
|
5
|
+
* Allow dynamic validaton error messages [#221](https://github.com/micke/valid_email2/pull/221)
|
6
|
+
|
1
7
|
## Version 5.0.5
|
2
8
|
* Remove false positive duck.com
|
3
9
|
|
@@ -8565,7 +8565,6 @@
|
|
8565
8565
|
8a818.club
|
8566
8566
|
8a9itx.online
|
8567
8567
|
8aj.net
|
8568
|
-
8alias.com
|
8569
8568
|
8americain.fr
|
8570
8569
|
8angue9wtjv4dwa9.com
|
8571
8570
|
8avz.net
|
@@ -8708,7 +8707,6 @@
|
|
8708
8707
|
8rskf3xpyq.ml
|
8709
8708
|
8rskf3xpyq.tk
|
8710
8709
|
8rygn.com
|
8711
|
-
8shield.net
|
8712
8710
|
8t0sznngp6aowxsrj.cf
|
8713
8711
|
8t0sznngp6aowxsrj.ga
|
8714
8712
|
8t0sznngp6aowxsrj.gq
|
@@ -45553,7 +45551,6 @@ drakeslansdowne.com
|
|
45553
45551
|
drakor.pro
|
45554
45552
|
drakorfor.me
|
45555
45553
|
draktar.online
|
45556
|
-
dralias.com
|
45557
45554
|
dralselahi.com
|
45558
45555
|
dram.network
|
45559
45556
|
drama.tw
|
@@ -66,7 +66,9 @@ module ValidEmail2
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def error(record, attribute)
|
69
|
-
|
69
|
+
message = options[:message].respond_to?(:call) ? options[:message].call : options[:message]
|
70
|
+
|
71
|
+
record.errors.add(attribute, message || :invalid)
|
70
72
|
end
|
71
73
|
end
|
72
74
|
end
|
data/lib/valid_email2/version.rb
CHANGED
data/pull_mailchecker_emails.rb
CHANGED
@@ -13,7 +13,7 @@ whitelisted_emails = %w(
|
|
13
13
|
zoho.com zoho.in simplelogin.com simplelogin.fr simplelogin.co
|
14
14
|
simplelogin.io aleeas.com slmails.com silomails.com slmail.me
|
15
15
|
passinbox.com passfwd.com passmail.com passmail.net
|
16
|
-
duck.com mozmail.com
|
16
|
+
duck.com mozmail.com dralias.com 8alias.com 8shield.net
|
17
17
|
)
|
18
18
|
|
19
19
|
existing_emails = File.open("config/disposable_email_domains.txt") { |f| f.read.split("\n") }
|
data/spec/valid_email2_spec.rb
CHANGED
@@ -47,6 +47,14 @@ class TestUserMessage < TestModel
|
|
47
47
|
validates :email, 'valid_email_2/email': { message: "custom message" }
|
48
48
|
end
|
49
49
|
|
50
|
+
class TestUserMessageWithLambda < TestModel
|
51
|
+
validates :email, 'valid_email_2/email': { message: -> { "custom message lambda" } }
|
52
|
+
end
|
53
|
+
|
54
|
+
class TestUserMessageWithProc < TestModel
|
55
|
+
validates :email, 'valid_email_2/email': { message: Proc.new { "custom message proc" } }
|
56
|
+
end
|
57
|
+
|
50
58
|
class TestUserMultiple < TestModel
|
51
59
|
validates :email, 'valid_email_2/email': { multiple: true }
|
52
60
|
end
|
@@ -188,11 +196,11 @@ describe ValidEmail2 do
|
|
188
196
|
let(:whitelist_domain) { disposable_domain }
|
189
197
|
let(:whitelist_file_path) { "config/whitelisted_email_domains.yml" }
|
190
198
|
|
191
|
-
# Some of the specs below need to explictly set the whitelist var or it
|
199
|
+
# Some of the specs below need to explictly set the whitelist var or it
|
192
200
|
# may be cached to an empty set
|
193
201
|
def set_whitelist
|
194
202
|
ValidEmail2.instance_variable_set(
|
195
|
-
:@whitelist,
|
203
|
+
:@whitelist,
|
196
204
|
ValidEmail2.send(:load_if_exists, ValidEmail2::WHITELIST_FILE)
|
197
205
|
)
|
198
206
|
end
|
@@ -308,11 +316,29 @@ describe ValidEmail2 do
|
|
308
316
|
end
|
309
317
|
end
|
310
318
|
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
319
|
+
context "when message is present" do
|
320
|
+
describe "with custom error message" do
|
321
|
+
it "supports settings a custom error message" do
|
322
|
+
user = TestUserMessage.new(email: "fakeemail")
|
323
|
+
user.valid?
|
324
|
+
expect(user.errors.full_messages).to include("Email custom message")
|
325
|
+
end
|
326
|
+
end
|
327
|
+
|
328
|
+
describe "with custom error message lambda" do
|
329
|
+
it "supports settings a custom error message lambda" do
|
330
|
+
user = TestUserMessageWithLambda.new(email: "fakeemail")
|
331
|
+
user.valid?
|
332
|
+
expect(user.errors.full_messages).to include("Email custom message lambda")
|
333
|
+
end
|
334
|
+
end
|
335
|
+
|
336
|
+
describe "with custom error message proc" do
|
337
|
+
it "supports settings a custom error message proc" do
|
338
|
+
user = TestUserMessageWithProc.new(email: "fakeemail")
|
339
|
+
user.valid?
|
340
|
+
expect(user.errors.full_messages).to include("Email custom message proc")
|
341
|
+
end
|
316
342
|
end
|
317
343
|
end
|
318
344
|
|
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: 5.
|
4
|
+
version: 5.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micke Lisinge
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|