truemail 1.7.0 → 1.9.2

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: eb8cb5fec7b8a099bb4861bf2e07d72236d93a22c1dfd79eaef2c722d9160765
4
- data.tar.gz: 05174034b4c4f493cd43c0d2dbb2380972bd6ee884f75592bde43300efc33e28
3
+ metadata.gz: caf982d3dd889a337ae95ab4d4fa79157964e02d83656016ecead8d0831c4d46
4
+ data.tar.gz: 9b7ec050811c49072d18f7cd9e36229b982af742f24db3a031d4ab1e2e08f780
5
5
  SHA512:
6
- metadata.gz: cd660c9f167bdd910788d66eca957c7332917ce8fa1e5a1dca807efa2c256f7b0feb5c6fdecd43321afd0eb50b27f3c8d768f796e3ca1bb3c2173f1565aac58f
7
- data.tar.gz: 78eefc8c3737e5f878fcb6bf18ddba001e555b230ff02b422b0b1d77002c4834dda2924e38f660f340fec4438af3967b81ae9e095e00fe5a213c13a5d256f30a
6
+ metadata.gz: d8991eb0d33e2aaff25fdbe9fc95b45e8ee6e0c2661b9c82e622eca182f22570b01f27848b60353bf1ce70419c94cbe23cd51871872e0f92f624676d8a0c317c
7
+ data.tar.gz: 7b8e1b24a90019bf21cb1534f64962ba8b68fe8fd6734a564d57c69fbf483c8e35a14bfd35317c58023f6f54616cad591439ac6eddef878604522d929dd6e42a
@@ -7,7 +7,7 @@ checks:
7
7
  plugins:
8
8
  rubocop:
9
9
  enabled: true
10
- channel: rubocop-0-78
10
+ channel: rubocop-0-91
11
11
 
12
12
  reek:
13
13
  enabled: true
@@ -4,7 +4,7 @@
4
4
 
5
5
  - [ ] I have updated truemail to the latest version
6
6
  - [ ] I have read the [Contribution Guidelines](https://github.com/rubygarage/truemail/blob/master/CONTRIBUTING.md)
7
- - [ ] I have read the [documentation](https://github.com/rubygarage/truemail/blob/master/README.md)
7
+ - [ ] I have read the [documentation](https://truemail-rb.org/truemail-gem)
8
8
  - [ ] I have searched for [existing GitHub issues](https://github.com/rubygarage/truemail/issues)
9
9
 
10
10
  ### Issue Description
data/.reek.yml CHANGED
@@ -39,6 +39,8 @@ detectors:
39
39
  - Truemail::Validate::Mx#a_record
40
40
  - Truemail::Audit::Base#verifier_domain
41
41
  - Truemail::Configuration#domain_matcher
42
+ - Truemail::Configuration#logger_options
43
+ - Truemail::Log::Serializer::Base#errors
42
44
 
43
45
  ControlParameter:
44
46
  exclude:
@@ -55,6 +57,8 @@ detectors:
55
57
  - Truemail::ConfigurationHelper#create_configuration
56
58
  - Truemail::Log::Serializer::Base#smtp_debug
57
59
  - Truemail::Log::Serializer::Text#data_composer
60
+ - Truemail::Log::Serializer::ValidatorBase#smtp_debug
61
+ - Truemail::Log::Serializer::ValidatorText#data_composer
58
62
 
59
63
  NilCheck:
60
64
  exclude:
@@ -40,6 +40,81 @@ Style/EmptyCaseCondition:
40
40
  Style/RescueStandardError:
41
41
  Enabled: false
42
42
 
43
+ Style/AccessorGrouping:
44
+ Enabled: true
45
+
46
+ Style/ArrayCoercion:
47
+ Enabled: true
48
+
49
+ Style/BisectedAttrAccessor:
50
+ Enabled: true
51
+
52
+ Style/CaseLikeIf:
53
+ Enabled: true
54
+
55
+ Style/ExplicitBlockArgument:
56
+ Enabled: true
57
+
58
+ Style/ExponentialNotation:
59
+ Enabled: true
60
+
61
+ Style/GlobalStdStream:
62
+ Enabled: true
63
+
64
+ Style/HashAsLastArrayItem:
65
+ Enabled: true
66
+
67
+ Style/HashEachMethods:
68
+ Enabled: true
69
+
70
+ Style/HashLikeCase:
71
+ Enabled: true
72
+
73
+ Style/HashTransformKeys:
74
+ Enabled: true
75
+
76
+ Style/HashTransformValues:
77
+ Enabled: true
78
+
79
+ Style/OptionalBooleanParameter:
80
+ Enabled: true
81
+
82
+ Style/RedundantAssignment:
83
+ Enabled: true
84
+
85
+ Style/RedundantFetchBlock:
86
+ Enabled: true
87
+
88
+ Style/RedundantFileExtensionInRequire:
89
+ Enabled: true
90
+
91
+ Style/RedundantRegexpCharacterClass:
92
+ Enabled: true
93
+
94
+ Style/RedundantRegexpEscape:
95
+ Enabled: true
96
+
97
+ Style/SingleArgumentDig:
98
+ Enabled: true
99
+
100
+ Style/SlicingWithRange:
101
+ Enabled: true
102
+
103
+ Style/StringConcatenation:
104
+ Enabled: true
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
+
43
118
  Layout/LineLength:
44
119
  Max: 140
45
120
 
@@ -50,15 +125,9 @@ Layout/ClassStructure:
50
125
  - include
51
126
  - prepend
52
127
  - extend
53
- associations:
54
- - has_one
55
- - has_many
56
- - belongs_to
57
- - has_and_belongs_to_many
58
128
  ExpectedOrder:
59
129
  - module_inclusion
60
130
  - constants
61
- - associations
62
131
  - public_class_methods
63
132
  - initializer
64
133
  - public_methods
@@ -68,9 +137,108 @@ Layout/ClassStructure:
68
137
  Layout/EmptyLineAfterGuardClause:
69
138
  Enabled: false
70
139
 
140
+ Layout/SpaceAroundMethodCallOperator:
141
+ Enabled: true
142
+
143
+ Layout/EmptyLinesAroundAttributeAccessor:
144
+ Enabled: true
145
+
146
+ Layout/BeginEndAlignment:
147
+ Enabled: true
148
+
71
149
  Lint/NonDeterministicRequireOrder:
72
150
  Enabled: false
73
151
 
152
+ Lint/BinaryOperatorWithIdenticalOperands:
153
+ Enabled: true
154
+
155
+ Lint/DeprecatedOpenSSLConstant:
156
+ Enabled: true
157
+
158
+ Lint/DuplicateElsifCondition:
159
+ Enabled: true
160
+
161
+ Lint/DuplicateRescueException:
162
+ Enabled: true
163
+
164
+ Lint/EmptyConditionalBody:
165
+ Enabled: true
166
+
167
+ Lint/FloatComparison:
168
+ Enabled: true
169
+
170
+ Lint/MissingSuper:
171
+ Enabled: false
172
+
173
+ Lint/MixedRegexpCaptureTypes:
174
+ Enabled: true
175
+
176
+ Lint/OutOfRangeRegexpRef:
177
+ Enabled: true
178
+
179
+ Lint/RaiseException:
180
+ Enabled: true
181
+
182
+ Lint/SelfAssignment:
183
+ Enabled: true
184
+
185
+ Lint/StructNewOverride:
186
+ Enabled: true
187
+
188
+ Lint/TopLevelReturnWithArgument:
189
+ Enabled: true
190
+
191
+ Lint/UnreachableLoop:
192
+ Enabled: true
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
+
215
+ Performance/AncestorsInclude:
216
+ Enabled: true
217
+
218
+ Performance/BigDecimalWithNumericArgument:
219
+ Enabled: true
220
+
221
+ Performance/RedundantSortBlock:
222
+ Enabled: true
223
+
224
+ Performance/RedundantStringChars:
225
+ Enabled: true
226
+
227
+ Performance/ReverseFirst:
228
+ Enabled: true
229
+
230
+ Performance/SortReverse:
231
+ Enabled: true
232
+
233
+ Performance/Squeeze:
234
+ Enabled: true
235
+
236
+ Performance/StringInclude:
237
+ Enabled: true
238
+
239
+ Performance/Sum:
240
+ Enabled: true
241
+
74
242
  RSpec/ExampleLength:
75
243
  Enabled: false
76
244
 
@@ -94,3 +262,6 @@ RSpec/MessageSpies:
94
262
 
95
263
  RSpec/MultipleDescribes:
96
264
  Enabled: false
265
+
266
+ RSpec/MultipleMemoizedHelpers:
267
+ Enabled: false
@@ -1,11 +1,165 @@
1
1
  # Changelog
2
+
2
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).
3
4
 
5
+ ## [1.9.2] - 2020.10.02
6
+
7
+ ### Added
8
+
9
+ - `Truemail::TypeError`
10
+ - error handling for invalid types as input email
11
+
12
+ ### Changed
13
+
14
+ - Updated `Truemail.validate`
15
+ - Updated `Truemail.valid?`
16
+
17
+ ## [1.9.1] - 2020.09.21
18
+
19
+ ### Changed
20
+
21
+ Migrated to updated Ruby 2.7.x syntax.
22
+
23
+ - Updated `Truemail::Configuration#logger=`
24
+
25
+ ## [1.9.0] - 2020.09.01
26
+
27
+ ### Added
28
+
29
+ - Ability to use `Truemail::Auditor` instance represented as json directly
30
+ - `Truemail::Log::Serializer::AuditorJson`
31
+
32
+ ### Changed
33
+
34
+ - `Truemail::Auditor`, `Truemail::Validator`
35
+ - serializers namespaces
36
+ - gem development dependencies
37
+ - gem documentation
38
+
39
+ ```ruby
40
+ Truemail.host_audit.as_json
41
+
42
+ =>
43
+ # Serialized Truemail::Auditor instance
44
+ {
45
+ "date": "2020-08-31 22:33:43 +0300",
46
+ "current_host_ip": "127.0.0.1",
47
+ "warnings": {
48
+ "dns": "A-record of verifier domain not refers to current host ip address", "ptr": "PTR-record does not reference to current verifier domain"
49
+ },
50
+ "configuration": {
51
+ "validation_type_by_domain": null,
52
+ "whitelist_validation": false,
53
+ "whitelisted_domains": null,
54
+ "blacklisted_domains": null,
55
+ "not_rfc_mx_lookup_flow": false,
56
+ "smtp_safe_check": false,
57
+ "email_pattern": "default gem value",
58
+ "smtp_error_body_pattern": "default gem value"
59
+ }
60
+ }
61
+ ```
62
+
63
+ ## [1.8.0] - 2020.06.21
64
+
65
+ ### Added
66
+
67
+ Separated audit features for verifier host.
68
+
69
+ - `Truemail::Audit::Ip`
70
+ - `Truemail::Audit::Dns`
71
+
72
+ ```ruby
73
+ Truemail.host_audit
74
+
75
+ => #<Truemail::Auditor:0x00005580df358828
76
+ @result=
77
+ #<struct Truemail::Auditor::Result
78
+ current_host_ip="127.0.0.1",
79
+ warnings={
80
+ :dns=>"a record of verifier domain not refers to current host ip address",
81
+ :ptr=>"ptr record does not reference to current verifier domain"
82
+ },
83
+ configuration=
84
+ #<Truemail::Configuration:0x00005615e86327a8
85
+ @blacklisted_domains=[],
86
+ @connection_attempts=2,
87
+ @connection_timeout=2,
88
+ @default_validation_type=:smtp,
89
+ @email_pattern=/(?=\A.{6,255}\z)(\A([\p{L}0-9]+[\w|\-|\.|\+]*)@((?i-mx:[\p{L}0-9]+([\-\.]{1}[\p{L}0-9]+)*\.[\p{L}]{2,63}))\z)/,
90
+ @response_timeout=2,
91
+ @smtp_error_body_pattern=/(?=.*550)(?=.*(user|account|customer|mailbox)).*/i,
92
+ @not_rfc_mx_lookup_flow=false,
93
+ @smtp_safe_check=false,
94
+ @validation_type_by_domain={},
95
+ @verifier_domain="example.com",
96
+ @verifier_email="verifier@example.com",
97
+ @whitelist_validation=false,
98
+ @whitelisted_domains=[]>
99
+ ```
100
+
101
+ ### Changed
102
+
103
+ - `Truemail::Auditor`
104
+ - `Truemail::Auditor::Result`
105
+ - `Truemail::Audit::Base`
106
+ - `Truemail::Audit::Ptr`
107
+ - `Truemail::VERSION`
108
+ - gem documentation
109
+
110
+ ## [1.7.1] - 2020.05.10
111
+
112
+ ### Added
113
+
114
+ - Ability to show `not_rfc_mx_lookup_flow` attribute in serialized validation result
115
+
116
+ ```ruby
117
+ Truemail.validate('nonexistent_email@bestweb.com.ua').as_json
118
+
119
+ =>
120
+ # Serialized Truemail::Validator instance
121
+ {
122
+ "date": "2020-05-10 10:00:00 +0200",
123
+ "email": "nonexistent_email@bestweb.com.ua",
124
+ "validation_type": "smtp",
125
+ "success": false,
126
+ "errors": {
127
+ "smtp": "smtp error"
128
+ },
129
+ "smtp_debug": [
130
+ {
131
+ "mail_host": "213.180.193.89",
132
+ "port_opened": true,
133
+ "connection": true,
134
+ "errors": {
135
+ "rcptto": "550 5.7.1 No such user!\n"
136
+ }
137
+ }
138
+ ],
139
+ "configuration": {
140
+ "validation_type_by_domain": null,
141
+ "whitelist_validation": false,
142
+ "whitelisted_domains": null,
143
+ "blacklisted_domains": null,
144
+ "not_rfc_mx_lookup_flow": false,
145
+ "smtp_safe_check": false,
146
+ "email_pattern": "default gem value",
147
+ "smtp_error_body_pattern": "default gem value"
148
+ }
149
+ }
150
+ ```
151
+
152
+ ### Changed
153
+
154
+ - `Truemail::Log::Serializer::Base`
155
+ - `Truemail::VERSION`
156
+ - gem documentation
157
+
4
158
  ## [1.7.0] - 2020.05.09
5
159
 
6
- ## Added
160
+ ### Added
7
161
 
8
- - Possibility to use not RFC MX lookup flow (MX and Null MX records will be checked on the DNS validation layer only)
162
+ - Ability to use not RFC MX lookup flow (MX and Null MX records will be checked on the DNS validation layer only)
9
163
 
10
164
  ```ruby
11
165
  Truemail.configure do |config|
@@ -43,7 +197,7 @@ end
43
197
 
44
198
  ### Added
45
199
 
46
- - Possibility to use `Truemail::Validator` instance represented as json directly
200
+ - Ability to use `Truemail::Validator` instance represented as json directly
47
201
 
48
202
  ### Changed
49
203
 
@@ -1,40 +1,39 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- truemail (1.7.0)
4
+ truemail (1.9.2)
5
5
  simpleidn (~> 0.1.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- ast (2.4.0)
11
- bundler-audit (0.6.1)
10
+ ast (2.4.1)
11
+ bundler-audit (0.7.0.1)
12
12
  bundler (>= 1.2.0, < 3)
13
- thor (~> 0.18)
13
+ thor (>= 0.18, < 2)
14
14
  byebug (11.1.3)
15
- childprocess (3.0.0)
16
- coderay (1.1.2)
15
+ childprocess (4.0.0)
16
+ coderay (1.1.3)
17
17
  colorize (0.8.1)
18
- diff-lcs (1.3)
18
+ diff-lcs (1.4.4)
19
19
  docile (1.3.2)
20
20
  fasterer (0.8.3)
21
21
  colorize (~> 0.7)
22
22
  ruby_parser (>= 3.14.1)
23
- ffaker (2.14.0)
23
+ ffaker (2.17.0)
24
24
  iniparse (1.5.0)
25
- jaro_winkler (1.5.4)
26
- json (2.3.0)
25
+ json (2.3.1)
27
26
  json_matchers (0.11.1)
28
27
  json_schema
29
- json_schema (0.20.8)
28
+ json_schema (0.20.9)
30
29
  kwalify (0.7.2)
31
30
  method_source (1.0.0)
32
- overcommit (0.53.0)
33
- childprocess (>= 0.6.3, < 4)
31
+ overcommit (0.55.0)
32
+ childprocess (>= 0.6.3, < 5)
34
33
  iniparse (~> 1.4)
35
- parallel (1.19.1)
36
- parser (2.7.1.2)
37
- ast (~> 2.4.0)
34
+ parallel (1.19.2)
35
+ parser (2.7.1.4)
36
+ ast (~> 2.4.1)
38
37
  pry (0.13.1)
39
38
  coderay (~> 1.1)
40
39
  method_source (~> 1.0)
@@ -44,11 +43,13 @@ GEM
44
43
  psych (3.1.0)
45
44
  rainbow (3.0.0)
46
45
  rake (13.0.1)
47
- reek (6.0.0)
46
+ reek (6.0.1)
48
47
  kwalify (~> 0.7.0)
49
48
  parser (>= 2.5.0.0, < 2.8, != 2.5.1.1)
50
49
  psych (~> 3.1.0)
51
50
  rainbow (>= 2.0, < 4.0)
51
+ regexp_parser (1.8.0)
52
+ rexml (3.2.4)
52
53
  rspec (3.9.0)
53
54
  rspec-core (~> 3.9.0)
54
55
  rspec-expectations (~> 3.9.0)
@@ -62,21 +63,26 @@ GEM
62
63
  diff-lcs (>= 1.2.0, < 2.0)
63
64
  rspec-support (~> 3.9.0)
64
65
  rspec-support (3.9.3)
65
- rubocop (0.79.0)
66
- jaro_winkler (~> 1.5.1)
66
+ rubocop (0.91.0)
67
67
  parallel (~> 1.10)
68
- parser (>= 2.7.0.1)
68
+ parser (>= 2.7.1.1)
69
69
  rainbow (>= 2.2.2, < 4.0)
70
+ regexp_parser (>= 1.7)
71
+ rexml
72
+ rubocop-ast (>= 0.4.0, < 1.0)
70
73
  ruby-progressbar (~> 1.7)
71
- unicode-display_width (>= 1.4.0, < 1.7)
72
- rubocop-performance (1.5.2)
73
- rubocop (>= 0.71.0)
74
- rubocop-rspec (1.39.0)
75
- rubocop (>= 0.68.1)
74
+ unicode-display_width (>= 1.4.0, < 2.0)
75
+ rubocop-ast (0.4.2)
76
+ parser (>= 2.7.1.4)
77
+ rubocop-performance (1.8.1)
78
+ rubocop (>= 0.87.0)
79
+ rubocop-ast (>= 0.4.0)
80
+ rubocop-rspec (1.43.2)
81
+ rubocop (~> 0.87)
76
82
  ruby-progressbar (1.10.1)
77
- ruby_parser (3.14.2)
83
+ ruby_parser (3.15.0)
78
84
  sexp_processor (~> 4.9)
79
- sexp_processor (4.14.1)
85
+ sexp_processor (4.15.1)
80
86
  simplecov (0.17.1)
81
87
  docile (~> 1.1)
82
88
  json (>= 1.8, < 3)
@@ -84,35 +90,35 @@ GEM
84
90
  simplecov-html (0.10.2)
85
91
  simpleidn (0.1.1)
86
92
  unf (~> 0.1.4)
87
- thor (0.20.3)
88
- truemail-rspec (0.1.2)
93
+ thor (1.0.1)
94
+ truemail-rspec (0.2.1)
89
95
  rspec (~> 3.9)
90
96
  truemail (~> 1.4, >= 1.4.1)
91
97
  unf (0.1.4)
92
98
  unf_ext
93
99
  unf_ext (0.0.7.7)
94
- unicode-display_width (1.6.1)
100
+ unicode-display_width (1.7.0)
95
101
 
96
102
  PLATFORMS
97
103
  ruby
98
104
 
99
105
  DEPENDENCIES
100
106
  bundler (~> 1.16)
101
- bundler-audit (~> 0.6.1)
107
+ bundler-audit (~> 0.7.0.1)
102
108
  fasterer (~> 0.8.3)
103
- ffaker (~> 2.14)
109
+ ffaker (~> 2.17)
104
110
  json_matchers (~> 0.11.1)
105
- overcommit (~> 0.53.0)
111
+ overcommit (~> 0.55.0)
106
112
  pry-byebug (~> 3.9)
107
113
  rake (~> 13.0, >= 13.0.1)
108
- reek (~> 6.0)
114
+ reek (~> 6.0, >= 6.0.1)
109
115
  rspec (~> 3.9)
110
- rubocop (~> 0.79.0)
111
- rubocop-performance (~> 1.5, >= 1.5.2)
112
- rubocop-rspec (~> 1.39)
116
+ rubocop (~> 0.91.0)
117
+ rubocop-performance (~> 1.8, >= 1.8.1)
118
+ rubocop-rspec (~> 1.43, >= 1.43.2)
113
119
  simplecov (~> 0.17.1)
114
120
  truemail!
115
- truemail-rspec (~> 0.1.2)
121
+ truemail-rspec (~> 0.2.1)
116
122
 
117
123
  BUNDLED WITH
118
124
  1.16.6