truemail 1.5.1 → 1.6.0
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +4 -4
- data/README.md +42 -2
- data/lib/truemail/validator.rb +4 -0
- data/lib/truemail/version.rb +1 -1
- data/truemail.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d30a86344d7bc981d3e918faa43537fa37a3acab261cf5d004791084a4c7c4ea
|
4
|
+
data.tar.gz: 70360a9cc946ee53a3a5c22652514941ed49a93f5aeedc6f87db8cc9feb606b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b9780a4df12c7f9b33e20e74f7f7e4835ab2dd5bc43213b81314369c644c413e4f4a293069705f0c968d634d9051e935844db19e08f7795807aef4701a192a6
|
7
|
+
data.tar.gz: 38adc27351a202244ab7f05cb4dbb1500dece6bbba5f358ebb06613a873531ff8799418d3b4da103c97ffc99800534fbe7a647de91a49fb36a4f830bfc398cdb
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
# Changelog
|
2
2
|
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
3
|
|
4
|
+
## [1.6.0] - 2020-02-01
|
5
|
+
### Added
|
6
|
+
- Possibility to use `Truemail::Validator` instance represented as json directly
|
7
|
+
|
8
|
+
### Changed
|
9
|
+
- gem development dependencies
|
10
|
+
- gem documentation
|
11
|
+
|
4
12
|
## [1.5.1] - 2020-01-20
|
5
13
|
### Changed
|
6
14
|
- gem development dependencies
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
truemail (1.
|
4
|
+
truemail (1.6.0)
|
5
5
|
simpleidn (~> 0.1.1)
|
6
6
|
|
7
7
|
GEM
|
@@ -15,7 +15,7 @@ GEM
|
|
15
15
|
bundler-audit (0.6.1)
|
16
16
|
bundler (>= 1.2.0, < 3)
|
17
17
|
thor (~> 0.18)
|
18
|
-
byebug (11.1.
|
18
|
+
byebug (11.1.1)
|
19
19
|
childprocess (3.0.0)
|
20
20
|
codeclimate-engine-rb (0.4.1)
|
21
21
|
virtus (~> 1.0)
|
@@ -50,7 +50,7 @@ GEM
|
|
50
50
|
pry (0.12.2)
|
51
51
|
coderay (~> 1.1.0)
|
52
52
|
method_source (~> 0.9.0)
|
53
|
-
pry-byebug (3.
|
53
|
+
pry-byebug (3.8.0)
|
54
54
|
byebug (~> 11.0)
|
55
55
|
pry (~> 0.10)
|
56
56
|
psych (3.1.0)
|
@@ -122,7 +122,7 @@ DEPENDENCIES
|
|
122
122
|
ffaker (~> 2.13)
|
123
123
|
json_matchers (~> 0.11.1)
|
124
124
|
overcommit (~> 0.52.1)
|
125
|
-
pry-byebug (~> 3.
|
125
|
+
pry-byebug (~> 3.8)
|
126
126
|
rake (~> 13.0, >= 13.0.1)
|
127
127
|
reek (~> 5.6)
|
128
128
|
rspec (~> 3.9)
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# <img src='https://repository-images.githubusercontent.com/173723932/6dffee00-e88e-11e9-94b6-c97aacc0df00' height='250' alt='Truemail - configurable framework agnostic plain Ruby email validator' />
|
2
2
|
|
3
|
-
[](https://codeclimate.com/github/rubygarage/truemail/maintainability) [](https://codeclimate.com/github/rubygarage/truemail/test_coverage) [](https://circleci.com/gh/rubygarage/truemail/tree/master) [](https://badge.fury.io/rb/truemail) [](https://rubygems.org/gems/truemail) [](CODE_OF_CONDUCT.md)
|
3
|
+
[](https://codeclimate.com/github/rubygarage/truemail/maintainability) [](https://codeclimate.com/github/rubygarage/truemail/test_coverage) [](https://circleci.com/gh/rubygarage/truemail/tree/master) [](https://badge.fury.io/rb/truemail) [](https://rubygems.org/gems/truemail) [](https://gitter.im/truemail-rb/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [](CODE_OF_CONDUCT.md)
|
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
|
|
@@ -36,6 +36,7 @@ Configurable framework agnostic plain Ruby email validator. Verify email via Reg
|
|
36
36
|
- [PTR audit](#ptr-audit)
|
37
37
|
- [Truemail helpers](#truemail-helpers)
|
38
38
|
- [.valid?](#valid)
|
39
|
+
- [#as_json](#as_json)
|
39
40
|
- [Test environment](#test-environment)
|
40
41
|
- [Truemail family](#truemail-family)
|
41
42
|
- [Contributing](#contributing)
|
@@ -928,7 +929,7 @@ Truemail.host_audit
|
|
928
929
|
|
929
930
|
#### .valid?
|
930
931
|
|
931
|
-
You can use the
|
932
|
+
You can use the `.valid?` helper for quick validation of email address. It returns a boolean:
|
932
933
|
|
933
934
|
```ruby
|
934
935
|
# It is shortcut for Truemail.validate('email@example.com').result.valid?
|
@@ -936,6 +937,45 @@ Truemail.valid?('email@example.com')
|
|
936
937
|
=> true
|
937
938
|
```
|
938
939
|
|
940
|
+
#### #as_json
|
941
|
+
|
942
|
+
You can use `#as_json` helper for represent `Truemail::Validator` instance as json. Under the hood it uses internal json serializer [`Truemail::Log::Serializer::Json`](#json-serializer):
|
943
|
+
|
944
|
+
```ruby
|
945
|
+
Truemail.validate('nonexistent_email@bestweb.com.ua').as_json
|
946
|
+
|
947
|
+
=>
|
948
|
+
# Serialized Truemail::Validator instance
|
949
|
+
{
|
950
|
+
"date": "2020-02-01 10:00:00 +0200",
|
951
|
+
"email": "nonexistent_email@bestweb.com.ua",
|
952
|
+
"validation_type": "smtp",
|
953
|
+
"success": false,
|
954
|
+
"errors": {
|
955
|
+
"smtp": "smtp error"
|
956
|
+
},
|
957
|
+
"smtp_debug": [
|
958
|
+
{
|
959
|
+
"mail_host": "213.180.193.89",
|
960
|
+
"port_opened": true,
|
961
|
+
"connection": true,
|
962
|
+
"errors": {
|
963
|
+
"rcptto": "550 5.7.1 No such user!\n"
|
964
|
+
}
|
965
|
+
}
|
966
|
+
],
|
967
|
+
"configuration": {
|
968
|
+
"validation_type_by_domain": null,
|
969
|
+
"whitelist_validation": false,
|
970
|
+
"whitelisted_domains": null,
|
971
|
+
"blacklisted_domains": null,
|
972
|
+
"smtp_safe_check": false,
|
973
|
+
"email_pattern": "default gem value",
|
974
|
+
"smtp_error_body_pattern": "default gem value"
|
975
|
+
}
|
976
|
+
}
|
977
|
+
```
|
978
|
+
|
939
979
|
### Test environment
|
940
980
|
|
941
981
|
You can stub out that validation for your test environment. Just add RSpec before action:
|
data/lib/truemail/validator.rb
CHANGED
data/lib/truemail/version.rb
CHANGED
data/truemail.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_development_dependency 'ffaker', '~> 2.13'
|
32
32
|
spec.add_development_dependency 'json_matchers', '~> 0.11.1'
|
33
33
|
spec.add_development_dependency 'overcommit', '~> 0.52.1'
|
34
|
-
spec.add_development_dependency 'pry-byebug', '~> 3.
|
34
|
+
spec.add_development_dependency 'pry-byebug', '~> 3.8'
|
35
35
|
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.1'
|
36
36
|
spec.add_development_dependency 'reek', '~> 5.6'
|
37
37
|
spec.add_development_dependency 'rspec', '~> 3.9'
|
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.
|
4
|
+
version: 1.6.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: 2020-01
|
11
|
+
date: 2020-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simpleidn
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '3.
|
117
|
+
version: '3.8'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '3.
|
124
|
+
version: '3.8'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rake
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|