truemail 2.4.3 → 2.4.7

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: 18f3f900aa245bd6e49de6aa90c2f001970ed51207392e1247f54dfeb6982914
4
- data.tar.gz: 955e3c20cd40e926ef35547a480a33a4bac508d8c07be97d60f3e36de67c79d1
3
+ metadata.gz: 29ccfdfd6a113d27d58b10152fdcad9b36776483f218913d1adb8ea4620734e7
4
+ data.tar.gz: 03a3359ff3f9802294232a3c044803079d0ae8827231290b922ef986bd65e3a5
5
5
  SHA512:
6
- metadata.gz: 3ff29c8e34d5f25e944a3f03d8a2e7e0190edcf79fcc9d672be5865009e722e11a83d0524d3d286284766b822c610646df061c1f44a11402d5dbf6e83dbafac2
7
- data.tar.gz: ff9ece8c1278444922f2d8136e5a5c59dd60e1882067d27cb9d2ace3d9dfab5a5cfdbb45df37dd10d0586419a9a1d709971c96b8dee4824e05388b6cf70b6c86
6
+ metadata.gz: 75641c556bde056926b6a2e72c7f050ebb0abb15e0a383260e29e82ec2115dfa5510992a2931e62a13dc98a6c1704eeaf3e038950c73353c88466e5eeba8d73f
7
+ data.tar.gz: 77876e0bb2cf55c82fded8c9c5c746395d5909ab1ddc8cff2e751d3f731bcaeb51ccd449b0792f096e902b8762f81a2f0ed32f339d8ef149f0ddf4d6f7a4c21c
data/.codeclimate.yml CHANGED
@@ -7,7 +7,7 @@ checks:
7
7
  plugins:
8
8
  rubocop:
9
9
  enabled: true
10
- channel: rubocop-1-16
10
+ channel: rubocop-1-18
11
11
 
12
12
  reek:
13
13
  enabled: true
data/.rubocop.yml CHANGED
@@ -28,6 +28,9 @@ Naming/VariableNumber:
28
28
  Naming/RescuedExceptionsVariableName:
29
29
  Enabled: false
30
30
 
31
+ Naming/InclusiveLanguage:
32
+ Enabled: false
33
+
31
34
  Style/Documentation:
32
35
  Enabled: false
33
36
 
@@ -197,6 +200,9 @@ Layout/BeginEndAlignment:
197
200
  Layout/SpaceBeforeBrackets:
198
201
  Enabled: true
199
202
 
203
+ Layout/LineEndStringConcatenationIndentation:
204
+ Enabled: true
205
+
200
206
  Lint/NonDeterministicRequireOrder:
201
207
  Enabled: false
202
208
 
data/CHANGELOG.md CHANGED
@@ -2,6 +2,49 @@
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.7] - 2021.08.09
6
+
7
+ ### Updated
8
+
9
+ - Updated gem codebase, refactored `Truemail::ContextHelper`
10
+ - Updated tests
11
+ - Updated gem development dependencies
12
+ - Updated gem version
13
+
14
+ ## [2.4.6] - 2021.07.10
15
+
16
+ ### Fixed
17
+
18
+ - Wrong domain punycode extraction in DNS validation layer
19
+
20
+ ### Updated
21
+
22
+ - Updated gem codebase, restored `Truemail::RegexConstant::REGEX_DOMAIN_FROM_EMAIL`
23
+ - Updated tests
24
+
25
+ ## [2.4.5] - 2021.07.09
26
+
27
+ ### Removed
28
+
29
+ - `Truemail::RegexConstant::REGEX_DOMAIN_FROM_EMAIL`
30
+
31
+ ### Updated
32
+
33
+ - `Truemail::Validate::Mx`
34
+ - Updated gem development dependencies
35
+ - Updated gem version
36
+
37
+ ## [2.4.4] - 2021.06.29
38
+
39
+ ### Updated
40
+
41
+ Allowed using special characters in email user names (following [RFC 3696](https://datatracker.ietf.org/doc/html/rfc3696#page-6)) for default regex email pattern.
42
+
43
+ - Updated `Truemail::RegexConstant::REGEX_EMAIL_PATTERN`, tests
44
+ - Updated gem development dependencies
45
+ - Updated Rubocop/Codeclimate config
46
+ - Updated gem documentation, version
47
+
5
48
  ## [2.4.3] - 2021.06.15
6
49
 
7
50
  ### Updated
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- truemail (2.4.3)
4
+ truemail (2.4.7)
5
5
  simpleidn (~> 0.2.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- addressable (2.7.0)
10
+ addressable (2.8.0)
11
11
  public_suffix (>= 2.0.2, < 5.0)
12
12
  ast (2.4.2)
13
13
  bundler-audit (0.8.0)
@@ -21,7 +21,8 @@ GEM
21
21
  crack (0.4.5)
22
22
  rexml
23
23
  diff-lcs (1.4.4)
24
- dns_mock (1.3.0)
24
+ dns_mock (1.4.0)
25
+ simpleidn (~> 0.2.1)
25
26
  docile (1.4.0)
26
27
  faker (2.18.0)
27
28
  i18n (>= 1.6, < 2)
@@ -43,7 +44,7 @@ GEM
43
44
  iniparse (~> 1.4)
44
45
  rexml (~> 3.2)
45
46
  parallel (1.20.1)
46
- parser (3.0.1.1)
47
+ parser (3.0.2.0)
47
48
  ast (~> 2.4.1)
48
49
  pry (0.13.1)
49
50
  coderay (~> 1.1)
@@ -54,11 +55,11 @@ GEM
54
55
  psych (3.3.2)
55
56
  public_suffix (4.0.6)
56
57
  rainbow (3.0.0)
57
- rake (13.0.3)
58
- reek (6.0.4)
58
+ rake (13.0.6)
59
+ reek (6.0.5)
59
60
  kwalify (~> 0.7.0)
60
61
  parser (~> 3.0.0)
61
- psych (~> 3.1)
62
+ psych (>= 3.1, < 5.0)
62
63
  rainbow (>= 2.0, < 4.0)
63
64
  regexp_parser (2.1.1)
64
65
  rexml (3.2.5)
@@ -75,25 +76,25 @@ GEM
75
76
  diff-lcs (>= 1.2.0, < 2.0)
76
77
  rspec-support (~> 3.10.0)
77
78
  rspec-support (3.10.2)
78
- rubocop (1.16.1)
79
+ rubocop (1.18.4)
79
80
  parallel (~> 1.10)
80
81
  parser (>= 3.0.0.0)
81
82
  rainbow (>= 2.2.2, < 4.0)
82
83
  regexp_parser (>= 1.8, < 3.0)
83
84
  rexml
84
- rubocop-ast (>= 1.7.0, < 2.0)
85
+ rubocop-ast (>= 1.8.0, < 2.0)
85
86
  ruby-progressbar (~> 1.7)
86
87
  unicode-display_width (>= 1.4.0, < 3.0)
87
- rubocop-ast (1.7.0)
88
+ rubocop-ast (1.9.0)
88
89
  parser (>= 3.0.1.1)
89
- rubocop-performance (1.11.3)
90
+ rubocop-performance (1.11.4)
90
91
  rubocop (>= 1.7.0, < 2.0)
91
92
  rubocop-ast (>= 0.4.0)
92
93
  rubocop-rspec (2.4.0)
93
94
  rubocop (~> 1.0)
94
95
  rubocop-ast (>= 1.1.0)
95
96
  ruby-progressbar (1.11.0)
96
- ruby_parser (3.16.0)
97
+ ruby_parser (3.17.0)
97
98
  sexp_processor (~> 4.15, >= 4.15.1)
98
99
  sexp_processor (4.15.3)
99
100
  simplecov (0.17.1)
@@ -112,8 +113,8 @@ GEM
112
113
  unf_ext
113
114
  unf_ext (0.0.7.7)
114
115
  unicode-display_width (2.0.0)
115
- webmock (3.13.0)
116
- addressable (>= 2.3.6)
116
+ webmock (3.14.0)
117
+ addressable (>= 2.8.0)
117
118
  crack (>= 0.3.2)
118
119
  hashdiff (>= 0.4.0, < 2.0.0)
119
120
 
@@ -121,24 +122,24 @@ PLATFORMS
121
122
  x86_64-darwin-20
122
123
 
123
124
  DEPENDENCIES
124
- bundler (~> 2.2, >= 2.2.20)
125
+ bundler (~> 2.2, >= 2.2.25)
125
126
  bundler-audit (~> 0.8.0)
126
- dns_mock (~> 1.3)
127
+ dns_mock (~> 1.4)
127
128
  faker (~> 2.18)
128
129
  fasterer (~> 0.9.0)
129
130
  json_matchers (~> 0.11.1)
130
131
  overcommit (~> 0.58.0)
131
132
  pry-byebug (~> 3.9)
132
- rake (~> 13.0, >= 13.0.3)
133
- reek (~> 6.0, >= 6.0.4)
133
+ rake (~> 13.0, >= 13.0.6)
134
+ reek (~> 6.0, >= 6.0.5)
134
135
  rspec (~> 3.10)
135
- rubocop (~> 1.16, >= 1.16.1)
136
- rubocop-performance (~> 1.11, >= 1.11.3)
136
+ rubocop (~> 1.18, >= 1.18.4)
137
+ rubocop-performance (~> 1.11, >= 1.11.4)
137
138
  rubocop-rspec (~> 2.4)
138
139
  simplecov (~> 0.17.1)
139
140
  truemail!
140
141
  truemail-rspec (~> 0.6)
141
- webmock (~> 3.13)
142
+ webmock (~> 3.14)
142
143
 
143
144
  BUNDLED WITH
144
- 2.2.20
145
+ 2.2.25
data/lib/truemail/core.rb CHANGED
@@ -20,7 +20,7 @@ module Truemail
20
20
 
21
21
  module RegexConstant
22
22
  REGEX_DOMAIN = /[\p{L}0-9]+([\-.]{1}[\p{L}0-9]+)*\.\p{L}{2,63}/i.freeze
23
- REGEX_EMAIL_PATTERN = /(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w|\-.+]*)@(#{REGEX_DOMAIN})\z)/.freeze
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
25
  REGEX_DOMAIN_FROM_EMAIL = /\A.+@(.+)\z/.freeze
26
26
  REGEX_SMTP_ERROR_BODY_PATTERN = /(?=.*550)(?=.*(user|account|customer|mailbox)).*/i.freeze
@@ -8,7 +8,6 @@ module Truemail
8
8
 
9
9
  def run
10
10
  return false unless Truemail::Validate::Regex.check(result)
11
- result.domain = result.punycode_email[Truemail::RegexConstant::REGEX_DOMAIN_FROM_EMAIL, 1]
12
11
  return true if success(mx_lookup && domain_not_include_null_mx)
13
12
  mail_servers.clear && add_error(Truemail::Validate::Mx::ERROR)
14
13
  false
@@ -53,7 +52,10 @@ module Truemail
53
52
  end
54
53
 
55
54
  def domain
56
- result.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
57
59
  end
58
60
 
59
61
  def hosts_from_mx_records?
@@ -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.3'
4
+ VERSION = '2.4.7'
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.20'
36
+ spec.add_development_dependency 'bundler', '~> 2.2', '>= 2.2.25'
37
37
  spec.add_development_dependency 'bundler-audit', '~> 0.8.0'
38
- spec.add_development_dependency 'dns_mock', '~> 1.3'
38
+ spec.add_development_dependency 'dns_mock', '~> 1.4'
39
39
  spec.add_development_dependency 'faker', '~> 2.18'
40
40
  spec.add_development_dependency 'fasterer', '~> 0.9.0'
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
- spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.3'
45
- spec.add_development_dependency 'reek', '~> 6.0', '>= 6.0.4'
44
+ spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
45
+ spec.add_development_dependency 'reek', '~> 6.0', '>= 6.0.5'
46
46
  spec.add_development_dependency 'rspec', '~> 3.10'
47
- spec.add_development_dependency 'rubocop', '~> 1.16', '>= 1.16.1'
48
- spec.add_development_dependency 'rubocop-performance', '~> 1.11', '>= 1.11.3'
47
+ spec.add_development_dependency 'rubocop', '~> 1.18', '>= 1.18.4'
48
+ spec.add_development_dependency 'rubocop-performance', '~> 1.11', '>= 1.11.4'
49
49
  spec.add_development_dependency 'rubocop-rspec', '~> 2.4'
50
50
  spec.add_development_dependency 'simplecov', '~> 0.17.1'
51
51
  spec.add_development_dependency 'truemail-rspec', '~> 0.6'
52
- spec.add_development_dependency 'webmock', '~> 3.13'
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.3
4
+ version: 2.4.7
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-06-15 00:00:00.000000000 Z
11
+ date: 2021-08-09 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.20
36
+ version: 2.2.25
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.20
46
+ version: 2.2.25
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler-audit
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -64,14 +64,14 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '1.3'
67
+ version: '1.4'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '1.3'
74
+ version: '1.4'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: faker
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -151,7 +151,7 @@ dependencies:
151
151
  version: '13.0'
152
152
  - - ">="
153
153
  - !ruby/object:Gem::Version
154
- version: 13.0.3
154
+ version: 13.0.6
155
155
  type: :development
156
156
  prerelease: false
157
157
  version_requirements: !ruby/object:Gem::Requirement
@@ -161,7 +161,7 @@ dependencies:
161
161
  version: '13.0'
162
162
  - - ">="
163
163
  - !ruby/object:Gem::Version
164
- version: 13.0.3
164
+ version: 13.0.6
165
165
  - !ruby/object:Gem::Dependency
166
166
  name: reek
167
167
  requirement: !ruby/object:Gem::Requirement
@@ -171,7 +171,7 @@ dependencies:
171
171
  version: '6.0'
172
172
  - - ">="
173
173
  - !ruby/object:Gem::Version
174
- version: 6.0.4
174
+ version: 6.0.5
175
175
  type: :development
176
176
  prerelease: false
177
177
  version_requirements: !ruby/object:Gem::Requirement
@@ -181,7 +181,7 @@ dependencies:
181
181
  version: '6.0'
182
182
  - - ">="
183
183
  - !ruby/object:Gem::Version
184
- version: 6.0.4
184
+ version: 6.0.5
185
185
  - !ruby/object:Gem::Dependency
186
186
  name: rspec
187
187
  requirement: !ruby/object:Gem::Requirement
@@ -202,20 +202,20 @@ dependencies:
202
202
  requirements:
203
203
  - - "~>"
204
204
  - !ruby/object:Gem::Version
205
- version: '1.16'
205
+ version: '1.18'
206
206
  - - ">="
207
207
  - !ruby/object:Gem::Version
208
- version: 1.16.1
208
+ version: 1.18.4
209
209
  type: :development
210
210
  prerelease: false
211
211
  version_requirements: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: '1.16'
215
+ version: '1.18'
216
216
  - - ">="
217
217
  - !ruby/object:Gem::Version
218
- version: 1.16.1
218
+ version: 1.18.4
219
219
  - !ruby/object:Gem::Dependency
220
220
  name: rubocop-performance
221
221
  requirement: !ruby/object:Gem::Requirement
@@ -225,7 +225,7 @@ dependencies:
225
225
  version: '1.11'
226
226
  - - ">="
227
227
  - !ruby/object:Gem::Version
228
- version: 1.11.3
228
+ version: 1.11.4
229
229
  type: :development
230
230
  prerelease: false
231
231
  version_requirements: !ruby/object:Gem::Requirement
@@ -235,7 +235,7 @@ dependencies:
235
235
  version: '1.11'
236
236
  - - ">="
237
237
  - !ruby/object:Gem::Version
238
- version: 1.11.3
238
+ version: 1.11.4
239
239
  - !ruby/object:Gem::Dependency
240
240
  name: rubocop-rspec
241
241
  requirement: !ruby/object:Gem::Requirement
@@ -284,14 +284,14 @@ dependencies:
284
284
  requirements:
285
285
  - - "~>"
286
286
  - !ruby/object:Gem::Version
287
- version: '3.13'
287
+ version: '3.14'
288
288
  type: :development
289
289
  prerelease: false
290
290
  version_requirements: !ruby/object:Gem::Requirement
291
291
  requirements:
292
292
  - - "~>"
293
293
  - !ruby/object:Gem::Version
294
- version: '3.13'
294
+ version: '3.14'
295
295
  description: Configurable framework agnostic plain Ruby email validator. Verify email
296
296
  via Regex, DNS, SMTP and even more.
297
297
  email: