truemail 2.4.9 → 2.5.0

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
  SHA256:
3
- metadata.gz: 5fe7168451269d442bab0872d515895af1c79b884ed3306648f4849ce74320b2
4
- data.tar.gz: 9797a040d814da27daa9073e19d984fa50fd033ac83eaffa96bbc5485501471d
3
+ metadata.gz: 515e45301d2ce2c107072aa76fe6384a87b675f76f1116be453f4bfdb6ff2f2a
4
+ data.tar.gz: f21f8a5b3c3fc66d9a236983c010ff497676c7273dbdba81d2a85fee918f041b
5
5
  SHA512:
6
- metadata.gz: 12d6e026591650b65eef26b5aa43b67e2d065e2dcb8f4d8229a6e19567e4162d6eebc41a992d35a8793a21893ea92e55f89de66ce9f35625d5efe466931e1b76
7
- data.tar.gz: 04bed3c49eaf6314a21a33d0e761ca9e8c82671411f96e2b7428202cd3e0225ac4f13fd545202c6898f9328a17466e91cf957c5abfcf03ac8f0bf8801c0dc807
6
+ metadata.gz: 14bbc12149dbbbb9dc575c7af8a4575189e4a49f05cf7335c0acaa65a92cd88a29d347b1c4a486d04e022f5a5ba8748b2881fe002ea0857c07bc28c69c8da85a
7
+ data.tar.gz: f98c6c20dc88c08f7fdad35fa240b989ec62f7928be4b32b98bba178f6645732a028b1c355c1ac5b5b623e144ee1e2524f1e283dabc28a0c5f35a96077f24308
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
4
 
5
+ ## [2.5.0] - 2021.09.01
6
+
7
+ ### Updated
8
+
9
+ Optimized DNS (MX) validation flow. Removed needless DNS request for case when custom email pattern was defined and email for validation includes invalid domain name.
10
+
11
+ - Updated `Truemail::Validate::Mx#run`, tests
12
+ - Updated gem development dependencies
13
+ - Updated gem documentation, version
14
+
5
15
  ## [2.4.9] - 2021.08.20
6
16
 
7
17
  ### Updated
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- truemail (2.4.9)
4
+ truemail (2.5.0)
5
5
  simpleidn (~> 0.2.1)
6
6
 
7
7
  GEM
@@ -8,13 +8,17 @@ module Truemail
8
8
 
9
9
  def run
10
10
  return false unless Truemail::Validate::Regex.check(result)
11
- return true if success(mx_lookup && domain_not_include_null_mx)
11
+ return true if success(email_domain_valid? && mx_lookup && domain_not_include_null_mx)
12
12
  mail_servers.clear && add_error(Truemail::Validate::Mx::ERROR)
13
13
  false
14
14
  end
15
15
 
16
16
  private
17
17
 
18
+ def email_domain_valid?
19
+ Truemail::RegexConstant::REGEX_DOMAIN_PATTERN.match?(result.domain)
20
+ end
21
+
18
22
  def host_extractor_methods
19
23
  return %i[hosts_from_mx_records?] if configuration.not_rfc_mx_lookup_flow
20
24
  %i[hosts_from_mx_records? hosts_from_cname_records? host_from_a_record?]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Truemail
4
- VERSION = '2.4.9'
4
+ VERSION = '2.5.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: truemail
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.9
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladislav Trotsenko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-20 00:00:00.000000000 Z
11
+ date: 2021-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simpleidn