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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ccc592c306e3cb61ae0b64e88204a5d464d614abb842bc6538112a19acca812a
4
- data.tar.gz: f61ebb1883ff711a1816c3f6523c1ab2f4ffa11b13782011d4d42f9204a4e298
3
+ metadata.gz: '098a5137b9a780eef6d123e9393ccb00814808645e99d53408b9a80c32cf1a7b'
4
+ data.tar.gz: f64e10f884aea786c61006d9be9238b7e1073612c64b12e4b177b18e637da97c
5
5
  SHA512:
6
- metadata.gz: 640d6769aee1f4fde2d525253d3096a99866ecd190ad1e3f5ddb77c4105908f97a7cd3468fb65d97363291ec3931cc4802f25673e696ffee6d028000f8d5edff
7
- data.tar.gz: 21e63e9a6b6e17b830569a64ddb563264e8ff1a5a4ab6ac22da21169bd331474ae2e467765a196d36b5bafd5ef40867cf4baf74b3861cab967c24bfd457d4a73
6
+ metadata.gz: 822485cd53478f2e38279de6c02f8ec2cc77762fad336c9c0278e415be852037c2bea2966409247893b271b0c61a5bc0769c659d1beaeef4a085ae57dce57a61
7
+ data.tar.gz: e176b835d2a11452f5d2d8ab952fbda08adef54078907c02d3bd3d534adab816a29adbc279202c74bf963c678d926141c89771a72207a2933c78214e2fea7119
@@ -7,7 +7,7 @@ checks:
7
7
  plugins:
8
8
  rubocop:
9
9
  enabled: true
10
- channel: rubocop-1-3
10
+ channel: rubocop-1-5
11
11
 
12
12
  reek:
13
13
  enabled: true
data/.reek.yml CHANGED
@@ -42,6 +42,7 @@ detectors:
42
42
  - Truemail::Configuration#domain_matcher
43
43
  - Truemail::Configuration#logger_options
44
44
  - Truemail::Log::Serializer::Base#errors
45
+ - Truemail::Log::Serializer::ValidatorBase#replace_invalid_chars
45
46
 
46
47
  ControlParameter:
47
48
  exclude:
@@ -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
 
@@ -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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- truemail (2.2.0)
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
- ffaker (2.17.0)
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.0)
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 (1.8.2)
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.3.0)
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.1.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.1.1)
79
+ rubocop-ast (1.3.0)
76
80
  parser (>= 2.7.1.5)
77
- rubocop-performance (1.8.1)
78
- rubocop (>= 0.87.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.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.2.1)
96
- rspec (~> 3.9)
97
- truemail (~> 1.4, >= 1.4.1)
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.3)
118
- rubocop-performance (~> 1.8, >= 1.8.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.2.1)
127
+ truemail-rspec (~> 0.3.3)
123
128
 
124
129
  BUNDLED WITH
125
130
  1.16.6
@@ -10,7 +10,7 @@ module Truemail
10
10
  class << self
11
11
  def configuration(&block)
12
12
  @configuration ||= begin
13
- return unless block_given?
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 block_given?
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Truemail
4
- VERSION = '2.2.0'
4
+ VERSION = '2.2.1'
5
5
  end
@@ -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.3'
47
- spec.add_development_dependency 'rubocop-performance', '~> 1.8', '>= 1.8.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.2.1'
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.0
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-01 00:00:00.000000000 Z
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: fasterer
56
+ name: faker
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.8.3
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: 0.8.3
71
+ version: '2.15'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 2.15.1
69
75
  - !ruby/object:Gem::Dependency
70
- name: ffaker
76
+ name: fasterer
71
77
  requirement: !ruby/object:Gem::Requirement
72
78
  requirements:
73
79
  - - "~>"
74
80
  - !ruby/object:Gem::Version
75
- version: '2.17'
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: '2.17'
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.3'
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.3'
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.8'
211
+ version: '1.9'
200
212
  - - ">="
201
213
  - !ruby/object:Gem::Version
202
- version: 1.8.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.8'
221
+ version: '1.9'
210
222
  - - ">="
211
223
  - !ruby/object:Gem::Version
212
- version: 1.8.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.2.1
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.2.1
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: