truemail 2.4.6 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b2201740b5ebff1faab259b9fc6f824c3a1d35ae09c7e39ad1a12ec669acfaa
4
- data.tar.gz: ee1d67e7ce06d83f314f0e1bb3cb74c184ce5299e25d1dcc8303f34d07121e9f
3
+ metadata.gz: 515e45301d2ce2c107072aa76fe6384a87b675f76f1116be453f4bfdb6ff2f2a
4
+ data.tar.gz: f21f8a5b3c3fc66d9a236983c010ff497676c7273dbdba81d2a85fee918f041b
5
5
  SHA512:
6
- metadata.gz: d778d06f21cd3c6fac2fc346ef576a060e47f502e1f83d1c06533c2857785f7589b85a0762cd0692ad18b0520cb44531840821dd986eb1ff3d687b90e524ac7f
7
- data.tar.gz: d493f1b19593721bf6d7c86c2a7534a4a6a856642a095b213746b44a4e7e4c99e1cde52d6f026bdbdbd1613176edfad904497159bd8e5756729d5b7e162a64ad
6
+ metadata.gz: 14bbc12149dbbbb9dc575c7af8a4575189e4a49f05cf7335c0acaa65a92cd88a29d347b1c4a486d04e022f5a5ba8748b2881fe002ea0857c07bc28c69c8da85a
7
+ data.tar.gz: f98c6c20dc88c08f7fdad35fa240b989ec62f7928be4b32b98bba178f6645732a028b1c355c1ac5b5b623e144ee1e2524f1e283dabc28a0c5f35a96077f24308
data/.codeclimate.yml CHANGED
@@ -7,7 +7,7 @@ checks:
7
7
  plugins:
8
8
  rubocop:
9
9
  enabled: true
10
- channel: rubocop-1-18
10
+ channel: rubocop-1-19
11
11
 
12
12
  reek:
13
13
  enabled: true
data/.rubocop.yml CHANGED
@@ -166,6 +166,9 @@ Style/MultilineInPatternThen:
166
166
  Style/QuotedSymbols:
167
167
  Enabled: true
168
168
 
169
+ Style/RedundantSelfAssignmentBranch:
170
+ Enabled: true
171
+
169
172
  Layout/LineLength:
170
173
  Max: 140
171
174
 
@@ -326,6 +329,9 @@ Lint/TripleQuotes:
326
329
  Lint/EmptyInPattern:
327
330
  Enabled: true
328
331
 
332
+ Lint/AmbiguousRange:
333
+ Enabled: true
334
+
329
335
  Gemspec/DateAssignment:
330
336
  Enabled: true
331
337
 
data/CHANGELOG.md CHANGED
@@ -2,6 +2,45 @@
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
+
15
+ ## [2.4.9] - 2021.08.20
16
+
17
+ ### Updated
18
+
19
+ - Updated `Truemail::Validate::DomainListMatch#email_domain`, tests
20
+ - Updated `Truemail::Validate::Mx#domain`, tests
21
+ - Updated gem development dependencies
22
+ - Updated gem version
23
+
24
+ ## [2.4.8] - 2021.08.12
25
+
26
+ ### Updated
27
+
28
+ - Updated gem development dependencies
29
+ - Updated gem version
30
+
31
+ ### Changed
32
+
33
+ - `faker` to `ffaker` development dependency
34
+
35
+ ## [2.4.7] - 2021.08.09
36
+
37
+ ### Updated
38
+
39
+ - Updated gem codebase, refactored `Truemail::ContextHelper`
40
+ - Updated tests with `Truemail::DnsHelper#dns_mock_gateway`
41
+ - Updated gem development dependencies
42
+ - Updated gem version
43
+
5
44
  ## [2.4.6] - 2021.07.10
6
45
 
7
46
  ### Fixed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- truemail (2.4.6)
4
+ truemail (2.5.0)
5
5
  simpleidn (~> 0.2.1)
6
6
 
7
7
  GEM
@@ -17,20 +17,17 @@ GEM
17
17
  childprocess (4.1.0)
18
18
  coderay (1.1.3)
19
19
  colorize (0.8.1)
20
- concurrent-ruby (1.1.9)
21
20
  crack (0.4.5)
22
21
  rexml
23
22
  diff-lcs (1.4.4)
24
- dns_mock (1.3.1)
23
+ dns_mock (1.4.1)
24
+ simpleidn (~> 0.2.1)
25
25
  docile (1.4.0)
26
- faker (2.18.0)
27
- i18n (>= 1.6, < 2)
28
26
  fasterer (0.9.0)
29
27
  colorize (~> 0.7)
30
28
  ruby_parser (>= 3.14.1)
29
+ ffaker (2.19.0)
31
30
  hashdiff (1.0.1)
32
- i18n (1.8.10)
33
- concurrent-ruby (~> 1.0)
34
31
  iniparse (1.5.0)
35
32
  json (2.5.1)
36
33
  json_matchers (0.11.1)
@@ -51,14 +48,12 @@ GEM
51
48
  pry-byebug (3.9.0)
52
49
  byebug (~> 11.0)
53
50
  pry (~> 0.13.0)
54
- psych (3.3.2)
55
51
  public_suffix (4.0.6)
56
52
  rainbow (3.0.0)
57
53
  rake (13.0.6)
58
- reek (6.0.4)
54
+ reek (6.0.6)
59
55
  kwalify (~> 0.7.0)
60
56
  parser (~> 3.0.0)
61
- psych (~> 3.1)
62
57
  rainbow (>= 2.0, < 4.0)
63
58
  regexp_parser (2.1.1)
64
59
  rexml (3.2.5)
@@ -75,25 +70,25 @@ GEM
75
70
  diff-lcs (>= 1.2.0, < 2.0)
76
71
  rspec-support (~> 3.10.0)
77
72
  rspec-support (3.10.2)
78
- rubocop (1.18.3)
73
+ rubocop (1.19.1)
79
74
  parallel (~> 1.10)
80
75
  parser (>= 3.0.0.0)
81
76
  rainbow (>= 2.2.2, < 4.0)
82
77
  regexp_parser (>= 1.8, < 3.0)
83
78
  rexml
84
- rubocop-ast (>= 1.7.0, < 2.0)
79
+ rubocop-ast (>= 1.9.1, < 2.0)
85
80
  ruby-progressbar (~> 1.7)
86
81
  unicode-display_width (>= 1.4.0, < 3.0)
87
- rubocop-ast (1.7.0)
82
+ rubocop-ast (1.10.0)
88
83
  parser (>= 3.0.1.1)
89
- rubocop-performance (1.11.4)
84
+ rubocop-performance (1.11.5)
90
85
  rubocop (>= 1.7.0, < 2.0)
91
86
  rubocop-ast (>= 0.4.0)
92
87
  rubocop-rspec (2.4.0)
93
88
  rubocop (~> 1.0)
94
89
  rubocop-ast (>= 1.1.0)
95
90
  ruby-progressbar (1.11.0)
96
- ruby_parser (3.16.0)
91
+ ruby_parser (3.17.0)
97
92
  sexp_processor (~> 4.15, >= 4.15.1)
98
93
  sexp_processor (4.15.3)
99
94
  simplecov (0.17.1)
@@ -104,16 +99,16 @@ GEM
104
99
  simpleidn (0.2.1)
105
100
  unf (~> 0.1.4)
106
101
  thor (1.1.0)
107
- truemail-rspec (0.6.0)
108
- faker (~> 2.17)
102
+ truemail-rspec (0.7.0)
103
+ ffaker (~> 2.18)
109
104
  rspec (~> 3.10)
110
105
  truemail (>= 2.4)
111
106
  unf (0.1.4)
112
107
  unf_ext
113
108
  unf_ext (0.0.7.7)
114
109
  unicode-display_width (2.0.0)
115
- webmock (3.13.0)
116
- addressable (>= 2.3.6)
110
+ webmock (3.14.0)
111
+ addressable (>= 2.8.0)
117
112
  crack (>= 0.3.2)
118
113
  hashdiff (>= 0.4.0, < 2.0.0)
119
114
 
@@ -121,24 +116,24 @@ PLATFORMS
121
116
  x86_64-darwin-20
122
117
 
123
118
  DEPENDENCIES
124
- bundler (~> 2.2, >= 2.2.23)
119
+ bundler (~> 2.2, >= 2.2.26)
125
120
  bundler-audit (~> 0.8.0)
126
- dns_mock (~> 1.3, >= 1.3.1)
127
- faker (~> 2.18)
121
+ dns_mock (~> 1.4, >= 1.4.1)
128
122
  fasterer (~> 0.9.0)
123
+ ffaker (~> 2.19)
129
124
  json_matchers (~> 0.11.1)
130
125
  overcommit (~> 0.58.0)
131
126
  pry-byebug (~> 3.9)
132
127
  rake (~> 13.0, >= 13.0.6)
133
- reek (~> 6.0, >= 6.0.4)
128
+ reek (~> 6.0, >= 6.0.6)
134
129
  rspec (~> 3.10)
135
- rubocop (~> 1.18, >= 1.18.3)
136
- rubocop-performance (~> 1.11, >= 1.11.4)
130
+ rubocop (~> 1.19, >= 1.19.1)
131
+ rubocop-performance (~> 1.11, >= 1.11.5)
137
132
  rubocop-rspec (~> 2.4)
138
133
  simplecov (~> 0.17.1)
139
134
  truemail!
140
- truemail-rspec (~> 0.6)
141
- webmock (~> 3.13)
135
+ truemail-rspec (~> 0.7.0)
136
+ webmock (~> 3.14)
142
137
 
143
138
  BUNDLED WITH
144
- 2.2.23
139
+ 2.2.26
@@ -15,7 +15,8 @@ module Truemail
15
15
  private
16
16
 
17
17
  def email_domain
18
- @email_domain ||= result.email[Truemail::RegexConstant::REGEX_DOMAIN_FROM_EMAIL, 1]
18
+ @email_domain ||=
19
+ result.domain = result.email[Truemail::RegexConstant::REGEX_DOMAIN_FROM_EMAIL, 1]
19
20
  end
20
21
 
21
22
  def whitelisted_domain?
@@ -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?]
@@ -52,10 +56,7 @@ module Truemail
52
56
  end
53
57
 
54
58
  def domain
55
- @domain ||= begin
56
- result.domain = result.email[Truemail::RegexConstant::REGEX_DOMAIN_FROM_EMAIL, 1]
57
- result.punycode_email[Truemail::RegexConstant::REGEX_DOMAIN_FROM_EMAIL, 1]
58
- end
59
+ @domain ||= result.punycode_email[Truemail::RegexConstant::REGEX_DOMAIN_FROM_EMAIL, 1]
59
60
  end
60
61
 
61
62
  def hosts_from_mx_records?
@@ -35,7 +35,7 @@ module Truemail
35
35
  def attempts
36
36
  @attempts ||= begin
37
37
  return {} if fail_fast? || !mail_servers.one?
38
- { attempts: configuration.connection_attempts }
38
+ { attempts: configuration.connection_attempts } # attempts should used for case with one mail server only
39
39
  end
40
40
  end
41
41
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Truemail
4
- VERSION = '2.4.6'
4
+ VERSION = '2.5.0'
5
5
  end
data/truemail.gemspec CHANGED
@@ -33,21 +33,21 @@ Gem::Specification.new do |spec|
33
33
 
34
34
  spec.add_runtime_dependency 'simpleidn', '~> 0.2.1'
35
35
 
36
- spec.add_development_dependency 'bundler', '~> 2.2', '>= 2.2.23'
36
+ spec.add_development_dependency 'bundler', '~> 2.2', '>= 2.2.26'
37
37
  spec.add_development_dependency 'bundler-audit', '~> 0.8.0'
38
- spec.add_development_dependency 'dns_mock', '~> 1.3', '>= 1.3.1'
39
- spec.add_development_dependency 'faker', '~> 2.18'
38
+ spec.add_development_dependency 'dns_mock', '~> 1.4', '>= 1.4.1'
40
39
  spec.add_development_dependency 'fasterer', '~> 0.9.0'
40
+ spec.add_development_dependency 'ffaker', '~> 2.19'
41
41
  spec.add_development_dependency 'json_matchers', '~> 0.11.1'
42
42
  spec.add_development_dependency 'overcommit', '~> 0.58.0'
43
43
  spec.add_development_dependency 'pry-byebug', '~> 3.9'
44
44
  spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
45
- spec.add_development_dependency 'reek', '~> 6.0', '>= 6.0.4'
45
+ spec.add_development_dependency 'reek', '~> 6.0', '>= 6.0.6'
46
46
  spec.add_development_dependency 'rspec', '~> 3.10'
47
- spec.add_development_dependency 'rubocop', '~> 1.18', '>= 1.18.3'
48
- spec.add_development_dependency 'rubocop-performance', '~> 1.11', '>= 1.11.4'
47
+ spec.add_development_dependency 'rubocop', '~> 1.19', '>= 1.19.1'
48
+ spec.add_development_dependency 'rubocop-performance', '~> 1.11', '>= 1.11.5'
49
49
  spec.add_development_dependency 'rubocop-rspec', '~> 2.4'
50
50
  spec.add_development_dependency 'simplecov', '~> 0.17.1'
51
- spec.add_development_dependency 'truemail-rspec', '~> 0.6'
52
- spec.add_development_dependency 'webmock', '~> 3.13'
51
+ spec.add_development_dependency 'truemail-rspec', '~> 0.7.0'
52
+ spec.add_development_dependency 'webmock', '~> 3.14'
53
53
  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.6
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-07-10 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
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '2.2'
34
34
  - - ">="
35
35
  - !ruby/object:Gem::Version
36
- version: 2.2.23
36
+ version: 2.2.26
37
37
  type: :development
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '2.2'
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 2.2.23
46
+ version: 2.2.26
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler-audit
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -64,48 +64,48 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '1.3'
67
+ version: '1.4'
68
68
  - - ">="
69
69
  - !ruby/object:Gem::Version
70
- version: 1.3.1
70
+ version: 1.4.1
71
71
  type: :development
72
72
  prerelease: false
73
73
  version_requirements: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - "~>"
76
76
  - !ruby/object:Gem::Version
77
- version: '1.3'
77
+ version: '1.4'
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
- version: 1.3.1
80
+ version: 1.4.1
81
81
  - !ruby/object:Gem::Dependency
82
- name: faker
82
+ name: fasterer
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: '2.18'
87
+ version: 0.9.0
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: '2.18'
94
+ version: 0.9.0
95
95
  - !ruby/object:Gem::Dependency
96
- name: fasterer
96
+ name: ffaker
97
97
  requirement: !ruby/object:Gem::Requirement
98
98
  requirements:
99
99
  - - "~>"
100
100
  - !ruby/object:Gem::Version
101
- version: 0.9.0
101
+ version: '2.19'
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
106
  - - "~>"
107
107
  - !ruby/object:Gem::Version
108
- version: 0.9.0
108
+ version: '2.19'
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: json_matchers
111
111
  requirement: !ruby/object:Gem::Requirement
@@ -177,7 +177,7 @@ dependencies:
177
177
  version: '6.0'
178
178
  - - ">="
179
179
  - !ruby/object:Gem::Version
180
- version: 6.0.4
180
+ version: 6.0.6
181
181
  type: :development
182
182
  prerelease: false
183
183
  version_requirements: !ruby/object:Gem::Requirement
@@ -187,7 +187,7 @@ dependencies:
187
187
  version: '6.0'
188
188
  - - ">="
189
189
  - !ruby/object:Gem::Version
190
- version: 6.0.4
190
+ version: 6.0.6
191
191
  - !ruby/object:Gem::Dependency
192
192
  name: rspec
193
193
  requirement: !ruby/object:Gem::Requirement
@@ -208,20 +208,20 @@ dependencies:
208
208
  requirements:
209
209
  - - "~>"
210
210
  - !ruby/object:Gem::Version
211
- version: '1.18'
211
+ version: '1.19'
212
212
  - - ">="
213
213
  - !ruby/object:Gem::Version
214
- version: 1.18.3
214
+ version: 1.19.1
215
215
  type: :development
216
216
  prerelease: false
217
217
  version_requirements: !ruby/object:Gem::Requirement
218
218
  requirements:
219
219
  - - "~>"
220
220
  - !ruby/object:Gem::Version
221
- version: '1.18'
221
+ version: '1.19'
222
222
  - - ">="
223
223
  - !ruby/object:Gem::Version
224
- version: 1.18.3
224
+ version: 1.19.1
225
225
  - !ruby/object:Gem::Dependency
226
226
  name: rubocop-performance
227
227
  requirement: !ruby/object:Gem::Requirement
@@ -231,7 +231,7 @@ dependencies:
231
231
  version: '1.11'
232
232
  - - ">="
233
233
  - !ruby/object:Gem::Version
234
- version: 1.11.4
234
+ version: 1.11.5
235
235
  type: :development
236
236
  prerelease: false
237
237
  version_requirements: !ruby/object:Gem::Requirement
@@ -241,7 +241,7 @@ dependencies:
241
241
  version: '1.11'
242
242
  - - ">="
243
243
  - !ruby/object:Gem::Version
244
- version: 1.11.4
244
+ version: 1.11.5
245
245
  - !ruby/object:Gem::Dependency
246
246
  name: rubocop-rspec
247
247
  requirement: !ruby/object:Gem::Requirement
@@ -276,28 +276,28 @@ dependencies:
276
276
  requirements:
277
277
  - - "~>"
278
278
  - !ruby/object:Gem::Version
279
- version: '0.6'
279
+ version: 0.7.0
280
280
  type: :development
281
281
  prerelease: false
282
282
  version_requirements: !ruby/object:Gem::Requirement
283
283
  requirements:
284
284
  - - "~>"
285
285
  - !ruby/object:Gem::Version
286
- version: '0.6'
286
+ version: 0.7.0
287
287
  - !ruby/object:Gem::Dependency
288
288
  name: webmock
289
289
  requirement: !ruby/object:Gem::Requirement
290
290
  requirements:
291
291
  - - "~>"
292
292
  - !ruby/object:Gem::Version
293
- version: '3.13'
293
+ version: '3.14'
294
294
  type: :development
295
295
  prerelease: false
296
296
  version_requirements: !ruby/object:Gem::Requirement
297
297
  requirements:
298
298
  - - "~>"
299
299
  - !ruby/object:Gem::Version
300
- version: '3.13'
300
+ version: '3.14'
301
301
  description: Configurable framework agnostic plain Ruby email validator. Verify email
302
302
  via Regex, DNS, SMTP and even more.
303
303
  email: