truemail 2.2.2 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f84d530d5be9ada6a6808ccee1eb434cef337b106c03f40efd6ef3907163afdb
4
- data.tar.gz: 4defd0a48ff8a6ce96c177372e356ddba6bac2cce6df1c564490a415c8ad5b2b
3
+ metadata.gz: 57ce495b7ea8e70dc9788b5d5528f3386a57d69233f645ab665f1a187ca08e08
4
+ data.tar.gz: e5696bb995de86253fec296cd6985ddb5a26f93ccc24e4a95a21b5f4ded05681
5
5
  SHA512:
6
- metadata.gz: eb98be6cbebb18c5ea8e552c468a737cb3d748a33be2366f9536c72c0fc4d643e0a8b023709c4392d9fd7fe41e6a01c14578118e3d9a6dc03cc95fb8b7da3d2a
7
- data.tar.gz: 0ac091e948676edfd36053a6e9fc262ad88ed8b3f2a0fd2a06bb61999b0acc92856d2cf06357f80dfa39e819d02875d9a0d99ffe69319f12b4b72526a46ab6b3
6
+ metadata.gz: 3ac657676afa3a27b5b2192ec7650fd742200fd4a0d5da7a21346f4a3fb75bc2038b1183d4ebdf63ad0fcd579f05169bff6bebdf1a9c2817092d634a7974a30f
7
+ data.tar.gz: 3f7f43b6ee28ef483c5fdd9a31fb615f98c688e849e0363370e59d3818d3a572272c50daa7a4422dd1f12b0c5ada49e12468f8016e9a17144fc94354d6478eb7
data/.reek.yml CHANGED
@@ -13,6 +13,7 @@ detectors:
13
13
  - Truemail::Validate::Smtp#run
14
14
  - Truemail::Validate::Mx#hosts_from_cname_records
15
15
  - Truemail::Configuration#logger=
16
+ - Truemail::Validate::Smtp::Request#initialize
16
17
 
17
18
  TooManyInstanceVariables:
18
19
  exclude:
@@ -142,6 +142,9 @@ Style/RedundantArgument:
142
142
  Style/HashExcept:
143
143
  Enabled: true
144
144
 
145
+ Style/EndlessMethod:
146
+ Enabled: true
147
+
145
148
  Layout/LineLength:
146
149
  Max: 140
147
150
 
@@ -275,6 +278,15 @@ Lint/UnexpectedBlockArity:
275
278
  Lint/AmbiguousAssignment:
276
279
  Enabled: true
277
280
 
281
+ Lint/DeprecatedConstants:
282
+ Enabled: true
283
+
284
+ Lint/LambdaWithoutLiteralBlock:
285
+ Enabled: true
286
+
287
+ Lint/RedundantDirGlobSort:
288
+ Enabled: true
289
+
278
290
  Performance/AncestorsInclude:
279
291
  Enabled: true
280
292
 
@@ -2,6 +2,18 @@
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.3] - 2020.01.12
6
+
7
+ ### Fixed
8
+
9
+ Removed needless `Timeout.timeout` block in `Truemail::Validate::Smtp::Request#check_port`, replaced `TCPSocket` to `Socket` with native timeout detection. Thanks to [@wikiti](https://github.com/wikiti) for idea, testing on production and clean PR [#127](https://github.com/truemail-rb/truemail/pull/127).
10
+
11
+ ### Changed
12
+
13
+ - Updated `Truemail::Validate::Smtp::Request`
14
+ - Updated gem development dependencies
15
+ - Updated rubocop, reek configs
16
+
5
17
  ## [2.2.2] - 2020.12.30
6
18
 
7
19
  ### Changed
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- truemail (2.2.2)
4
+ truemail (2.2.3)
5
5
  simpleidn (~> 0.1.1)
6
6
 
7
7
  GEM
@@ -23,7 +23,7 @@ GEM
23
23
  fasterer (0.8.3)
24
24
  colorize (~> 0.7)
25
25
  ruby_parser (>= 3.14.1)
26
- i18n (1.8.5)
26
+ i18n (1.8.7)
27
27
  concurrent-ruby (~> 1.0)
28
28
  iniparse (1.5.0)
29
29
  json (2.5.1)
@@ -36,7 +36,7 @@ GEM
36
36
  childprocess (>= 0.6.3, < 5)
37
37
  iniparse (~> 1.4)
38
38
  parallel (1.20.1)
39
- parser (2.7.2.0)
39
+ parser (3.0.0.0)
40
40
  ast (~> 2.4.1)
41
41
  pry (0.13.1)
42
42
  coderay (~> 1.1)
@@ -47,9 +47,9 @@ GEM
47
47
  psych (3.3.0)
48
48
  rainbow (3.0.0)
49
49
  rake (13.0.3)
50
- reek (6.0.2)
50
+ reek (6.0.3)
51
51
  kwalify (~> 0.7.0)
52
- parser (>= 2.5.0.0, < 2.8, != 2.5.1.1)
52
+ parser (~> 3.0.0)
53
53
  psych (~> 3.1)
54
54
  rainbow (>= 2.0, < 4.0)
55
55
  regexp_parser (2.0.3)
@@ -67,27 +67,27 @@ GEM
67
67
  diff-lcs (>= 1.2.0, < 2.0)
68
68
  rspec-support (~> 3.10.0)
69
69
  rspec-support (3.10.1)
70
- rubocop (1.7.0)
70
+ rubocop (1.8.1)
71
71
  parallel (~> 1.10)
72
- parser (>= 2.7.1.5)
72
+ parser (>= 3.0.0.0)
73
73
  rainbow (>= 2.2.2, < 4.0)
74
74
  regexp_parser (>= 1.8, < 3.0)
75
75
  rexml
76
76
  rubocop-ast (>= 1.2.0, < 2.0)
77
77
  ruby-progressbar (~> 1.7)
78
- unicode-display_width (>= 1.4.0, < 2.0)
79
- rubocop-ast (1.3.0)
78
+ unicode-display_width (>= 1.4.0, < 3.0)
79
+ rubocop-ast (1.4.0)
80
80
  parser (>= 2.7.1.5)
81
- rubocop-performance (1.9.1)
81
+ rubocop-performance (1.9.2)
82
82
  rubocop (>= 0.90.0, < 2.0)
83
83
  rubocop-ast (>= 0.4.0)
84
84
  rubocop-rspec (2.1.0)
85
85
  rubocop (~> 1.0)
86
86
  rubocop-ast (>= 1.1.0)
87
- ruby-progressbar (1.10.1)
88
- ruby_parser (3.15.0)
87
+ ruby-progressbar (1.11.0)
88
+ ruby_parser (3.15.1)
89
89
  sexp_processor (~> 4.9)
90
- sexp_processor (4.15.1)
90
+ sexp_processor (4.15.2)
91
91
  simplecov (0.17.1)
92
92
  docile (~> 1.1)
93
93
  json (>= 1.8, < 3)
@@ -103,7 +103,7 @@ GEM
103
103
  unf (0.1.4)
104
104
  unf_ext
105
105
  unf_ext (0.0.7.7)
106
- unicode-display_width (1.7.0)
106
+ unicode-display_width (2.0.0)
107
107
 
108
108
  PLATFORMS
109
109
  ruby
@@ -117,10 +117,10 @@ DEPENDENCIES
117
117
  overcommit (~> 0.57.0)
118
118
  pry-byebug (~> 3.9)
119
119
  rake (~> 13.0, >= 13.0.3)
120
- reek (~> 6.0, >= 6.0.2)
120
+ reek (~> 6.0, >= 6.0.3)
121
121
  rspec (~> 3.10)
122
- rubocop (~> 1.7)
123
- rubocop-performance (~> 1.9, >= 1.9.1)
122
+ rubocop (~> 1.8, >= 1.8.1)
123
+ rubocop-performance (~> 1.9, >= 1.9.2)
124
124
  rubocop-rspec (~> 2.1)
125
125
  simplecov (~> 0.17.1)
126
126
  truemail!
@@ -13,20 +13,24 @@ module Truemail
13
13
 
14
14
  attr_reader :configuration, :host, :email, :response
15
15
 
16
- def initialize(configuration:, host:, email:, attempts: nil)
16
+ def initialize(configuration:, host:, email:, attempts: nil, port_open_status: proc { true })
17
17
  @configuration = Truemail::Validate::Smtp::Request::Configuration.new(configuration)
18
18
  @response = Truemail::Validate::Smtp::Response.new
19
19
  @host = host
20
20
  @email = email
21
21
  @attempts = attempts
22
+ @port_open_status = port_open_status
22
23
  end
23
24
 
24
25
  def check_port
25
- Timeout.timeout(configuration.connection_timeout) do
26
- return response.port_opened = !TCPSocket.new(host, Truemail::Validate::Smtp::Request::SMTP_PORT).close
27
- end
26
+ response.port_opened = Socket.tcp(
27
+ host,
28
+ Truemail::Validate::Smtp::Request::SMTP_PORT,
29
+ connect_timeout: configuration.connection_timeout,
30
+ &port_open_status
31
+ )
28
32
  rescue => error
29
- retry if attempts_exist? && error.is_a?(Timeout::Error)
33
+ retry if attempts_exist? && error.is_a?(Errno::ETIMEDOUT)
30
34
  response.port_opened = false
31
35
  end
32
36
 
@@ -53,7 +57,7 @@ module Truemail
53
57
  end
54
58
  end
55
59
 
56
- attr_reader :attempts
60
+ attr_reader :attempts, :port_open_status
57
61
 
58
62
  def attempts_exist?
59
63
  return false unless attempts
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Truemail
4
- VERSION = '2.2.2'
4
+ VERSION = '2.2.3'
5
5
  end
@@ -41,10 +41,10 @@ Gem::Specification.new do |spec|
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.3'
44
- spec.add_development_dependency 'reek', '~> 6.0', '>= 6.0.2'
44
+ spec.add_development_dependency 'reek', '~> 6.0', '>= 6.0.3'
45
45
  spec.add_development_dependency 'rspec', '~> 3.10'
46
- spec.add_development_dependency 'rubocop', '~> 1.7'
47
- spec.add_development_dependency 'rubocop-performance', '~> 1.9', '>= 1.9.1'
46
+ spec.add_development_dependency 'rubocop', '~> 1.8', '>= 1.8.1'
47
+ spec.add_development_dependency 'rubocop-performance', '~> 1.9', '>= 1.9.2'
48
48
  spec.add_development_dependency 'rubocop-rspec', '~> 2.1'
49
49
  spec.add_development_dependency 'simplecov', '~> 0.17.1'
50
50
  spec.add_development_dependency 'truemail-rspec', '~> 0.3.3'
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.2
4
+ version: 2.2.3
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-30 00:00:00.000000000 Z
11
+ date: 2021-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simpleidn
@@ -157,7 +157,7 @@ dependencies:
157
157
  version: '6.0'
158
158
  - - ">="
159
159
  - !ruby/object:Gem::Version
160
- version: 6.0.2
160
+ version: 6.0.3
161
161
  type: :development
162
162
  prerelease: false
163
163
  version_requirements: !ruby/object:Gem::Requirement
@@ -167,7 +167,7 @@ dependencies:
167
167
  version: '6.0'
168
168
  - - ">="
169
169
  - !ruby/object:Gem::Version
170
- version: 6.0.2
170
+ version: 6.0.3
171
171
  - !ruby/object:Gem::Dependency
172
172
  name: rspec
173
173
  requirement: !ruby/object:Gem::Requirement
@@ -188,14 +188,20 @@ dependencies:
188
188
  requirements:
189
189
  - - "~>"
190
190
  - !ruby/object:Gem::Version
191
- version: '1.7'
191
+ version: '1.8'
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: 1.8.1
192
195
  type: :development
193
196
  prerelease: false
194
197
  version_requirements: !ruby/object:Gem::Requirement
195
198
  requirements:
196
199
  - - "~>"
197
200
  - !ruby/object:Gem::Version
198
- version: '1.7'
201
+ version: '1.8'
202
+ - - ">="
203
+ - !ruby/object:Gem::Version
204
+ version: 1.8.1
199
205
  - !ruby/object:Gem::Dependency
200
206
  name: rubocop-performance
201
207
  requirement: !ruby/object:Gem::Requirement
@@ -205,7 +211,7 @@ dependencies:
205
211
  version: '1.9'
206
212
  - - ">="
207
213
  - !ruby/object:Gem::Version
208
- version: 1.9.1
214
+ version: 1.9.2
209
215
  type: :development
210
216
  prerelease: false
211
217
  version_requirements: !ruby/object:Gem::Requirement
@@ -215,7 +221,7 @@ dependencies:
215
221
  version: '1.9'
216
222
  - - ">="
217
223
  - !ruby/object:Gem::Version
218
- version: 1.9.1
224
+ version: 1.9.2
219
225
  - !ruby/object:Gem::Dependency
220
226
  name: rubocop-rspec
221
227
  requirement: !ruby/object:Gem::Requirement