truemail 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +1 -1
- data/.reek.yml +1 -0
- data/.rubocop.yml +18 -0
- data/CHANGELOG.md +17 -0
- data/Gemfile.lock +24 -19
- data/lib/truemail.rb +1 -1
- data/lib/truemail/configuration.rb +1 -1
- data/lib/truemail/log/serializer/base.rb +1 -0
- data/lib/truemail/log/serializer/validator_base.rb +5 -1
- data/lib/truemail/version.rb +1 -1
- data/truemail.gemspec +5 -5
- metadata +34 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '098a5137b9a780eef6d123e9393ccb00814808645e99d53408b9a80c32cf1a7b'
|
4
|
+
data.tar.gz: f64e10f884aea786c61006d9be9238b7e1073612c64b12e4b177b18e637da97c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 822485cd53478f2e38279de6c02f8ec2cc77762fad336c9c0278e415be852037c2bea2966409247893b271b0c61a5bc0769c659d1beaeef4a085ae57dce57a61
|
7
|
+
data.tar.gz: e176b835d2a11452f5d2d8ab952fbda08adef54078907c02d3bd3d534adab816a29adbc279202c74bf963c678d926141c89771a72207a2933c78214e2fea7119
|
data/.codeclimate.yml
CHANGED
data/.reek.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -136,6 +136,9 @@ Style/NilLambda:
|
|
136
136
|
Style/SwapValues:
|
137
137
|
Enabled: true
|
138
138
|
|
139
|
+
Style/RedundantArgument:
|
140
|
+
Enabled: true
|
141
|
+
|
139
142
|
Layout/LineLength:
|
140
143
|
Max: 140
|
141
144
|
|
@@ -260,6 +263,9 @@ Lint/ToEnumArguments:
|
|
260
263
|
Lint/UnmodifiedReduceAccumulator:
|
261
264
|
Enabled: true
|
262
265
|
|
266
|
+
Lint/UnexpectedBlockArity:
|
267
|
+
Enabled: true
|
268
|
+
|
263
269
|
Performance/AncestorsInclude:
|
264
270
|
Enabled: true
|
265
271
|
|
@@ -287,6 +293,18 @@ Performance/StringInclude:
|
|
287
293
|
Performance/Sum:
|
288
294
|
Enabled: true
|
289
295
|
|
296
|
+
Performance/BlockGivenWithExplicitBlock:
|
297
|
+
Enabled: true
|
298
|
+
|
299
|
+
Performance/CollectionLiteralInLoop:
|
300
|
+
Enabled: true
|
301
|
+
|
302
|
+
Performance/ConstantRegexp:
|
303
|
+
Enabled: true
|
304
|
+
|
305
|
+
Performance/MethodObjectAsBlock:
|
306
|
+
Enabled: true
|
307
|
+
|
290
308
|
RSpec/ExampleLength:
|
291
309
|
Enabled: false
|
292
310
|
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,23 @@
|
|
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.2.1] - 2020.12.06
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
|
9
|
+
- Filter out ASCII-8BIT chars for serialized SMTP response errors. Fixed `Encoding::UndefinedConversionError` in `Truemail::Log::Serializer::ValidatorJson#serialize`. Thanks to [@eni9889](https://github.com/eni9889) for report
|
10
|
+
- Added missed `smtp_fail_fast` attribute to serialized validator and auditor results
|
11
|
+
|
12
|
+
### Added
|
13
|
+
|
14
|
+
- Added `Truemail::Log::Serializer::ValidatorBase#replace_invalid_chars`
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
|
18
|
+
- Updated `Truemail::Log::Serializer::Base`
|
19
|
+
- Updated `Truemail::Log::Serializer::ValidatorBase`
|
20
|
+
- Updated gem development dependencies
|
21
|
+
|
5
22
|
## [2.2.0] - 2020.12.01
|
6
23
|
|
7
24
|
Ability to use fail fast behaviour for SMTP validation layer. When `smtp_fail_fast = true` it means that `truemail` ends smtp validation session after first attempt on the first mx server in any fail cases (network connection/timeout error, smtp validation error). This feature helps to reduce total time of SMTP validation session up to 1 second.
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
truemail (2.2.
|
4
|
+
truemail (2.2.1)
|
5
5
|
simpleidn (~> 0.1.1)
|
6
6
|
|
7
7
|
GEM
|
@@ -15,12 +15,16 @@ GEM
|
|
15
15
|
childprocess (4.0.0)
|
16
16
|
coderay (1.1.3)
|
17
17
|
colorize (0.8.1)
|
18
|
+
concurrent-ruby (1.1.7)
|
18
19
|
diff-lcs (1.4.4)
|
19
20
|
docile (1.3.2)
|
21
|
+
faker (2.15.1)
|
22
|
+
i18n (>= 1.6, < 2)
|
20
23
|
fasterer (0.8.3)
|
21
24
|
colorize (~> 0.7)
|
22
25
|
ruby_parser (>= 3.14.1)
|
23
|
-
|
26
|
+
i18n (1.8.5)
|
27
|
+
concurrent-ruby (~> 1.0)
|
24
28
|
iniparse (1.5.0)
|
25
29
|
json (2.3.1)
|
26
30
|
json_matchers (0.11.1)
|
@@ -31,7 +35,7 @@ GEM
|
|
31
35
|
overcommit (0.57.0)
|
32
36
|
childprocess (>= 0.6.3, < 5)
|
33
37
|
iniparse (~> 1.4)
|
34
|
-
parallel (1.20.
|
38
|
+
parallel (1.20.1)
|
35
39
|
parser (2.7.2.0)
|
36
40
|
ast (~> 2.4.1)
|
37
41
|
pry (0.13.1)
|
@@ -48,7 +52,7 @@ GEM
|
|
48
52
|
parser (>= 2.5.0.0, < 2.8, != 2.5.1.1)
|
49
53
|
psych (~> 3.1)
|
50
54
|
rainbow (>= 2.0, < 4.0)
|
51
|
-
regexp_parser (
|
55
|
+
regexp_parser (2.0.0)
|
52
56
|
rexml (3.2.4)
|
53
57
|
rspec (3.10.0)
|
54
58
|
rspec-core (~> 3.10.0)
|
@@ -63,21 +67,21 @@ GEM
|
|
63
67
|
diff-lcs (>= 1.2.0, < 2.0)
|
64
68
|
rspec-support (~> 3.10.0)
|
65
69
|
rspec-support (3.10.0)
|
66
|
-
rubocop (1.
|
70
|
+
rubocop (1.5.2)
|
67
71
|
parallel (~> 1.10)
|
68
72
|
parser (>= 2.7.1.5)
|
69
73
|
rainbow (>= 2.2.2, < 4.0)
|
70
|
-
regexp_parser (>= 1.8)
|
74
|
+
regexp_parser (>= 1.8, < 3.0)
|
71
75
|
rexml
|
72
|
-
rubocop-ast (>= 1.
|
76
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
73
77
|
ruby-progressbar (~> 1.7)
|
74
78
|
unicode-display_width (>= 1.4.0, < 2.0)
|
75
|
-
rubocop-ast (1.
|
79
|
+
rubocop-ast (1.3.0)
|
76
80
|
parser (>= 2.7.1.5)
|
77
|
-
rubocop-performance (1.
|
78
|
-
rubocop (>= 0.
|
81
|
+
rubocop-performance (1.9.1)
|
82
|
+
rubocop (>= 0.90.0, < 2.0)
|
79
83
|
rubocop-ast (>= 0.4.0)
|
80
|
-
rubocop-rspec (2.0.
|
84
|
+
rubocop-rspec (2.0.1)
|
81
85
|
rubocop (~> 1.0)
|
82
86
|
rubocop-ast (>= 1.1.0)
|
83
87
|
ruby-progressbar (1.10.1)
|
@@ -92,9 +96,10 @@ GEM
|
|
92
96
|
simpleidn (0.1.1)
|
93
97
|
unf (~> 0.1.4)
|
94
98
|
thor (1.0.1)
|
95
|
-
truemail-rspec (0.
|
96
|
-
|
97
|
-
|
99
|
+
truemail-rspec (0.3.3)
|
100
|
+
faker (~> 2.15, >= 2.15.1)
|
101
|
+
rspec (~> 3.10)
|
102
|
+
truemail (~> 2.2)
|
98
103
|
unf (0.1.4)
|
99
104
|
unf_ext
|
100
105
|
unf_ext (0.0.7.7)
|
@@ -106,20 +111,20 @@ PLATFORMS
|
|
106
111
|
DEPENDENCIES
|
107
112
|
bundler (~> 1.16)
|
108
113
|
bundler-audit (~> 0.7.0.1)
|
114
|
+
faker (~> 2.15, >= 2.15.1)
|
109
115
|
fasterer (~> 0.8.3)
|
110
|
-
ffaker (~> 2.17)
|
111
116
|
json_matchers (~> 0.11.1)
|
112
117
|
overcommit (~> 0.57.0)
|
113
118
|
pry-byebug (~> 3.9)
|
114
119
|
rake (~> 13.0, >= 13.0.1)
|
115
120
|
reek (~> 6.0, >= 6.0.2)
|
116
121
|
rspec (~> 3.10)
|
117
|
-
rubocop (~> 1.
|
118
|
-
rubocop-performance (~> 1.
|
119
|
-
rubocop-rspec (~> 2.0)
|
122
|
+
rubocop (~> 1.5, >= 1.5.2)
|
123
|
+
rubocop-performance (~> 1.9, >= 1.9.1)
|
124
|
+
rubocop-rspec (~> 2.0, >= 2.0.1)
|
120
125
|
simplecov (~> 0.17.1)
|
121
126
|
truemail!
|
122
|
-
truemail-rspec (~> 0.
|
127
|
+
truemail-rspec (~> 0.3.3)
|
123
128
|
|
124
129
|
BUNDLED WITH
|
125
130
|
1.16.6
|
data/lib/truemail.rb
CHANGED
@@ -10,7 +10,7 @@ module Truemail
|
|
10
10
|
class << self
|
11
11
|
def configuration(&block)
|
12
12
|
@configuration ||= begin
|
13
|
-
return unless
|
13
|
+
return unless block
|
14
14
|
configuration = Truemail::Configuration.new(&block)
|
15
15
|
raise_unless(configuration.complete?, Truemail::INCOMPLETE_CONFIG)
|
16
16
|
configuration
|
@@ -27,7 +27,7 @@ module Truemail
|
|
27
27
|
instance_initializer.each do |instace_variable, value|
|
28
28
|
instance_variable_set(:"@#{instace_variable}", value)
|
29
29
|
end
|
30
|
-
tap(&block) if
|
30
|
+
tap(&block) if block
|
31
31
|
end
|
32
32
|
|
33
33
|
%i[email_pattern smtp_error_body_pattern].each do |method|
|
@@ -56,6 +56,7 @@ module Truemail
|
|
56
56
|
whitelisted_domains: whitelisted_domains,
|
57
57
|
blacklisted_domains: blacklisted_domains,
|
58
58
|
not_rfc_mx_lookup_flow: executor_configuration.not_rfc_mx_lookup_flow,
|
59
|
+
smtp_fail_fast: executor_configuration.smtp_fail_fast,
|
59
60
|
smtp_safe_check: executor_configuration.smtp_safe_check,
|
60
61
|
email_pattern: email_pattern,
|
61
62
|
smtp_error_body_pattern: smtp_error_body_pattern
|
@@ -13,6 +13,10 @@ module Truemail
|
|
13
13
|
|
14
14
|
attr_reader :validation_type
|
15
15
|
|
16
|
+
def replace_invalid_chars
|
17
|
+
->(value) { value.encode('UTF-8', invalid: :replace) }
|
18
|
+
end
|
19
|
+
|
16
20
|
def smtp_debug
|
17
21
|
validation_smtp_debug = executor_result.smtp_debug
|
18
22
|
return unless validation_smtp_debug
|
@@ -22,7 +26,7 @@ module Truemail
|
|
22
26
|
mail_host: smtp_request.host,
|
23
27
|
port_opened: smtp_response.port_opened,
|
24
28
|
connection: smtp_response.connection,
|
25
|
-
errors: smtp_response.errors
|
29
|
+
errors: smtp_response.errors.transform_values(&replace_invalid_chars)
|
26
30
|
}
|
27
31
|
end
|
28
32
|
end
|
data/lib/truemail/version.rb
CHANGED
data/truemail.gemspec
CHANGED
@@ -35,17 +35,17 @@ Gem::Specification.new do |spec|
|
|
35
35
|
|
36
36
|
spec.add_development_dependency 'bundler', '~> 1.16'
|
37
37
|
spec.add_development_dependency 'bundler-audit', '~> 0.7.0.1'
|
38
|
+
spec.add_development_dependency 'faker', '~> 2.15', '>= 2.15.1'
|
38
39
|
spec.add_development_dependency 'fasterer', '~> 0.8.3'
|
39
|
-
spec.add_development_dependency 'ffaker', '~> 2.17'
|
40
40
|
spec.add_development_dependency 'json_matchers', '~> 0.11.1'
|
41
41
|
spec.add_development_dependency 'overcommit', '~> 0.57.0'
|
42
42
|
spec.add_development_dependency 'pry-byebug', '~> 3.9'
|
43
43
|
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.1'
|
44
44
|
spec.add_development_dependency 'reek', '~> 6.0', '>= 6.0.2'
|
45
45
|
spec.add_development_dependency 'rspec', '~> 3.10'
|
46
|
-
spec.add_development_dependency 'rubocop', '~> 1.
|
47
|
-
spec.add_development_dependency 'rubocop-performance', '~> 1.
|
48
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 2.0'
|
46
|
+
spec.add_development_dependency 'rubocop', '~> 1.5', '>= 1.5.2'
|
47
|
+
spec.add_development_dependency 'rubocop-performance', '~> 1.9', '>= 1.9.1'
|
48
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.0', '>= 2.0.1'
|
49
49
|
spec.add_development_dependency 'simplecov', '~> 0.17.1'
|
50
|
-
spec.add_development_dependency 'truemail-rspec', '~> 0.
|
50
|
+
spec.add_development_dependency 'truemail-rspec', '~> 0.3.3'
|
51
51
|
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.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladislav Trotsenko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simpleidn
|
@@ -53,33 +53,39 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.7.0.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: faker
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: '2.15'
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: 2.15.1
|
62
65
|
type: :development
|
63
66
|
prerelease: false
|
64
67
|
version_requirements: !ruby/object:Gem::Requirement
|
65
68
|
requirements:
|
66
69
|
- - "~>"
|
67
70
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
71
|
+
version: '2.15'
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 2.15.1
|
69
75
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
76
|
+
name: fasterer
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|
72
78
|
requirements:
|
73
79
|
- - "~>"
|
74
80
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
81
|
+
version: 0.8.3
|
76
82
|
type: :development
|
77
83
|
prerelease: false
|
78
84
|
version_requirements: !ruby/object:Gem::Requirement
|
79
85
|
requirements:
|
80
86
|
- - "~>"
|
81
87
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
88
|
+
version: 0.8.3
|
83
89
|
- !ruby/object:Gem::Dependency
|
84
90
|
name: json_matchers
|
85
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -182,34 +188,40 @@ dependencies:
|
|
182
188
|
requirements:
|
183
189
|
- - "~>"
|
184
190
|
- !ruby/object:Gem::Version
|
185
|
-
version: '1.
|
191
|
+
version: '1.5'
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: 1.5.2
|
186
195
|
type: :development
|
187
196
|
prerelease: false
|
188
197
|
version_requirements: !ruby/object:Gem::Requirement
|
189
198
|
requirements:
|
190
199
|
- - "~>"
|
191
200
|
- !ruby/object:Gem::Version
|
192
|
-
version: '1.
|
201
|
+
version: '1.5'
|
202
|
+
- - ">="
|
203
|
+
- !ruby/object:Gem::Version
|
204
|
+
version: 1.5.2
|
193
205
|
- !ruby/object:Gem::Dependency
|
194
206
|
name: rubocop-performance
|
195
207
|
requirement: !ruby/object:Gem::Requirement
|
196
208
|
requirements:
|
197
209
|
- - "~>"
|
198
210
|
- !ruby/object:Gem::Version
|
199
|
-
version: '1.
|
211
|
+
version: '1.9'
|
200
212
|
- - ">="
|
201
213
|
- !ruby/object:Gem::Version
|
202
|
-
version: 1.
|
214
|
+
version: 1.9.1
|
203
215
|
type: :development
|
204
216
|
prerelease: false
|
205
217
|
version_requirements: !ruby/object:Gem::Requirement
|
206
218
|
requirements:
|
207
219
|
- - "~>"
|
208
220
|
- !ruby/object:Gem::Version
|
209
|
-
version: '1.
|
221
|
+
version: '1.9'
|
210
222
|
- - ">="
|
211
223
|
- !ruby/object:Gem::Version
|
212
|
-
version: 1.
|
224
|
+
version: 1.9.1
|
213
225
|
- !ruby/object:Gem::Dependency
|
214
226
|
name: rubocop-rspec
|
215
227
|
requirement: !ruby/object:Gem::Requirement
|
@@ -217,6 +229,9 @@ dependencies:
|
|
217
229
|
- - "~>"
|
218
230
|
- !ruby/object:Gem::Version
|
219
231
|
version: '2.0'
|
232
|
+
- - ">="
|
233
|
+
- !ruby/object:Gem::Version
|
234
|
+
version: 2.0.1
|
220
235
|
type: :development
|
221
236
|
prerelease: false
|
222
237
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -224,6 +239,9 @@ dependencies:
|
|
224
239
|
- - "~>"
|
225
240
|
- !ruby/object:Gem::Version
|
226
241
|
version: '2.0'
|
242
|
+
- - ">="
|
243
|
+
- !ruby/object:Gem::Version
|
244
|
+
version: 2.0.1
|
227
245
|
- !ruby/object:Gem::Dependency
|
228
246
|
name: simplecov
|
229
247
|
requirement: !ruby/object:Gem::Requirement
|
@@ -244,14 +262,14 @@ dependencies:
|
|
244
262
|
requirements:
|
245
263
|
- - "~>"
|
246
264
|
- !ruby/object:Gem::Version
|
247
|
-
version: 0.
|
265
|
+
version: 0.3.3
|
248
266
|
type: :development
|
249
267
|
prerelease: false
|
250
268
|
version_requirements: !ruby/object:Gem::Requirement
|
251
269
|
requirements:
|
252
270
|
- - "~>"
|
253
271
|
- !ruby/object:Gem::Version
|
254
|
-
version: 0.
|
272
|
+
version: 0.3.3
|
255
273
|
description: Configurable framework agnostic plain Ruby email validator. Verify email
|
256
274
|
via Regex, DNS and SMTP.
|
257
275
|
email:
|