email_address 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/email_address/config.rb +1 -1
- data/lib/email_address/local.rb +4 -2
- data/lib/email_address/version.rb +1 -1
- data/test/email_address/test_host.rb +2 -1
- data/test/email_address/test_local.rb +4 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7db5d5d3abee697033dfef4eae04ab363e15ff1de031a11d0a99057c4ced63ae
|
4
|
+
data.tar.gz: e9a9496562833f2699f5dcbb4def03852f27468e2f292d4a9a86d44654e6d50b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 911ccd6e02bf381a67f78ca14f139b4dc36a4905b4ca784a8e1df969d7bd725c9e679ba92d34b94ecc7038c9b0f39e39e843cac5d533f155874ef526b237d9a5
|
7
|
+
data.tar.gz: aa01ec4b35d46def0fd36c2d5bd59e1e94e65d4d4f10fb9e6dcea8cf7fda14b05ef61b0ab0269e5f7b50a4f60009cbefa16a3634eadfc01219e4d211eff5b102
|
data/lib/email_address/config.rb
CHANGED
@@ -188,7 +188,7 @@ module EmailAddress
|
|
188
188
|
end
|
189
189
|
|
190
190
|
def self.error_message(name, locale = "en")
|
191
|
-
@errors
|
191
|
+
@errors.dig(locale, "email_address", name.to_s) || name.to_s
|
192
192
|
end
|
193
193
|
|
194
194
|
# Customize your own error message text.
|
data/lib/email_address/local.rb
CHANGED
@@ -351,8 +351,10 @@ module EmailAddress
|
|
351
351
|
valid_size? or return false
|
352
352
|
valid_encoding? or return false
|
353
353
|
if tag
|
354
|
-
return false unless mailbox
|
355
|
-
tag
|
354
|
+
return false unless RELAXED_MAILBOX_REGEX.match?(mailbox) &&
|
355
|
+
RELAXED_TAG_REGEX.match?(tag)
|
356
|
+
self.syntax = :relaxed
|
357
|
+
true
|
356
358
|
elsif RELAXED_MAILBOX_REGEX.match?(local)
|
357
359
|
self.syntax = :relaxed
|
358
360
|
true
|
@@ -110,7 +110,8 @@ class TestHost < MiniTest::Test
|
|
110
110
|
end
|
111
111
|
|
112
112
|
def test_hosted_service
|
113
|
-
|
113
|
+
# Is there a gmail-hosted domain that will continue to exist? Removing until then
|
114
|
+
# assert EmailAddress.valid?("test@jiff.com", dns_lookup: :mx)
|
114
115
|
assert !EmailAddress.valid?("test@gmail.com", dns_lookup: :mx)
|
115
116
|
end
|
116
117
|
|
@@ -105,4 +105,8 @@ class TestLocal < MiniTest::Test
|
|
105
105
|
def test_tag_punctuation
|
106
106
|
assert EmailAddress.valid?("first.last+foo.bar@gmail.com")
|
107
107
|
end
|
108
|
+
|
109
|
+
def test_relaxed_tag
|
110
|
+
assert EmailAddress.valid? "foo+abc@example.com", host_validation: :syntax, local_format: :relaxed
|
111
|
+
end
|
108
112
|
end
|
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.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Allen Fair
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
195
|
- !ruby/object:Gem::Version
|
196
196
|
version: '0'
|
197
197
|
requirements: []
|
198
|
-
rubygems_version: 3.2.
|
198
|
+
rubygems_version: 3.2.22
|
199
199
|
signing_key:
|
200
200
|
specification_version: 4
|
201
201
|
summary: This gem provides a ruby language library for working with and validating
|