truemail 2.4.5 → 2.4.9

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: ab60bc15dde3624894487439f95781eb83a963954b32370f1f64a4a750ce2895
4
- data.tar.gz: cf9ebab60730796e864bd5a0626bf66162b46060d475aaf6d38536f7307d7e09
3
+ metadata.gz: 5fe7168451269d442bab0872d515895af1c79b884ed3306648f4849ce74320b2
4
+ data.tar.gz: 9797a040d814da27daa9073e19d984fa50fd033ac83eaffa96bbc5485501471d
5
5
  SHA512:
6
- metadata.gz: 690463e2659813d51b72bdb29e8ae543395f4b8d8c42dbe2d2b4e47d32391a3eab7118911a968c1801afc55078420d9968b1af96dc86bf902a5326fad2a2034e
7
- data.tar.gz: 7cdc49f89121810be4623cb1cd00a9ba29aa9ef0b2f73e0ab7ea87da20ddc8c9273876223923948cba63616e4d29fa298175b525dcca1b46897b00fad712621a
6
+ metadata.gz: 12d6e026591650b65eef26b5aa43b67e2d065e2dcb8f4d8229a6e19567e4162d6eebc41a992d35a8793a21893ea92e55f89de66ce9f35625d5efe466931e1b76
7
+ data.tar.gz: 04bed3c49eaf6314a21a33d0e761ca9e8c82671411f96e2b7428202cd3e0225ac4f13fd545202c6898f9328a17466e91cf957c5abfcf03ac8f0bf8801c0dc807
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,46 @@
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.4.9] - 2021.08.20
6
+
7
+ ### Updated
8
+
9
+ - Updated `Truemail::Validate::DomainListMatch#email_domain`, tests
10
+ - Updated `Truemail::Validate::Mx#domain`, tests
11
+ - Updated gem development dependencies
12
+ - Updated gem version
13
+
14
+ ## [2.4.8] - 2021.08.12
15
+
16
+ ### Updated
17
+
18
+ - Updated gem development dependencies
19
+ - Updated gem version
20
+
21
+ ### Changed
22
+
23
+ - `faker` to `ffaker` development dependency
24
+
25
+ ## [2.4.7] - 2021.08.09
26
+
27
+ ### Updated
28
+
29
+ - Updated gem codebase, refactored `Truemail::ContextHelper`
30
+ - Updated tests with `Truemail::DnsHelper#dns_mock_gateway`
31
+ - Updated gem development dependencies
32
+ - Updated gem version
33
+
34
+ ## [2.4.6] - 2021.07.10
35
+
36
+ ### Fixed
37
+
38
+ - Wrong domain punycode extraction in DNS validation layer
39
+
40
+ ### Updated
41
+
42
+ - Updated gem codebase, restored `Truemail::RegexConstant::REGEX_DOMAIN_FROM_EMAIL`
43
+ - Updated tests
44
+
5
45
  ## [2.4.5] - 2021.07.09
6
46
 
7
47
  ### Removed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- truemail (2.4.5)
4
+ truemail (2.4.9)
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
data/lib/truemail/core.rb CHANGED
@@ -22,6 +22,7 @@ module Truemail
22
22
  REGEX_DOMAIN = /[\p{L}0-9]+([\-.]{1}[\p{L}0-9]+)*\.\p{L}{2,63}/i.freeze
23
23
  REGEX_EMAIL_PATTERN = /(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\W\w]*)@(#{REGEX_DOMAIN})\z)/.freeze
24
24
  REGEX_DOMAIN_PATTERN = /(?=\A.{4,255}\z)(\A#{REGEX_DOMAIN}\z)/.freeze
25
+ REGEX_DOMAIN_FROM_EMAIL = /\A.+@(.+)\z/.freeze
25
26
  REGEX_SMTP_ERROR_BODY_PATTERN = /(?=.*550)(?=.*(user|account|customer|mailbox)).*/i.freeze
26
27
  REGEX_IP_ADDRESS = /((1\d|[1-9]|2[0-4])?\d|25[0-5])(\.\g<1>){3}/.freeze
27
28
  REGEX_IP_ADDRESS_PATTERN = /\A#{REGEX_IP_ADDRESS}\z/.freeze
@@ -15,7 +15,8 @@ module Truemail
15
15
  private
16
16
 
17
17
  def email_domain
18
- @email_domain ||= result.email[Truemail::RegexConstant::REGEX_EMAIL_PATTERN, 3]
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?
@@ -52,10 +52,7 @@ module Truemail
52
52
  end
53
53
 
54
54
  def domain
55
- @domain ||= begin
56
- result.domain = result.email[Truemail::RegexConstant::REGEX_EMAIL_PATTERN, 3]
57
- result.punycode_email[Truemail::RegexConstant::REGEX_EMAIL_PATTERN, 3]
58
- end
55
+ @domain ||= result.punycode_email[Truemail::RegexConstant::REGEX_DOMAIN_FROM_EMAIL, 1]
59
56
  end
60
57
 
61
58
  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
 
@@ -50,7 +50,7 @@ module Truemail
50
50
  REQUEST_PARAMS = %i[connection_timeout response_timeout verifier_domain verifier_email].freeze
51
51
 
52
52
  def initialize(configuration)
53
- REQUEST_PARAMS.each do |attribute|
53
+ Truemail::Validate::Smtp::Request::Configuration::REQUEST_PARAMS.each do |attribute|
54
54
  self.class.class_eval { attr_reader attribute }
55
55
  instance_variable_set(:"@#{attribute}", configuration.public_send(attribute))
56
56
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Truemail
4
- VERSION = '2.4.5'
4
+ VERSION = '2.4.9'
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.5
4
+ version: 2.4.9
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-09 00:00:00.000000000 Z
11
+ date: 2021-08-20 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: