truemail 2.6.0 → 2.6.1

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: 2826eb4303d5730ba1cd199cf91d7ef07946d3d167af6b8a3eee704c56127490
4
- data.tar.gz: e23c0881d4e066857e51421a511b46e13e61bd6c9e4690223ed83fffc3947249
3
+ metadata.gz: 1499bcd186c7d733fc168a7167b5e171fb2617a37c041e9372a644fc1ecff09a
4
+ data.tar.gz: 6c9320d328da028de9f2e4b3241a91457d1984bc6f5b9e4325fe0c52b1a8f2b4
5
5
  SHA512:
6
- metadata.gz: facbed503237e69db472f8392402e45e04e3fb41bf44cab0048eaee7b8968ae0a68a72da34315d1ebe066001ec253ae5da96adab1b4c2891fa069404afe1db77
7
- data.tar.gz: d93dc1d183fbafb6be9a12b35d38ddebff6d5b92d76cb80f559238303f27ce5246caaa271665b0060a0ae340678831ad3bcec949cdd0447085469f223a629a8e
6
+ metadata.gz: '08e5b9f6fb5d6cc628058925401ea80cfc4f0614f16ffce25044b7c3965cbf5eb6560b88faac0732e80eb09d3711a15b2122c29ce623371cf30cb62477952420'
7
+ data.tar.gz: 4e18f42b916c4994f48b9cc4742ba80473934e9c15c41ef2d34d40b0e69e5f31058a45d78ffdd350040d25d4346b5e4e5c11e91edba0c34a8433c1e2bafaacf7
data/.reek.yml CHANGED
@@ -14,6 +14,7 @@ detectors:
14
14
  - Truemail::Validate::Mx#hosts_from_cname_records
15
15
  - Truemail::Configuration#logger=
16
16
  - Truemail::Validate::Smtp::Request#initialize
17
+ - Truemail::Validate::Smtp::Request::Session#initialize
17
18
 
18
19
  TooManyInstanceVariables:
19
20
  exclude:
data/.rubocop.yml CHANGED
@@ -374,6 +374,9 @@ Gemspec/DateAssignment:
374
374
  Gemspec/RequireMFA:
375
375
  Enabled: false
376
376
 
377
+ Gemspec/RubyVersionGlobalsUsage:
378
+ Enabled: false
379
+
377
380
  Security/IoMethods:
378
381
  Enabled: true
379
382
 
data/CHANGELOG.md CHANGED
@@ -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.6.1] - 2022.01.04
6
+
7
+ ### Fixed
8
+
9
+ - Fixed redefining builtin implementations caused using stdlib as external dependencies. Thanks [@allard](https://github.com/allard) for report.
10
+
11
+ ### Updated
12
+
13
+ - Updated `Truemail::Validate::Smtp::Request::Session#initialize`, `Truemail::Validate::Smtp::Request::Session#start`, tests
14
+ - Updated rubocop/reek configs
15
+ - Updated gem docs, version
16
+
5
17
  ## [2.6.0] - 2021.12.28
6
18
 
7
19
  ### Added
@@ -33,7 +45,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
33
45
 
34
46
  ### Fixed
35
47
 
36
- - Ruby 3.0 stdlib SMTP client SSL certificate verification issues for cases when IP address uses as MX host. Thanks [@esb](https://github.com/esb) for bug report.
48
+ - Fixed Ruby 3.0 stdlib SMTP client SSL certificate verification issues for cases when IP address uses as MX host. Thanks [@esb](https://github.com/esb) for bug report.
37
49
 
38
50
  ### Updated
39
51
 
@@ -55,24 +55,34 @@ module Truemail
55
55
  class Session
56
56
  require 'net/smtp'
57
57
 
58
- def initialize(host, port, connection_timeout, response_timeout)
59
- @net_smtp = (old_net_smtp? ? ::Net::SMTP.new(host, port) : ::Net::SMTP.new(host, port, tls_verify: false)).tap do |settings|
58
+ UNDEFINED_VERSION = '0.0.0'
59
+
60
+ def initialize(host, port, connection_timeout, response_timeout, net_class = ::Net::SMTP)
61
+ @net_class = net_class
62
+ @net_smtp_version = resolve_net_smtp_version
63
+ @net_smtp = (old_net_smtp? ? net_class.new(host, port) : net_class.new(host, port, tls_verify: false)).tap do |settings|
60
64
  settings.open_timeout = connection_timeout
61
65
  settings.read_timeout = response_timeout
62
66
  end
63
67
  end
64
68
 
65
69
  def start(helo_domain, &block)
66
- return net_smtp.start(helo_domain, &block) if old_net_smtp?
70
+ return net_smtp.start(helo_domain, &block) if net_smtp_version < '0.2.0'
71
+ return net_smtp.start(helo_domain, tls_verify: false, &block) if old_net_smtp?
67
72
  net_smtp.start(helo: helo_domain, &block)
68
73
  end
69
74
 
70
75
  private
71
76
 
72
- attr_reader :net_smtp
77
+ attr_reader :net_class, :net_smtp_version, :net_smtp
78
+
79
+ def resolve_net_smtp_version
80
+ return net_class::VERSION if net_class.const_defined?(:VERSION)
81
+ Truemail::Validate::Smtp::Request::Session::UNDEFINED_VERSION
82
+ end
73
83
 
74
84
  def old_net_smtp?
75
- !::Net::SMTP.const_defined?(:VERSION) || ::Net::SMTP::VERSION < '0.3.0'
85
+ net_smtp_version < '0.3.0'
76
86
  end
77
87
  end
78
88
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Truemail
4
- VERSION = '2.6.0'
4
+ VERSION = '2.6.1'
5
5
  end
data/truemail.gemspec CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.executables = spec.files.grep(%r{^exe/}) { |f| ::File.basename(f) }
32
32
  spec.require_paths = ['lib']
33
33
 
34
- spec.add_runtime_dependency 'net-smtp', '~> 0.3'
34
+ spec.add_runtime_dependency 'net-smtp', '~> 0.3' if ::RUBY_VERSION >= '3.1.0'
35
35
  spec.add_runtime_dependency 'simpleidn', '~> 0.2.1'
36
36
 
37
37
  spec.add_development_dependency 'bundler-audit', '~> 0.9.0.1'
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: truemail
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.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: 2021-12-28 00:00:00.000000000 Z
11
+ date: 2022-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: net-smtp
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '0.3'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '0.3'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: simpleidn
29
15
  requirement: !ruby/object:Gem::Requirement