truemail 1.9.0 → 1.9.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 +39 -0
- data/CHANGELOG.md +12 -4
- data/Gemfile.lock +14 -13
- data/LICENSE.txt +1 -1
- data/README.md +2 -1
- data/lib/truemail/configuration.rb +7 -1
- data/lib/truemail/validator.rb +1 -1
- data/lib/truemail/version.rb +1 -1
- data/truemail.gemspec +4 -4
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4132e99e612c8a1f9309dd9b81ef2ce5c234296209d631411687a4622c8581d2
|
4
|
+
data.tar.gz: 360800f323194eaefa48592f4781ce232d9e205785b6eaea15fc22b8b6d28d24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2786a16f5e4418cf704c1cc3eba5b4879072ed17e4a6a36180cb5994a8a824e7e492de4ec211c729783653e783538435f7b799b7f17d847d957511ba6a091687
|
7
|
+
data.tar.gz: 4ecc2dcfd6377826852e64f59471aa2c70fe84be8739d1b20e73350beffc9b4e932b4fac62c48869850d8a28157aeb7756238964d3126e62026ff7f79a999edb
|
data/.codeclimate.yml
CHANGED
data/.reek.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -103,6 +103,18 @@ Style/SlicingWithRange:
|
|
103
103
|
Style/StringConcatenation:
|
104
104
|
Enabled: true
|
105
105
|
|
106
|
+
Style/CombinableLoops:
|
107
|
+
Enabled: true
|
108
|
+
|
109
|
+
Style/KeywordParametersOrder:
|
110
|
+
Enabled: true
|
111
|
+
|
112
|
+
Style/RedundantSelfAssignment:
|
113
|
+
Enabled: true
|
114
|
+
|
115
|
+
Style/SoleNestedConditional:
|
116
|
+
Enabled: true
|
117
|
+
|
106
118
|
Layout/LineLength:
|
107
119
|
Max: 140
|
108
120
|
|
@@ -131,6 +143,9 @@ Layout/SpaceAroundMethodCallOperator:
|
|
131
143
|
Layout/EmptyLinesAroundAttributeAccessor:
|
132
144
|
Enabled: true
|
133
145
|
|
146
|
+
Layout/BeginEndAlignment:
|
147
|
+
Enabled: true
|
148
|
+
|
134
149
|
Lint/NonDeterministicRequireOrder:
|
135
150
|
Enabled: false
|
136
151
|
|
@@ -176,6 +191,27 @@ Lint/TopLevelReturnWithArgument:
|
|
176
191
|
Lint/UnreachableLoop:
|
177
192
|
Enabled: true
|
178
193
|
|
194
|
+
Lint/ConstantDefinitionInBlock:
|
195
|
+
Enabled: true
|
196
|
+
|
197
|
+
Lint/DuplicateRequire:
|
198
|
+
Enabled: true
|
199
|
+
|
200
|
+
Lint/EmptyFile:
|
201
|
+
Enabled: true
|
202
|
+
|
203
|
+
Lint/IdentityComparison:
|
204
|
+
Enabled: true
|
205
|
+
|
206
|
+
Lint/TrailingCommaInAttributeDeclaration:
|
207
|
+
Enabled: true
|
208
|
+
|
209
|
+
Lint/UselessMethodDefinition:
|
210
|
+
Enabled: true
|
211
|
+
|
212
|
+
Lint/UselessTimes:
|
213
|
+
Enabled: true
|
214
|
+
|
179
215
|
Performance/AncestorsInclude:
|
180
216
|
Enabled: true
|
181
217
|
|
@@ -200,6 +236,9 @@ Performance/Squeeze:
|
|
200
236
|
Performance/StringInclude:
|
201
237
|
Enabled: true
|
202
238
|
|
239
|
+
Performance/Sum:
|
240
|
+
Enabled: true
|
241
|
+
|
203
242
|
RSpec/ExampleLength:
|
204
243
|
Enabled: false
|
205
244
|
|
data/CHANGELOG.md
CHANGED
@@ -2,9 +2,17 @@
|
|
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
|
+
## [1.9.1] - 2020.09.21
|
6
|
+
|
7
|
+
### Changed
|
8
|
+
|
9
|
+
Migrated to updated Ruby 2.7.x syntax.
|
10
|
+
|
11
|
+
- Updated `Truemail::Configuration#logger=`
|
12
|
+
|
5
13
|
## [1.9.0] - 2020.09.01
|
6
14
|
|
7
|
-
|
15
|
+
### Added
|
8
16
|
|
9
17
|
- Ability to use `Truemail::Auditor` instance represented as json directly
|
10
18
|
- `Truemail::Log::Serializer::AuditorJson`
|
@@ -42,7 +50,7 @@ Truemail.host_audit.as_json
|
|
42
50
|
|
43
51
|
## [1.8.0] - 2020.06.21
|
44
52
|
|
45
|
-
|
53
|
+
### Added
|
46
54
|
|
47
55
|
Separated audit features for verifier host.
|
48
56
|
|
@@ -89,7 +97,7 @@ Truemail.host_audit
|
|
89
97
|
|
90
98
|
## [1.7.1] - 2020.05.10
|
91
99
|
|
92
|
-
|
100
|
+
### Added
|
93
101
|
|
94
102
|
- Ability to show `not_rfc_mx_lookup_flow` attribute in serialized validation result
|
95
103
|
|
@@ -137,7 +145,7 @@ Truemail.validate('nonexistent_email@bestweb.com.ua').as_json
|
|
137
145
|
|
138
146
|
## [1.7.0] - 2020.05.09
|
139
147
|
|
140
|
-
|
148
|
+
### Added
|
141
149
|
|
142
150
|
- Ability to use not RFC MX lookup flow (MX and Null MX records will be checked on the DNS validation layer only)
|
143
151
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
truemail (1.9.
|
4
|
+
truemail (1.9.1)
|
5
5
|
simpleidn (~> 0.1.1)
|
6
6
|
|
7
7
|
GEM
|
@@ -48,7 +48,7 @@ GEM
|
|
48
48
|
parser (>= 2.5.0.0, < 2.8, != 2.5.1.1)
|
49
49
|
psych (~> 3.1.0)
|
50
50
|
rainbow (>= 2.0, < 4.0)
|
51
|
-
regexp_parser (1.
|
51
|
+
regexp_parser (1.8.0)
|
52
52
|
rexml (3.2.4)
|
53
53
|
rspec (3.9.0)
|
54
54
|
rspec-core (~> 3.9.0)
|
@@ -63,25 +63,26 @@ GEM
|
|
63
63
|
diff-lcs (>= 1.2.0, < 2.0)
|
64
64
|
rspec-support (~> 3.9.0)
|
65
65
|
rspec-support (3.9.3)
|
66
|
-
rubocop (0.
|
66
|
+
rubocop (0.91.0)
|
67
67
|
parallel (~> 1.10)
|
68
68
|
parser (>= 2.7.1.1)
|
69
69
|
rainbow (>= 2.2.2, < 4.0)
|
70
70
|
regexp_parser (>= 1.7)
|
71
71
|
rexml
|
72
|
-
rubocop-ast (>= 0.
|
72
|
+
rubocop-ast (>= 0.4.0, < 1.0)
|
73
73
|
ruby-progressbar (~> 1.7)
|
74
74
|
unicode-display_width (>= 1.4.0, < 2.0)
|
75
|
-
rubocop-ast (0.
|
75
|
+
rubocop-ast (0.4.2)
|
76
76
|
parser (>= 2.7.1.4)
|
77
|
-
rubocop-performance (1.
|
78
|
-
rubocop (>= 0.
|
77
|
+
rubocop-performance (1.8.1)
|
78
|
+
rubocop (>= 0.87.0)
|
79
|
+
rubocop-ast (>= 0.4.0)
|
79
80
|
rubocop-rspec (1.43.2)
|
80
81
|
rubocop (~> 0.87)
|
81
82
|
ruby-progressbar (1.10.1)
|
82
|
-
ruby_parser (3.
|
83
|
+
ruby_parser (3.15.0)
|
83
84
|
sexp_processor (~> 4.9)
|
84
|
-
sexp_processor (4.15.
|
85
|
+
sexp_processor (4.15.1)
|
85
86
|
simplecov (0.17.1)
|
86
87
|
docile (~> 1.1)
|
87
88
|
json (>= 1.8, < 3)
|
@@ -90,7 +91,7 @@ GEM
|
|
90
91
|
simpleidn (0.1.1)
|
91
92
|
unf (~> 0.1.4)
|
92
93
|
thor (1.0.1)
|
93
|
-
truemail-rspec (0.2.
|
94
|
+
truemail-rspec (0.2.1)
|
94
95
|
rspec (~> 3.9)
|
95
96
|
truemail (~> 1.4, >= 1.4.1)
|
96
97
|
unf (0.1.4)
|
@@ -112,12 +113,12 @@ DEPENDENCIES
|
|
112
113
|
rake (~> 13.0, >= 13.0.1)
|
113
114
|
reek (~> 6.0, >= 6.0.1)
|
114
115
|
rspec (~> 3.9)
|
115
|
-
rubocop (~> 0.
|
116
|
-
rubocop-performance (~> 1.
|
116
|
+
rubocop (~> 0.91.0)
|
117
|
+
rubocop-performance (~> 1.8, >= 1.8.1)
|
117
118
|
rubocop-rspec (~> 1.43, >= 1.43.2)
|
118
119
|
simplecov (~> 0.17.1)
|
119
120
|
truemail!
|
120
|
-
truemail-rspec (~> 0.2.
|
121
|
+
truemail-rspec (~> 0.2.1)
|
121
122
|
|
122
123
|
BUNDLED WITH
|
123
124
|
1.16.6
|
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2019 Vladislav Trotsenko
|
3
|
+
Copyright (c) 2019-2020 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
@@ -4,6 +4,8 @@
|
|
4
4
|
|
5
5
|
Configurable framework agnostic plain Ruby email validator. Verify email via Regex, DNS and SMTP. Be sure that email address valid and exists.
|
6
6
|
|
7
|
+
> Actual and maintainable documentation :books: for developers is living [here](https://truemail-rb.org/truemail-gem).
|
8
|
+
|
7
9
|
## Table of Contents
|
8
10
|
|
9
11
|
- [Synopsis](#synopsis)
|
@@ -53,7 +55,6 @@ Configurable framework agnostic plain Ruby email validator. Verify email via Reg
|
|
53
55
|
- [Credits](#credits)
|
54
56
|
- [Versioning](#versioning)
|
55
57
|
- [Changelog](CHANGELOG.md)
|
56
|
-
- [Developers Documentation](https://truemail-rb.org/truemail-gem/)
|
57
58
|
|
58
59
|
## Synopsis
|
59
60
|
|
@@ -6,6 +6,7 @@ module Truemail
|
|
6
6
|
DEFAULT_RESPONSE_TIMEOUT = 2
|
7
7
|
DEFAULT_CONNECTION_ATTEMPTS = 2
|
8
8
|
DEFAULT_VALIDATION_TYPE = :smtp
|
9
|
+
DEFAULT_LOGGER_OPTIONS = { tracking_event: :error, stdout: false, log_absolute_path: nil }.freeze
|
9
10
|
|
10
11
|
attr_reader :email_pattern,
|
11
12
|
:smtp_error_body_pattern,
|
@@ -71,7 +72,8 @@ module Truemail
|
|
71
72
|
end
|
72
73
|
end
|
73
74
|
|
74
|
-
def logger=(
|
75
|
+
def logger=(options)
|
76
|
+
tracking_event, stdout, log_absolute_path = logger_options(options)
|
75
77
|
valid_event = Truemail::Log::Event::TRACKING_EVENTS.key?(tracking_event)
|
76
78
|
stdout_only = stdout && log_absolute_path.nil?
|
77
79
|
file_only = log_absolute_path.is_a?(String)
|
@@ -140,5 +142,9 @@ module Truemail
|
|
140
142
|
check_validation_type(validation_type)
|
141
143
|
end
|
142
144
|
end
|
145
|
+
|
146
|
+
def logger_options(current_options)
|
147
|
+
Truemail::Configuration::DEFAULT_LOGGER_OPTIONS.merge(current_options).values
|
148
|
+
end
|
143
149
|
end
|
144
150
|
end
|
data/lib/truemail/validator.rb
CHANGED
@@ -18,7 +18,7 @@ module Truemail
|
|
18
18
|
|
19
19
|
attr_reader :validation_type
|
20
20
|
|
21
|
-
def initialize(email, with: nil
|
21
|
+
def initialize(email, configuration:, with: nil)
|
22
22
|
with ||= configuration.default_validation_type
|
23
23
|
raise Truemail::ArgumentError.new(with, :argument) unless Truemail::Validator::VALIDATION_TYPES.include?(with)
|
24
24
|
@result = Truemail::Validator::Result.new(email: email, configuration: configuration)
|
data/lib/truemail/version.rb
CHANGED
data/truemail.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
'homepage_uri' => 'https://truemail-rb.org',
|
21
21
|
'changelog_uri' => 'https://github.com/rubygarage/truemail/blob/master/CHANGELOG.md',
|
22
22
|
'source_code_uri' => 'https://github.com/rubygarage/truemail',
|
23
|
-
'documentation_uri' => 'https://truemail-rb.org/truemail-gem
|
23
|
+
'documentation_uri' => 'https://truemail-rb.org/truemail-gem',
|
24
24
|
'bug_tracker_uri' => 'https://github.com/rubygarage/truemail/issues'
|
25
25
|
}
|
26
26
|
|
@@ -43,9 +43,9 @@ Gem::Specification.new do |spec|
|
|
43
43
|
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.1'
|
44
44
|
spec.add_development_dependency 'reek', '~> 6.0', '>= 6.0.1'
|
45
45
|
spec.add_development_dependency 'rspec', '~> 3.9'
|
46
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
47
|
-
spec.add_development_dependency 'rubocop-performance', '~> 1.
|
46
|
+
spec.add_development_dependency 'rubocop', '~> 0.91.0'
|
47
|
+
spec.add_development_dependency 'rubocop-performance', '~> 1.8', '>= 1.8.1'
|
48
48
|
spec.add_development_dependency 'rubocop-rspec', '~> 1.43', '>= 1.43.2'
|
49
49
|
spec.add_development_dependency 'simplecov', '~> 0.17.1'
|
50
|
-
spec.add_development_dependency 'truemail-rspec', '~> 0.2.
|
50
|
+
spec.add_development_dependency 'truemail-rspec', '~> 0.2.1'
|
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: 1.9.
|
4
|
+
version: 1.9.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-09-
|
11
|
+
date: 2020-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simpleidn
|
@@ -182,34 +182,34 @@ dependencies:
|
|
182
182
|
requirements:
|
183
183
|
- - "~>"
|
184
184
|
- !ruby/object:Gem::Version
|
185
|
-
version: 0.
|
185
|
+
version: 0.91.0
|
186
186
|
type: :development
|
187
187
|
prerelease: false
|
188
188
|
version_requirements: !ruby/object:Gem::Requirement
|
189
189
|
requirements:
|
190
190
|
- - "~>"
|
191
191
|
- !ruby/object:Gem::Version
|
192
|
-
version: 0.
|
192
|
+
version: 0.91.0
|
193
193
|
- !ruby/object:Gem::Dependency
|
194
194
|
name: rubocop-performance
|
195
195
|
requirement: !ruby/object:Gem::Requirement
|
196
196
|
requirements:
|
197
197
|
- - "~>"
|
198
198
|
- !ruby/object:Gem::Version
|
199
|
-
version: '1.
|
199
|
+
version: '1.8'
|
200
200
|
- - ">="
|
201
201
|
- !ruby/object:Gem::Version
|
202
|
-
version: 1.
|
202
|
+
version: 1.8.1
|
203
203
|
type: :development
|
204
204
|
prerelease: false
|
205
205
|
version_requirements: !ruby/object:Gem::Requirement
|
206
206
|
requirements:
|
207
207
|
- - "~>"
|
208
208
|
- !ruby/object:Gem::Version
|
209
|
-
version: '1.
|
209
|
+
version: '1.8'
|
210
210
|
- - ">="
|
211
211
|
- !ruby/object:Gem::Version
|
212
|
-
version: 1.
|
212
|
+
version: 1.8.1
|
213
213
|
- !ruby/object:Gem::Dependency
|
214
214
|
name: rubocop-rspec
|
215
215
|
requirement: !ruby/object:Gem::Requirement
|
@@ -250,14 +250,14 @@ dependencies:
|
|
250
250
|
requirements:
|
251
251
|
- - "~>"
|
252
252
|
- !ruby/object:Gem::Version
|
253
|
-
version: 0.2.
|
253
|
+
version: 0.2.1
|
254
254
|
type: :development
|
255
255
|
prerelease: false
|
256
256
|
version_requirements: !ruby/object:Gem::Requirement
|
257
257
|
requirements:
|
258
258
|
- - "~>"
|
259
259
|
- !ruby/object:Gem::Version
|
260
|
-
version: 0.2.
|
260
|
+
version: 0.2.1
|
261
261
|
description: Configurable framework agnostic plain Ruby email validator. Verify email
|
262
262
|
via Regex, DNS and SMTP.
|
263
263
|
email:
|
@@ -322,7 +322,7 @@ metadata:
|
|
322
322
|
homepage_uri: https://truemail-rb.org
|
323
323
|
changelog_uri: https://github.com/rubygarage/truemail/blob/master/CHANGELOG.md
|
324
324
|
source_code_uri: https://github.com/rubygarage/truemail
|
325
|
-
documentation_uri: https://truemail-rb.org/truemail-gem
|
325
|
+
documentation_uri: https://truemail-rb.org/truemail-gem
|
326
326
|
bug_tracker_uri: https://github.com/rubygarage/truemail/issues
|
327
327
|
post_install_message:
|
328
328
|
rdoc_options: []
|