email_address 0.1.16 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -1
- data/lib/email_address/config.rb +1 -0
- data/lib/email_address/host.rb +4 -6
- data/lib/email_address/version.rb +1 -1
- data/test/email_address/test_address.rb +5 -0
- 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: 8835c0835419dbf67cab6698b47d8641e5839036685727d4e5ed0e455caef6f4
|
4
|
+
data.tar.gz: 553e9787f16788dce7bcff2d9b0d1f962deb03c575b35d2131a93a1c6795fd08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1be9796aa6e245c623b940e0254cd303726439c0382c8f30e4b3d444c97dbd5575bbec5e61745621c1a8e5a39e764dad0b19a1200c64a1187978db8c9664a04
|
7
|
+
data.tar.gz: 7c395ddbacdb048c96b8ceeeed2504ebbf42acc8c68b9d1424811cb22156789f2844704ba2919841065421242830ec180fa13fbd810976f2ea02bec0626c60a3
|
data/README.md
CHANGED
@@ -50,7 +50,7 @@ It does not check:
|
|
50
50
|
By default, MX records are required in DNS. MX or "mail exchanger" records
|
51
51
|
tell where to deliver email for the domain. Many domains run their
|
52
52
|
website on one provider (ISP, Heroku, etc.), and email on a different
|
53
|
-
provider (such as
|
53
|
+
provider (such as G Suite). Note that `example.com`, while
|
54
54
|
a valid domain name, does not have MX records.
|
55
55
|
|
56
56
|
```ruby
|
@@ -248,6 +248,16 @@ EmailAddress.normal("HIRO@こんにちは世界.com")
|
|
248
248
|
EmailAddress.normal("hiro@xn--28j2a3ar1pp75ovm7c.com", host_encoding: :unicode)
|
249
249
|
#=> "hiro@こんにちは世界.com"
|
250
250
|
```
|
251
|
+
As of release 0.1.17, exchanger_match is no longer used for host provider
|
252
|
+
determination, which designated the set of rules for that domain.
|
253
|
+
Sometimes, as in Google-hosted domains, the address
|
254
|
+
rules are different, notably the optional dots in mailboxes for gmail.com
|
255
|
+
accounts do not apply to other private domains hosted at google.
|
256
|
+
|
257
|
+
To access the provider service, you can now call:
|
258
|
+
|
259
|
+
EmailAddress.new("user@hosteddomain.com").host.hosted_provider
|
260
|
+
|
251
261
|
|
252
262
|
#### Rails Validator
|
253
263
|
|
data/lib/email_address/config.rb
CHANGED
data/lib/email_address/host.rb
CHANGED
@@ -217,12 +217,6 @@ module EmailAddress
|
|
217
217
|
|
218
218
|
return set_provider(:default) unless dns_enabled?
|
219
219
|
|
220
|
-
provider = exchangers.provider
|
221
|
-
if provider != :default
|
222
|
-
set_provider(provider,
|
223
|
-
EmailAddress::Config.provider(provider))
|
224
|
-
end
|
225
|
-
|
226
220
|
self.provider ||= set_provider(:default)
|
227
221
|
end
|
228
222
|
|
@@ -238,6 +232,10 @@ module EmailAddress
|
|
238
232
|
tld2: tld2, tld: tld, ip_address: ip_address,}
|
239
233
|
end
|
240
234
|
|
235
|
+
def hosted_provider
|
236
|
+
EmailAddress::Exchanger.cached(dns_name).provider
|
237
|
+
end
|
238
|
+
|
241
239
|
############################################################################
|
242
240
|
# Access and Queries
|
243
241
|
############################################################################
|
@@ -37,6 +37,11 @@ class TestAddress < Minitest::Test
|
|
37
37
|
assert_equal "6bdd00c53645790ad9bbcb50caa93880", EmailAddress.reference("Gmail.User+tag@gmail.com")
|
38
38
|
end
|
39
39
|
|
40
|
+
def test_google_hosted
|
41
|
+
a = EmailAddress.new("Ex.am.ple+tag@boomer.com")
|
42
|
+
assert_equal a.canonical, "ex.am.ple@boomer.com"
|
43
|
+
end
|
44
|
+
|
40
45
|
# COMPARISON & MATCHING
|
41
46
|
def test_compare
|
42
47
|
a = ("User+tag@example.com")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: email_address
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Allen Fair
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|