truemail 0.1.10 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -2
- data/lib/truemail/core.rb +1 -0
- data/lib/truemail/validate/skip.rb +11 -0
- data/lib/truemail/validator.rb +1 -1
- data/lib/truemail/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb37fadb88c2a0705dc7504ba9e227671d5ce61d75cb08ee7aa8cf2722abff05
|
4
|
+
data.tar.gz: 7a1d28d03fabc1043443b3283c5fbe219e6634d2116a005127a456d254478a04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd889d737e59df1ea8f77953ebc6b87897b9b50a1632f68801e1c47329bfb96272be68de87935c0d2b97a93c91a6d3a85a6e7325f11d8dfacfb2cb5a77fb6de3
|
7
|
+
data.tar.gz: 85837fcdbe93933194f7bcceefac18bbda51fc4a841a501cd9166e8cdbf1f2668a9aeb4dea79761b8393a352ab3ddfa51feabdc45bdce496304227c26abeb97b
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -8,6 +8,7 @@ The Truemail gem helps you validate emails by regex pattern, presence of domain
|
|
8
8
|
|
9
9
|
- Configurable validator, validate only what you need
|
10
10
|
- Zero runtime dependencies
|
11
|
+
- Has simple SMTP debugger
|
11
12
|
- 100% test coverage
|
12
13
|
|
13
14
|
## Installation
|
@@ -73,10 +74,10 @@ Truemail.configure do |config|
|
|
73
74
|
config.connection_attempts = 3
|
74
75
|
|
75
76
|
# Optional parameter. You can predefine which type of validation will be used for domains.
|
76
|
-
# Available validation types: :regex, :mx, :smtp
|
77
|
+
# Also you can skip validation by domain. Available validation types: :regex, :mx, :smtp, :skip
|
77
78
|
# This configuration will be used over current or default validation type parameter
|
78
79
|
# All of validations for 'somedomain.com' will be processed with mx validation only
|
79
|
-
config.validation_type_for = { 'somedomain.com' => :mx }
|
80
|
+
config.validation_type_for = { 'somedomain.com' => :mx, 'otherdomain.com' => :skip }
|
80
81
|
|
81
82
|
# Optional parameter. This option will be parse bodies of SMTP errors. It will be helpful
|
82
83
|
# if SMTP server does not return an exact answer that the email does not exist
|
data/lib/truemail/core.rb
CHANGED
data/lib/truemail/validator.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module Truemail
|
4
4
|
class Validator
|
5
5
|
RESULT_ATTRS = %i[success email domain mail_servers errors smtp_debug].freeze
|
6
|
-
VALIDATION_TYPES = %i[regex mx smtp].freeze
|
6
|
+
VALIDATION_TYPES = %i[regex mx smtp skip].freeze
|
7
7
|
|
8
8
|
Result = Struct.new(*RESULT_ATTRS, keyword_init: true) do
|
9
9
|
def initialize(errors: {}, mail_servers: [], **args)
|
data/lib/truemail/version.rb
CHANGED
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: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladislav Trotsenko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -201,6 +201,7 @@ files:
|
|
201
201
|
- lib/truemail/validate/base.rb
|
202
202
|
- lib/truemail/validate/mx.rb
|
203
203
|
- lib/truemail/validate/regex.rb
|
204
|
+
- lib/truemail/validate/skip.rb
|
204
205
|
- lib/truemail/validate/smtp.rb
|
205
206
|
- lib/truemail/validate/smtp/request.rb
|
206
207
|
- lib/truemail/validate/smtp/response.rb
|