email_assessor 0.4.0 → 0.4.1

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
  SHA1:
3
- metadata.gz: '09a529bf8a39b92c150db28f3f06c85970f7aca6'
4
- data.tar.gz: 14f6ff9650eda37cc4cfca928e36d686d699f6f9
3
+ metadata.gz: b63422ec99516f62c74828fb9d3c668c61f8a83c
4
+ data.tar.gz: 17591dd48eadba786d774b4fc84b5cd53a47c98b
5
5
  SHA512:
6
- metadata.gz: cf0e58b5da7ad12a4d6baf7f3ae28e91d2af487443602f24d18f275db72556c80969d0367b3f02e665505ce5f275d994dba9063d0766d76aca9fafcc122b014e
7
- data.tar.gz: 2420d6532fa6c2bdac33b78c09e38afa5d92c9e500329fac173a113dc6db37d1de8717afca4ca1f35c122172f55212297267e3339c3a7ae8cd95cf732da8c13a
6
+ metadata.gz: e67870d0ffcc553ab906c9201dca49aa0d770139ea4623fe6521e7a5ad7e3e0b0b610e6a89afa69261d9ae40bde3659280d0414e45adf29cd0f94bb13fedde7b
7
+ data.tar.gz: 11a74b6d657c07e22f4a4d621d9e165d5dca4cec5a1e1d3350647d87ac6f6ead592ad1f78a1579dab1796a389cff523d35895c92108d1894144da5ee14cfb0d0
@@ -1,5 +1,5 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem "activemodel", "~> 4.2.0"
3
+ gem "activemodel", "~> 5.0.2"
4
4
 
5
5
  gemspec path: "../"
@@ -18,6 +18,6 @@ module EmailAssessor
18
18
  file_name ||= ""
19
19
  domain = domain.downcase
20
20
 
21
- File.open(file_name).each_line.any? { |line| domain.match?(%r{\A(?:.+\.)*?#{line.chomp}\z}i) }
21
+ File.foreach(file_name).any? { |line| domain.end_with?(line.chomp) }
22
22
  end
23
23
  end
@@ -1,3 +1,3 @@
1
1
  module EmailAssessor
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -5,7 +5,7 @@ require "yaml"
5
5
  require "json"
6
6
  require "net/http"
7
7
 
8
- whitelisted_domains = %w(poczta.onet.pl fastmail.fm hushmail.com naver.com qq.com)
8
+ whitelisted_domains = %w(poczta.onet.pl fastmail.fm hushmail.com naver.com qq.com nus.edu.sg)
9
9
 
10
10
  existing_domains = File.readlines("vendor/disposable_domains.txt")
11
11
 
@@ -74,6 +74,11 @@ describe EmailAssessor do
74
74
  is_expected.to be_invalid
75
75
  end
76
76
 
77
+ it "should be invalid when email is in the list of disposable domains regardless of case" do
78
+ user.email = "foo@#{disposable_domain.upcase}"
79
+ is_expected.to be_invalid
80
+ end
81
+
77
82
  it "should be invalid when email is in the list of disposable domains regardless of subdomain" do
78
83
  user.email = "foo@abc123.#{disposable_domain}"
79
84
  is_expected.to be_invalid
@@ -92,6 +97,11 @@ describe EmailAssessor do
92
97
  is_expected.to be_invalid
93
98
  end
94
99
 
100
+ it "should be invalid when email is in the blacklist regardless of case" do
101
+ user.email = "foo@#{blacklisted_domain.upcase}"
102
+ is_expected.to be_invalid
103
+ end
104
+
95
105
  it "should be invalid when email domain is in the blacklist regardless of subdomain" do
96
106
  user.email = "foo@abc123.#{blacklisted_domain}"
97
107
  is_expected.to be_invalid
@@ -48,6 +48,7 @@
48
48
  20mail.eu
49
49
  20mail.in
50
50
  20mail.it
51
+ 20minute.email
51
52
  20minutemail.com
52
53
  2120001.net
53
54
  21cn.com
@@ -1087,10 +1088,10 @@ maildrop.ml
1087
1088
  maildu.de
1088
1089
  maildx.com
1089
1090
  maileater.com
1090
- maileme101.com
1091
1091
  mailed.in
1092
1092
  mailed.ro
1093
1093
  maileimer.de
1094
+ maileme101.com
1094
1095
  mailexpire.com
1095
1096
  mailfa.tk
1096
1097
  mailforspam.com
@@ -1384,6 +1385,7 @@ pisls.com
1384
1385
  pjjkp.com
1385
1386
  plexolan.de
1386
1387
  plhk.ru
1388
+ ploae.com
1387
1389
  plw.me
1388
1390
  po.bot.nu
1389
1391
  poh.pp.ua
@@ -1444,6 +1446,7 @@ randomail.net
1444
1446
  raqid.com
1445
1447
  rax.la
1446
1448
  raxtest.com
1449
+ rcasd.com
1447
1450
  rcpt.at
1448
1451
  rcs.gaggle.net
1449
1452
  reallymymail.com
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: email_assessor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Wolfe Millard
@@ -95,7 +95,6 @@ files:
95
95
  - README.md
96
96
  - Rakefile
97
97
  - email_assessor.gemspec
98
- - gemfiles/activemodel3.gemfile
99
98
  - gemfiles/activemodel4.gemfile
100
99
  - lib/email_assessor.rb
101
100
  - lib/email_assessor/address.rb
@@ -1,5 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "activemodel", "~> 3.2.13"
4
-
5
- gemspec path: "../"