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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 297e4833b9652ed239d157a21f13e54495d2f88dd1fcfe72173df718a42f3c67
4
- data.tar.gz: 9cc876220623ff3b5b19fdf005f74332975f5fb6b2ecf6afceeb2b2b852f1c01
3
+ metadata.gz: cb37fadb88c2a0705dc7504ba9e227671d5ce61d75cb08ee7aa8cf2722abff05
4
+ data.tar.gz: 7a1d28d03fabc1043443b3283c5fbe219e6634d2116a005127a456d254478a04
5
5
  SHA512:
6
- metadata.gz: e5af3df300ef218a2f10433294efd28a93b57979261f265d021b2cc25223845df28a9a2310dcda00ccfd75ac8de40e28a95d3991248f2e321934d215e1b67e88
7
- data.tar.gz: f7d966fd95efc12b0eaf8a4208769abdf9f917a998edf80b29e2f0fe00d95cd93f292e9700bafb19dffd2112dbc304fdf75a89286a7949f848e63e92577154e7
6
+ metadata.gz: fd889d737e59df1ea8f77953ebc6b87897b9b50a1632f68801e1c47329bfb96272be68de87935c0d2b97a93c91a6d3a85a6e7325f11d8dfacfb2cb5a77fb6de3
7
+ data.tar.gz: 85837fcdbe93933194f7bcceefac18bbda51fc4a841a501cd9166e8cdbf1f2668a9aeb4dea79761b8393a352ab3ddfa51feabdc45bdce496304227c26abeb97b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- truemail (0.1.10)
4
+ truemail (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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
@@ -30,6 +30,7 @@ module Truemail
30
30
  end
31
31
 
32
32
  module Validate
33
+ require 'truemail/validate/skip'
33
34
  require 'truemail/validate/base'
34
35
  require 'truemail/validate/regex'
35
36
  require 'truemail/validate/mx'
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Truemail
4
+ module Validate
5
+ class Skip < Truemail::Worker
6
+ def run
7
+ success(true)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Truemail
4
- VERSION = '0.1.10'
4
+ VERSION = '0.2.0'
5
5
  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: 0.1.10
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-10 00:00:00.000000000 Z
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