email_address 0.2.7 → 0.2.8
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 +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/email_address.gemspec +1 -1
- data/lib/email_address/exchanger.rb +5 -0
- data/lib/email_address/host.rb +5 -1
- data/lib/email_address/local.rb +1 -1
- data/lib/email_address/version.rb +1 -1
- data/test/email_address/test_host.rb +4 -0
- data/test/email_address/test_local.rb +1 -4
- 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: f3e705bb2a1c36387985e1a57fef60ba6eac15c19a540a9383bd04f99faf14b8
|
|
4
|
+
data.tar.gz: 48745aa6d978faf2786dc56ffdddced88443d2c379416e5a5073103920ea23c4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b95ec709cd052735908f4d2a5fd9605ac86e1293331c47eeb1c6b8901b65b0567298fa85dc1382d8821fefa065e91e76797b63b7c1f863002eabd90a76b8eaa1
|
|
7
|
+
data.tar.gz: 1d97b8c973a279f5c62f1959eab5d594275cf441e31ffca3b53bd44081fef77586e30bc9da8b5d351fd40a72c475c7bccae664de91ece9d161c24b64bcc56bbe
|
data/.github/workflows/ci.yml
CHANGED
data/email_address.gemspec
CHANGED
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
|
12
12
|
spec.homepage = "https://github.com/afair/email_address"
|
|
13
13
|
spec.license = "MIT"
|
|
14
14
|
|
|
15
|
-
spec.required_ruby_version = ">= 2.5", "<
|
|
15
|
+
spec.required_ruby_version = ">= 2.5", "< 5.0"
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
18
|
spec.require_paths = ["lib"]
|
data/lib/email_address/host.rb
CHANGED
|
@@ -332,6 +332,10 @@ module EmailAddress
|
|
|
332
332
|
@_dns_a_record ||= []
|
|
333
333
|
end
|
|
334
334
|
|
|
335
|
+
def dns_a_record_exist?
|
|
336
|
+
dns_a_record.size > 0
|
|
337
|
+
end
|
|
338
|
+
|
|
335
339
|
# Returns an array of Exchanger hosts configured in DNS.
|
|
336
340
|
# The array will be empty if none are configured.
|
|
337
341
|
def exchangers
|
|
@@ -404,7 +408,7 @@ module EmailAddress
|
|
|
404
408
|
# True if the host name has a DNS A Record
|
|
405
409
|
def valid_dns?
|
|
406
410
|
return true unless dns_enabled?
|
|
407
|
-
|
|
411
|
+
dns_a_record_exist? || exchangers.exist? || set_error(:domain_unknown)
|
|
408
412
|
end
|
|
409
413
|
|
|
410
414
|
# True if the host name has valid MX servers configured in DNS
|
data/lib/email_address/local.rb
CHANGED
|
@@ -357,8 +357,8 @@ module EmailAddress
|
|
|
357
357
|
# True if the part matches the RFC standard format
|
|
358
358
|
def standard?
|
|
359
359
|
self.syntax = :invalid
|
|
360
|
-
return false unless STANDARD_LOCAL_REGEX.match?(local)
|
|
361
360
|
return false unless valid_size?
|
|
361
|
+
return false unless STANDARD_LOCAL_REGEX.match?(local)
|
|
362
362
|
return false unless valid_encoding?
|
|
363
363
|
self.syntax = :standard
|
|
364
364
|
true
|
|
@@ -102,15 +102,12 @@ class TestLocal < MiniTest::Test
|
|
|
102
102
|
assert EmailAddress.valid?("username_____@gmail.com")
|
|
103
103
|
end
|
|
104
104
|
|
|
105
|
-
def test_tag_punctuation
|
|
106
|
-
assert EmailAddress.valid?("first.last+foo.bar@gmail.com")
|
|
107
|
-
end
|
|
108
|
-
|
|
109
105
|
def test_relaxed_tag
|
|
110
106
|
assert EmailAddress.valid? "foo+abc@example.com", host_validation: :syntax, local_format: :relaxed
|
|
111
107
|
end
|
|
112
108
|
|
|
113
109
|
def test_tag_punctuation
|
|
110
|
+
assert EmailAddress.valid?("first.last+foo.bar@gmail.com")
|
|
114
111
|
refute EmailAddress.valid?("name+tag.@domain.com", host_validation: :syntax)
|
|
115
112
|
assert EmailAddress.valid?("name+tag.-@domain.com", host_validation: :syntax, local_format: :relaxed)
|
|
116
113
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Allen Fair
|
|
@@ -256,14 +256,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
256
256
|
version: '2.5'
|
|
257
257
|
- - "<"
|
|
258
258
|
- !ruby/object:Gem::Version
|
|
259
|
-
version: '
|
|
259
|
+
version: '5.0'
|
|
260
260
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
261
261
|
requirements:
|
|
262
262
|
- - ">="
|
|
263
263
|
- !ruby/object:Gem::Version
|
|
264
264
|
version: '0'
|
|
265
265
|
requirements: []
|
|
266
|
-
rubygems_version:
|
|
266
|
+
rubygems_version: 4.0.3
|
|
267
267
|
specification_version: 4
|
|
268
268
|
summary: This gem provides a ruby language library for working with and validating
|
|
269
269
|
email addresses. By default, it validates against conventional usage, the format
|