truemail 2.6.0 → 2.6.4

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: 2826eb4303d5730ba1cd199cf91d7ef07946d3d167af6b8a3eee704c56127490
4
- data.tar.gz: e23c0881d4e066857e51421a511b46e13e61bd6c9e4690223ed83fffc3947249
3
+ metadata.gz: 86e5ae8e40f56907c2d936d2d862e811e999590f8311c1500b373f4db5d833c4
4
+ data.tar.gz: 11be656f6ac87bb0a8867a6e6b38af1685f1115a3f3c7cd071249d32389d1321
5
5
  SHA512:
6
- metadata.gz: facbed503237e69db472f8392402e45e04e3fb41bf44cab0048eaee7b8968ae0a68a72da34315d1ebe066001ec253ae5da96adab1b4c2891fa069404afe1db77
7
- data.tar.gz: d93dc1d183fbafb6be9a12b35d38ddebff6d5b92d76cb80f559238303f27ce5246caaa271665b0060a0ae340678831ad3bcec949cdd0447085469f223a629a8e
6
+ metadata.gz: 3858e258ea5240db0002b78ecdf67717cd6e445ea6d6590b939a98d532fa7f34453c026816b30ccc9e953d6089d7e94aca48571c85d46465b1b01d4a97695a01
7
+ data.tar.gz: c8195912550d91c624bb000c941988a4766ef10a564acd3d46da45671aab5ab33d0473e5140e936d2cb284e4171b6ba2148f7ca32a87cbd0dc0bb27ecf05b963
data/.circleci/config.yml CHANGED
@@ -6,7 +6,7 @@ defaults: &defaults
6
6
  - image: cimg/ruby:<< parameters.ruby-version >>
7
7
 
8
8
  orbs:
9
- ruby: circleci/ruby@1.2.0
9
+ ruby: circleci/ruby@1.4.0
10
10
 
11
11
  references:
12
12
  restore_bundle_cache: &restore_bundle_cache
@@ -27,6 +27,12 @@ references:
27
27
  paths:
28
28
  - vendor/bundle
29
29
 
30
+ system_dependencies: &system_dependencies
31
+ run:
32
+ name: Installing system requirements
33
+ command: |
34
+ bundle exec smtp_mock -s -i ~
35
+
30
36
  install_codeclimate_reporter: &install_codeclimate_reporter
31
37
  run:
32
38
  name: Installing CodeClimate test reporter
@@ -34,6 +40,12 @@ references:
34
40
  curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
35
41
  chmod +x ./cc-test-reporter
36
42
 
43
+ use_compatible_gemspec: &use_compatible_gemspec
44
+ run:
45
+ name: Use compatible gemspec
46
+ command: |
47
+ cp .circleci/gemspec_compatible truemail.gemspec
48
+
37
49
  jobs:
38
50
  linters-ruby:
39
51
  parameters:
@@ -68,6 +80,7 @@ jobs:
68
80
  - <<: *restore_bundle_cache
69
81
  - <<: *bundle_install
70
82
  - <<: *save_bundle_cache
83
+ - <<: *system_dependencies
71
84
  - <<: *install_codeclimate_reporter
72
85
 
73
86
  - run:
@@ -99,10 +112,12 @@ jobs:
99
112
  - image: cimg/ruby:<< parameters.ruby-version >>
100
113
  steps:
101
114
  - checkout
115
+ - <<: *use_compatible_gemspec
102
116
  - ruby/install-deps:
103
- bundler-version: "2.3.3"
117
+ bundler-version: "2.3.5"
104
118
  with-cache: false
105
119
  path: './vendor/custom_bundle'
120
+ - <<: *system_dependencies
106
121
  - run:
107
122
  name: Running compatibility tests
108
123
  command: bundle exec rspec
@@ -113,12 +128,12 @@ workflows:
113
128
  - linters-ruby:
114
129
  matrix:
115
130
  parameters:
116
- ruby-version: ["2.5"]
131
+ ruby-version: ["3.1"]
117
132
  - tests-ruby:
118
133
  matrix:
119
134
  parameters:
120
- ruby-version: ["2.5"]
135
+ ruby-version: ["3.1"]
121
136
  - compatibility-ruby:
122
137
  matrix:
123
138
  parameters:
124
- ruby-version: ["2.6", "2.7", "3.0", "3.1"]
139
+ ruby-version: ["2.5", "2.6", "2.7", "3.0"]
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'truemail/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'truemail'
9
+ spec.version = Truemail::VERSION
10
+ spec.authors = ['Vladislav Trotsenko']
11
+ spec.email = ['admin@bestweb.com.ua']
12
+
13
+ spec.summary = %(truemail)
14
+ spec.description = %(Configurable framework agnostic plain Ruby email validator. Verify email via Regex, DNS, SMTP and even more.)
15
+
16
+ spec.homepage = 'https://github.com/truemail-rb/truemail'
17
+ spec.license = 'MIT'
18
+
19
+ spec.metadata = {
20
+ 'homepage_uri' => 'https://truemail-rb.org',
21
+ 'changelog_uri' => 'https://github.com/truemail-rb/truemail/blob/master/CHANGELOG.md',
22
+ 'source_code_uri' => 'https://github.com/truemail-rb/truemail',
23
+ 'documentation_uri' => 'https://truemail-rb.org/truemail-gem',
24
+ 'bug_tracker_uri' => 'https://github.com/truemail-rb/truemail/issues'
25
+ }
26
+
27
+ spec.required_ruby_version = '>= 2.5.0'
28
+
29
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
30
+ spec.bindir = 'exe'
31
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| ::File.basename(f) }
32
+ spec.require_paths = ['lib']
33
+
34
+ spec.add_runtime_dependency 'simpleidn', '~> 0.2.1'
35
+
36
+ spec.add_development_dependency 'dns_mock', '~> 1.5'
37
+ spec.add_development_dependency 'ffaker', '~> 2.20'
38
+ spec.add_development_dependency 'json_matchers', '~> 0.11.1'
39
+ spec.add_development_dependency 'pry-byebug', '~> 3.9'
40
+ spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
41
+ spec.add_development_dependency 'rspec', '~> 3.10'
42
+ spec.add_development_dependency 'smtp_mock', '~> 1.0'
43
+ spec.add_development_dependency 'truemail-rspec', '~> 0.7.0'
44
+ spec.add_development_dependency 'webmock', '~> 3.14'
45
+ end
data/.codeclimate.yml CHANGED
@@ -7,7 +7,7 @@ checks:
7
7
  plugins:
8
8
  rubocop:
9
9
  enabled: true
10
- channel: rubocop-1-24
10
+ channel: rubocop-1-25
11
11
 
12
12
  reek:
13
13
  enabled: true
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
 
@@ -475,3 +478,6 @@ RSpec/SubjectDeclaration:
475
478
 
476
479
  RSpec/FactoryBot/SyntaxMethods:
477
480
  Enabled: true
481
+
482
+ RSpec/SubjectStub:
483
+ Enabled: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.5.0
1
+ ruby-3.1.0
data/CHANGELOG.md CHANGED
@@ -2,6 +2,40 @@
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.4] - 2022.02.09
6
+
7
+ ### Fixed
8
+
9
+ - Fixed redefining builtin implementations caused using stdlib as external dependencies. Thanks [@adzap](https://github.com/adzap) for report.
10
+
11
+ ## [2.6.3] - 2022.02.07
12
+
13
+ ### Updated
14
+
15
+ - Updated gem `net-smtp` runtime dependency
16
+ - Updated gem development dependencies
17
+ - Updated gem version
18
+
19
+ ## [2.6.2] - 2022.01.19
20
+
21
+ ### Updated
22
+
23
+ - Updated tests
24
+ - Updated gem development dependencies
25
+ - Updated gem version
26
+
27
+ ## [2.6.1] - 2022.01.04
28
+
29
+ ### Fixed
30
+
31
+ - Fixed redefining builtin implementations caused using stdlib as external dependencies. Thanks [@allard](https://github.com/allard) for report.
32
+
33
+ ### Updated
34
+
35
+ - Updated `Truemail::Validate::Smtp::Request::Session#initialize`, `Truemail::Validate::Smtp::Request::Session#start`, tests
36
+ - Updated rubocop/reek configs
37
+ - Updated gem docs, version
38
+
5
39
  ## [2.6.0] - 2021.12.28
6
40
 
7
41
  ### Added
@@ -33,7 +67,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
33
67
 
34
68
  ### Fixed
35
69
 
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.
70
+ - 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
71
 
38
72
  ### Updated
39
73
 
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019-2021 Vladislav Trotsenko
3
+ Copyright (c) 2019-2022 Vladislav Trotsenko
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1387,7 +1387,7 @@ All Truemail solutions: https://truemail-rb.org
1387
1387
 
1388
1388
  ## Contributing
1389
1389
 
1390
- Bug reports and pull requests are welcome on GitHub at https://github.com/truemail-rb/truemail. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. Please check the [open tikets](https://github.com/truemail-rb/truemail/issues). Be shure to follow Contributor Code of Conduct below and our [Contributing Guidelines](CONTRIBUTING.md).
1390
+ Bug reports and pull requests are welcome on GitHub at https://github.com/truemail-rb/truemail. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. Please check the [open tickets](https://github.com/truemail-rb/truemail/issues). Be sure to follow Contributor Code of Conduct below and our [Contributing Guidelines](CONTRIBUTING.md).
1391
1391
 
1392
1392
  ## License
1393
1393
 
@@ -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.4'
5
5
  end
data/truemail.gemspec CHANGED
@@ -31,23 +31,24 @@ 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'
38
- spec.add_development_dependency 'dns_mock', '~> 1.4', '>= 1.4.4'
38
+ spec.add_development_dependency 'dns_mock', '~> 1.5', '>= 1.5.1'
39
39
  spec.add_development_dependency 'fasterer', '~> 0.9.0'
40
40
  spec.add_development_dependency 'ffaker', '~> 2.20'
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
44
  spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
45
- spec.add_development_dependency 'reek', '~> 6.0', '>= 6.0.6'
45
+ spec.add_development_dependency 'reek', '~> 6.1'
46
46
  spec.add_development_dependency 'rspec', '~> 3.10'
47
- spec.add_development_dependency 'rubocop', '~> 1.24'
48
- spec.add_development_dependency 'rubocop-performance', '~> 1.13'
49
- spec.add_development_dependency 'rubocop-rspec', '~> 2.7'
50
- spec.add_development_dependency 'simplecov', '~> 0.17.1'
47
+ spec.add_development_dependency 'rubocop', '~> 1.25', '>= 1.25.1'
48
+ spec.add_development_dependency 'rubocop-performance', '~> 1.13', '>= 1.13.2'
49
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.8'
50
+ spec.add_development_dependency 'simplecov', '~> 0.21.2'
51
+ spec.add_development_dependency 'smtp_mock', '~> 1.0'
51
52
  spec.add_development_dependency 'truemail-rspec', '~> 0.7.0'
52
53
  spec.add_development_dependency 'webmock', '~> 3.14'
53
54
  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.6.0
4
+ version: 2.6.4
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-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-smtp
@@ -58,20 +58,20 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.4'
61
+ version: '1.5'
62
62
  - - ">="
63
63
  - !ruby/object:Gem::Version
64
- version: 1.4.4
64
+ version: 1.5.1
65
65
  type: :development
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
69
  - - "~>"
70
70
  - !ruby/object:Gem::Version
71
- version: '1.4'
71
+ version: '1.5'
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: 1.4.4
74
+ version: 1.5.1
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: fasterer
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -168,20 +168,14 @@ dependencies:
168
168
  requirements:
169
169
  - - "~>"
170
170
  - !ruby/object:Gem::Version
171
- version: '6.0'
172
- - - ">="
173
- - !ruby/object:Gem::Version
174
- version: 6.0.6
171
+ version: '6.1'
175
172
  type: :development
176
173
  prerelease: false
177
174
  version_requirements: !ruby/object:Gem::Requirement
178
175
  requirements:
179
176
  - - "~>"
180
177
  - !ruby/object:Gem::Version
181
- version: '6.0'
182
- - - ">="
183
- - !ruby/object:Gem::Version
184
- version: 6.0.6
178
+ version: '6.1'
185
179
  - !ruby/object:Gem::Dependency
186
180
  name: rspec
187
181
  requirement: !ruby/object:Gem::Requirement
@@ -202,14 +196,20 @@ dependencies:
202
196
  requirements:
203
197
  - - "~>"
204
198
  - !ruby/object:Gem::Version
205
- version: '1.24'
199
+ version: '1.25'
200
+ - - ">="
201
+ - !ruby/object:Gem::Version
202
+ version: 1.25.1
206
203
  type: :development
207
204
  prerelease: false
208
205
  version_requirements: !ruby/object:Gem::Requirement
209
206
  requirements:
210
207
  - - "~>"
211
208
  - !ruby/object:Gem::Version
212
- version: '1.24'
209
+ version: '1.25'
210
+ - - ">="
211
+ - !ruby/object:Gem::Version
212
+ version: 1.25.1
213
213
  - !ruby/object:Gem::Dependency
214
214
  name: rubocop-performance
215
215
  requirement: !ruby/object:Gem::Requirement
@@ -217,6 +217,9 @@ dependencies:
217
217
  - - "~>"
218
218
  - !ruby/object:Gem::Version
219
219
  version: '1.13'
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: 1.13.2
220
223
  type: :development
221
224
  prerelease: false
222
225
  version_requirements: !ruby/object:Gem::Requirement
@@ -224,34 +227,51 @@ dependencies:
224
227
  - - "~>"
225
228
  - !ruby/object:Gem::Version
226
229
  version: '1.13'
230
+ - - ">="
231
+ - !ruby/object:Gem::Version
232
+ version: 1.13.2
227
233
  - !ruby/object:Gem::Dependency
228
234
  name: rubocop-rspec
229
235
  requirement: !ruby/object:Gem::Requirement
230
236
  requirements:
231
237
  - - "~>"
232
238
  - !ruby/object:Gem::Version
233
- version: '2.7'
239
+ version: '2.8'
234
240
  type: :development
235
241
  prerelease: false
236
242
  version_requirements: !ruby/object:Gem::Requirement
237
243
  requirements:
238
244
  - - "~>"
239
245
  - !ruby/object:Gem::Version
240
- version: '2.7'
246
+ version: '2.8'
241
247
  - !ruby/object:Gem::Dependency
242
248
  name: simplecov
243
249
  requirement: !ruby/object:Gem::Requirement
244
250
  requirements:
245
251
  - - "~>"
246
252
  - !ruby/object:Gem::Version
247
- version: 0.17.1
253
+ version: 0.21.2
254
+ type: :development
255
+ prerelease: false
256
+ version_requirements: !ruby/object:Gem::Requirement
257
+ requirements:
258
+ - - "~>"
259
+ - !ruby/object:Gem::Version
260
+ version: 0.21.2
261
+ - !ruby/object:Gem::Dependency
262
+ name: smtp_mock
263
+ requirement: !ruby/object:Gem::Requirement
264
+ requirements:
265
+ - - "~>"
266
+ - !ruby/object:Gem::Version
267
+ version: '1.0'
248
268
  type: :development
249
269
  prerelease: false
250
270
  version_requirements: !ruby/object:Gem::Requirement
251
271
  requirements:
252
272
  - - "~>"
253
273
  - !ruby/object:Gem::Version
254
- version: 0.17.1
274
+ version: '1.0'
255
275
  - !ruby/object:Gem::Dependency
256
276
  name: truemail-rspec
257
277
  requirement: !ruby/object:Gem::Requirement
@@ -289,6 +309,7 @@ extensions: []
289
309
  extra_rdoc_files: []
290
310
  files:
291
311
  - ".circleci/config.yml"
312
+ - ".circleci/gemspec_compatible"
292
313
  - ".codeclimate.yml"
293
314
  - ".github/BRANCH_NAMING_CONVENTION.md"
294
315
  - ".github/ISSUE_TEMPLATE/bug_report.md"
@@ -368,7 +389,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
368
389
  - !ruby/object:Gem::Version
369
390
  version: '0'
370
391
  requirements: []
371
- rubygems_version: 3.2.20
392
+ rubygems_version: 3.3.3
372
393
  signing_key:
373
394
  specification_version: 4
374
395
  summary: truemail