README.md in truemail-0.1.1.2 vs README.md in truemail-0.1.1.3
- old
+ new
@@ -1,10 +1,10 @@
# Truemail
-[![Gem Version](https://badge.fury.io/rb/truemail.svg)](https://badge.fury.io/rb/truemail) [![CircleCI](https://circleci.com/gh/rubygarage/truemail/tree/feature/validator-result-class.svg?style=svg)](https://circleci.com/gh/rubygarage/truemail/tree/feature/validator-result-class)
+[![Maintainability](https://api.codeclimate.com/v1/badges/657aa241399927dcd2e2/maintainability)](https://codeclimate.com/github/rubygarage/truemail/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/657aa241399927dcd2e2/test_coverage)](https://codeclimate.com/github/rubygarage/truemail/test_coverage) [![Gem Version](https://badge.fury.io/rb/truemail.svg)](https://badge.fury.io/rb/truemail) [![CircleCI](https://circleci.com/gh/rubygarage/truemail/tree/develop.svg?style=svg)](https://circleci.com/gh/rubygarage/truemail/tree/develop)
-The main idea of this gem is to validate emails by regex pattern, presence of domain mx-records, and real existence of email account on a current email server.
+The Truemail gem helps you validate emails by regex pattern, presence of domain mx-records, and real existence of email account on a current email server.
## Installation
Add this line to your application's Gemfile:
@@ -20,55 +20,55 @@
$ gem install truemail
## Email Validation Methods
-Email validation is a tricky thing to do properly. There are a number of different ways to validate an email address. All checking mechanisms conform to best practices, and provide confident validation.
+Email validation is a tricky thing. There are a number of different ways to validate an email address and all mechanisms must conform with the best practices and provide proper validation.
-**Syntax Checking**: This checks the email addresses via regex pattern.
+**Syntax Checking**: Checks the email addresses via regex pattern.
-**Mail Server Existence Check**: This checks the availability of the email address domain using DNS MX records.
+**Mail Server Existence Check**: Checks the availability of the email address domain using DNS MX records.
-**Mail Existence Check**: This checks if the email address really exists and can receive email via SMTP connections and email-sending emulation techniques.
+**Mail Existence Check**: Checks if the email address really exists and can receive email via SMTP connections and email-sending emulation techniques.
## Usage
### Configuration features
#### Set configuration
-To have access for Truemail.configuration and gem features you must configure it first. Just do it with block like in example below.
+To have an access for ```Truemail.configuration``` and gem features, you must configure it first as in the example below:
```ruby
Truemail.configure do |config|
- # Required parameter. Should be an existing email on behalf of which verification will be performed
+ # Required parameter. Must be an existing email on behalf of which verification will be performed
config.verifier_email = 'verifier@example.com'
- # Optional parameter. Should be an existing domain on behalf of which verification will be performed.
+ # Optional parameter. Must be an existing domain on behalf of which verification will be performed.
# By default verifier domain based on verifier email
config.verifier_domain = 'somedomain.com'
# Optional parameter. You can override default regex pattern
config.email_pattern = /regex_pattern/
- # Optional parameter. By default connection timeout is equal to 2 ms
+ # Optional parameter. Connection timeout is equal to 2 ms by default.
config.connection_timeout = 1
- # Optional parameter. By default smtp response timeout is equal to 2 ms
+ # Optional parameter. A SMTP server response timeout is equal to 2 ms by default.
config.response_timeout = 1
- # Optional parameter. You can to predefined which validation use for some domains
+ # Optional parameter. You can predefine which type of validation will be used for domains.
# Available validation types: :regex, :mx, :smtp
# This configuration will be used over current or default validation type parameter
# All of validations for 'somedomain.com' will be processed with mx validation only
config.validation_type_for = { 'somedomain.com' => :mx }
end
```
#### Read configuration
-After successful configuration you can read current Truemail configuration instance anywhere in your application.
+After successful configuration, you can read current Truemail configuration instance anywhere in your application.
```ruby
Truemail.configuration
=> #<Truemail::Configuration:0x000055590cb17b40
@@ -111,13 +111,13 @@
### Validation features
#### Regex validation
-Validation with regex pattern is first validation level. You can redefine regex pattern in gem configuration.
+Validation with regex pattern is the first validation level.
-Examples of using:
+Example of usage:
1. With default regex pattern
```ruby
Truemail.configure do |config|
@@ -129,11 +129,11 @@
=> #<Truemail::Validator:0x000055590cc9bdb8
@result=<struct Truemail::Validator::Result success=true, email="email@example.com", domain=nil, mail_servers=[], errors={}, smtp_debug=nil>,
@validation_type=:regex>
```
-2. With custom regex pattern
+2. With custom regex pattern. You should define your custom regex pattern in a gem configuration before.
```ruby
Truemail.configure do |config|
config.verifier_email = 'verifier@example.com'
config.config.email_pattern = /regex_pattern/
@@ -145,13 +145,13 @@
@result=<struct Truemail::Validator::Result success=true, email="email@example.com", domain=nil, mail_servers=[], errors={}, smtp_debug=nil>, @validation_type=:regex>
```
#### MX validation
-Validation by MX records is second validation level. It use Regex validation before run. When regex validation has completed successfully then starts itself.
+Validation by MX records is second validation level. It uses Regex validation before launch. When regex validation has completed successfully then runs itself.
-Example of using:
+Example of usage:
```ruby
Truemail.configure do |config|
config.verifier_email = 'verifier@example.com'
end
@@ -163,16 +163,16 @@
@validation_type=:mx>
```
#### SMTP validation
-SMTP validation is a final, third validation level. It try to check real existence of email account on a current email server. This validation runs chain of previous validations, and if they complete successfully runs itself.
+SMTP validation is a final, third validation level. This type of validation tries to check real existence of email account on a current email server. This validation runs a chain of previous validations, and if they're complete, successfully runs itself.
```code
[Regex validation] -> [MX validation] -> [SMTP validation]
```
-By default you don't need pass with-parameter to use it. Example of using:
+By default, you don't need pass with-parameter to use it. Example of usage is specified below:
```ruby
Truemail.configure do |config|
config.verifier_email = 'verifier@example.com'
end