truemail-client 0.1.0 → 0.3.1
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/.codeclimate.yml +1 -1
- data/.github/BRANCH_NAMING_CONVENTION.md +36 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +28 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +27 -0
- data/.github/{ISSUE_TEMPLATE.md → ISSUE_TEMPLATE/issue_report.md} +15 -4
- data/.github/ISSUE_TEMPLATE/question.md +22 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +3 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +215 -3
- data/CHANGELOG.md +56 -1
- data/CONTRIBUTING.md +15 -14
- data/Gemfile.lock +80 -91
- data/README.md +40 -25
- data/lib/truemail/client.rb +10 -5
- data/lib/truemail/client/configuration.rb +1 -1
- data/lib/truemail/client/http.rb +19 -6
- data/lib/truemail/client/version.rb +1 -1
- data/truemail-client.gemspec +20 -12
- metadata +54 -45
data/CONTRIBUTING.md
CHANGED
@@ -6,28 +6,28 @@ Following these guidelines helps to communicate that you respect the time of the
|
|
6
6
|
|
7
7
|
## Using the issue tracker
|
8
8
|
|
9
|
-
The issue tracker is the preferred channel for [bug reports](#
|
9
|
+
The issue tracker is the preferred channel for [issue/bug reports](#issuebug-reports), [feature requests](#feature-requests), [questions](#questions) and submitting [pull requests](#pull-requests).
|
10
10
|
|
11
|
-
|
12
|
-
## Bug/issue reports
|
11
|
+
## Issue/bug reports
|
13
12
|
|
14
|
-
A bug is a _demonstrable problem_ that is caused by the code in the repository.
|
15
|
-
Good bug reports are extremely helpful - thank you!
|
13
|
+
A bug is a _demonstrable problem_ that is caused by the code in the repository. Good bug reports are extremely helpful - thank you!
|
16
14
|
|
17
|
-
Guidelines for bug reports:
|
15
|
+
Guidelines for issue/bug reports:
|
18
16
|
|
19
17
|
1. **Use the GitHub issue search** — check if the issue has already been reported
|
20
|
-
2. **Check if the issue has been fixed** — try to reproduce it using the latest `master` or
|
21
|
-
3. Truemail [issue template](.github/ISSUE_TEMPLATE.md)
|
18
|
+
2. **Check if the issue has been fixed** — try to reproduce it using the latest `master` or `develop` branch in the repository
|
19
|
+
3. Truemail [issue template](.github/ISSUE_TEMPLATE/issue_report.md)/[bug template](.github/ISSUE_TEMPLATE/bug_report.md)
|
22
20
|
|
23
21
|
A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What would you expect to be the outcome? All these details will help people to fix any potential bugs.
|
24
22
|
|
25
|
-
<a name="features"></a>
|
26
23
|
## Feature requests
|
27
24
|
|
28
25
|
Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to *you* to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible.
|
29
26
|
|
30
|
-
|
27
|
+
## Questions
|
28
|
+
|
29
|
+
We're always open to a new conversations. So if you have any questions just ask us.
|
30
|
+
|
31
31
|
## Pull requests
|
32
32
|
|
33
33
|
Good pull requests - patches, improvements, new features - are a fantastic help. They should remain focused in scope and avoid containing unrelated commits.
|
@@ -39,7 +39,8 @@ Please adhere to the coding conventions used throughout a project (indentation,
|
|
39
39
|
Guidelines for pull requests:
|
40
40
|
|
41
41
|
1. Truemail [pull request template](.github/PULL_REQUEST_TEMPLATE.md)
|
42
|
-
2. Fork the repo
|
43
|
-
3. Run the tests. This is to make sure your starting point works
|
44
|
-
4.
|
45
|
-
5.
|
42
|
+
2. Fork the repo, checkout to `develop` branch
|
43
|
+
3. Run the tests. This is to make sure your starting point works
|
44
|
+
4. Read our [branch naming convention](.github/BRANCH_NAMING_CONVENTION.md)
|
45
|
+
5. Create a new branch and make your changes. This includes tests for features!
|
46
|
+
6. Push to your fork and submit a pull request to `develop` branch
|
data/Gemfile.lock
CHANGED
@@ -1,117 +1,106 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
truemail-client (0.1
|
4
|
+
truemail-client (0.3.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
addressable (2.7.0)
|
10
10
|
public_suffix (>= 2.0.2, < 5.0)
|
11
|
-
ast (2.4.
|
12
|
-
|
13
|
-
descendants_tracker (~> 0.0.4)
|
14
|
-
ice_nine (~> 0.11.0)
|
15
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
16
|
-
bundler-audit (0.6.1)
|
11
|
+
ast (2.4.2)
|
12
|
+
bundler-audit (0.8.0)
|
17
13
|
bundler (>= 1.2.0, < 3)
|
18
|
-
thor (~> 0
|
19
|
-
byebug (11.1.
|
20
|
-
childprocess (
|
21
|
-
|
22
|
-
virtus (~> 1.0)
|
23
|
-
coderay (1.1.2)
|
24
|
-
coercible (1.0.0)
|
25
|
-
descendants_tracker (~> 0.0.1)
|
14
|
+
thor (~> 1.0)
|
15
|
+
byebug (11.1.3)
|
16
|
+
childprocess (4.0.0)
|
17
|
+
coderay (1.1.3)
|
26
18
|
colorize (0.8.1)
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
fasterer (0.
|
19
|
+
concurrent-ruby (1.1.8)
|
20
|
+
crack (0.4.5)
|
21
|
+
rexml
|
22
|
+
diff-lcs (1.4.4)
|
23
|
+
docile (1.3.5)
|
24
|
+
faker (2.17.0)
|
25
|
+
i18n (>= 1.6, < 2)
|
26
|
+
fasterer (0.9.0)
|
35
27
|
colorize (~> 0.7)
|
36
28
|
ruby_parser (>= 3.14.1)
|
37
|
-
ffaker (2.14.0)
|
38
29
|
hashdiff (1.0.1)
|
39
|
-
|
30
|
+
i18n (1.8.10)
|
31
|
+
concurrent-ruby (~> 1.0)
|
40
32
|
iniparse (1.5.0)
|
41
|
-
|
42
|
-
json (2.3.0)
|
33
|
+
json (2.5.1)
|
43
34
|
json_matchers (0.11.1)
|
44
35
|
json_schema
|
45
|
-
json_schema (0.
|
36
|
+
json_schema (0.21.0)
|
46
37
|
kwalify (0.7.2)
|
47
|
-
method_source (0.
|
48
|
-
overcommit (0.
|
49
|
-
childprocess (>= 0.6.3, <
|
38
|
+
method_source (1.0.0)
|
39
|
+
overcommit (0.57.0)
|
40
|
+
childprocess (>= 0.6.3, < 5)
|
50
41
|
iniparse (~> 1.4)
|
51
|
-
parallel (1.
|
52
|
-
parser (
|
53
|
-
ast (~> 2.4.
|
54
|
-
pry (0.
|
55
|
-
coderay (~> 1.1
|
56
|
-
method_source (~>
|
57
|
-
pry-byebug (3.
|
42
|
+
parallel (1.20.1)
|
43
|
+
parser (3.0.1.1)
|
44
|
+
ast (~> 2.4.1)
|
45
|
+
pry (0.13.1)
|
46
|
+
coderay (~> 1.1)
|
47
|
+
method_source (~> 1.0)
|
48
|
+
pry-byebug (3.9.0)
|
58
49
|
byebug (~> 11.0)
|
59
|
-
pry (~> 0.
|
60
|
-
psych (3.1
|
61
|
-
public_suffix (4.0.
|
50
|
+
pry (~> 0.13.0)
|
51
|
+
psych (3.3.1)
|
52
|
+
public_suffix (4.0.6)
|
62
53
|
rainbow (3.0.0)
|
63
|
-
rake (13.0.
|
64
|
-
reek (
|
65
|
-
codeclimate-engine-rb (~> 0.4.0)
|
54
|
+
rake (13.0.3)
|
55
|
+
reek (6.0.4)
|
66
56
|
kwalify (~> 0.7.0)
|
67
|
-
parser (
|
68
|
-
psych (~> 3.1
|
57
|
+
parser (~> 3.0.0)
|
58
|
+
psych (~> 3.1)
|
69
59
|
rainbow (>= 2.0, < 4.0)
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
rspec-
|
74
|
-
rspec-
|
75
|
-
|
76
|
-
|
77
|
-
|
60
|
+
regexp_parser (2.1.1)
|
61
|
+
rexml (3.2.5)
|
62
|
+
rspec (3.10.0)
|
63
|
+
rspec-core (~> 3.10.0)
|
64
|
+
rspec-expectations (~> 3.10.0)
|
65
|
+
rspec-mocks (~> 3.10.0)
|
66
|
+
rspec-core (3.10.1)
|
67
|
+
rspec-support (~> 3.10.0)
|
68
|
+
rspec-expectations (3.10.1)
|
78
69
|
diff-lcs (>= 1.2.0, < 2.0)
|
79
|
-
rspec-support (~> 3.
|
80
|
-
rspec-mocks (3.
|
70
|
+
rspec-support (~> 3.10.0)
|
71
|
+
rspec-mocks (3.10.2)
|
81
72
|
diff-lcs (>= 1.2.0, < 2.0)
|
82
|
-
rspec-support (~> 3.
|
83
|
-
rspec-support (3.
|
84
|
-
rubocop (
|
85
|
-
jaro_winkler (~> 1.5.1)
|
73
|
+
rspec-support (~> 3.10.0)
|
74
|
+
rspec-support (3.10.2)
|
75
|
+
rubocop (1.14.0)
|
86
76
|
parallel (~> 1.10)
|
87
|
-
parser (>=
|
77
|
+
parser (>= 3.0.0.0)
|
88
78
|
rainbow (>= 2.2.2, < 4.0)
|
79
|
+
regexp_parser (>= 1.8, < 3.0)
|
89
80
|
rexml
|
81
|
+
rubocop-ast (>= 1.5.0, < 2.0)
|
90
82
|
ruby-progressbar (~> 1.7)
|
91
|
-
unicode-display_width (>= 1.4.0, <
|
92
|
-
rubocop-
|
93
|
-
|
94
|
-
rubocop-
|
95
|
-
rubocop (>= 0.
|
96
|
-
|
97
|
-
|
83
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
84
|
+
rubocop-ast (1.5.0)
|
85
|
+
parser (>= 3.0.1.1)
|
86
|
+
rubocop-performance (1.11.3)
|
87
|
+
rubocop (>= 1.7.0, < 2.0)
|
88
|
+
rubocop-ast (>= 0.4.0)
|
89
|
+
rubocop-rspec (2.3.0)
|
90
|
+
rubocop (~> 1.0)
|
91
|
+
rubocop-ast (>= 1.1.0)
|
92
|
+
ruby-progressbar (1.11.0)
|
93
|
+
ruby_parser (3.15.1)
|
98
94
|
sexp_processor (~> 4.9)
|
99
|
-
|
100
|
-
sexp_processor (4.14.1)
|
95
|
+
sexp_processor (4.15.2)
|
101
96
|
simplecov (0.17.1)
|
102
97
|
docile (~> 1.1)
|
103
98
|
json (>= 1.8, < 3)
|
104
99
|
simplecov-html (~> 0.10.0)
|
105
100
|
simplecov-html (0.10.2)
|
106
|
-
thor (
|
107
|
-
|
108
|
-
|
109
|
-
virtus (1.0.5)
|
110
|
-
axiom-types (~> 0.1)
|
111
|
-
coercible (~> 1.0)
|
112
|
-
descendants_tracker (~> 0.0, >= 0.0.3)
|
113
|
-
equalizer (~> 0.0, >= 0.0.9)
|
114
|
-
webmock (3.8.3)
|
101
|
+
thor (1.1.0)
|
102
|
+
unicode-display_width (2.0.0)
|
103
|
+
webmock (3.12.2)
|
115
104
|
addressable (>= 2.3.6)
|
116
105
|
crack (>= 0.3.2)
|
117
106
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -121,21 +110,21 @@ PLATFORMS
|
|
121
110
|
|
122
111
|
DEPENDENCIES
|
123
112
|
bundler (~> 1.16)
|
124
|
-
bundler-audit (~> 0.
|
125
|
-
|
126
|
-
|
113
|
+
bundler-audit (~> 0.8.0)
|
114
|
+
faker (~> 2.17)
|
115
|
+
fasterer (~> 0.9.0)
|
127
116
|
json_matchers (~> 0.11.1)
|
128
|
-
overcommit (~> 0.
|
129
|
-
pry-byebug (~> 3.
|
130
|
-
rake (~> 13.0, >= 13.0.
|
131
|
-
reek (~>
|
132
|
-
rspec (~> 3.
|
133
|
-
rubocop (~>
|
134
|
-
rubocop-performance (~> 1.
|
135
|
-
rubocop-rspec (~>
|
117
|
+
overcommit (~> 0.57.0)
|
118
|
+
pry-byebug (~> 3.9)
|
119
|
+
rake (~> 13.0, >= 13.0.3)
|
120
|
+
reek (~> 6.0, >= 6.0.4)
|
121
|
+
rspec (~> 3.10)
|
122
|
+
rubocop (~> 1.14)
|
123
|
+
rubocop-performance (~> 1.11, >= 1.11.3)
|
124
|
+
rubocop-rspec (~> 2.3)
|
136
125
|
simplecov (~> 0.17.1)
|
137
126
|
truemail-client!
|
138
|
-
webmock (~> 3.
|
127
|
+
webmock (~> 3.12, >= 3.12.2)
|
139
128
|
|
140
129
|
BUNDLED WITH
|
141
130
|
1.16.6
|
data/README.md
CHANGED
@@ -1,16 +1,26 @@
|
|
1
|
-
#
|
1
|
+
# 
|
2
2
|
|
3
|
+
[](https://codeclimate.com/github/truemail-rb/truemail-ruby-client/maintainability)
|
4
|
+
[](https://codeclimate.com/github/truemail-rb/truemail-ruby-client/test_coverage)
|
5
|
+
[](https://circleci.com/gh/truemail-rb/truemail-ruby-client/tree/develop)
|
6
|
+
[](https://badge.fury.io/rb/truemail-client)
|
7
|
+
[](https://rubygems.org/gems/truemail-client)
|
8
|
+
[](https://gitter.im/truemail-rb/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
9
|
+
[](LICENSE.txt)
|
10
|
+
[](CODE_OF_CONDUCT.md)
|
3
11
|
|
4
|
-
|
12
|
+
`truemail-client` gem - [Truemail web API](https://github.com/truemail-rb/truemail-rack) client library for Ruby.
|
5
13
|
|
6
|
-
|
14
|
+
> Actual and maintainable documentation :books: for developers is living [here](https://truemail-rb.org/truemail-ruby-client).
|
7
15
|
|
8
16
|
## Table of Contents
|
9
17
|
|
18
|
+
- [Requirements](#requirements)
|
10
19
|
- [Installation](#installation)
|
11
20
|
- [Usage](#usage)
|
12
21
|
- [Setting global configuration](#setting-global-configuration)
|
13
22
|
- [Establishing connection with Truemail API](#establishing-connection-with-truemail-api)
|
23
|
+
- [Checking server health status](#checking-server-health-status)
|
14
24
|
- [Additional features](#additional-features)
|
15
25
|
- [Truemail family](#truemail-family)
|
16
26
|
- [Contributing](#contributing)
|
@@ -19,6 +29,10 @@
|
|
19
29
|
- [Versioning](#versioning)
|
20
30
|
- [Changelog](CHANGELOG.md)
|
21
31
|
|
32
|
+
## Requirements
|
33
|
+
|
34
|
+
Ruby MRI 2.5.0+
|
35
|
+
|
22
36
|
## Installation
|
23
37
|
|
24
38
|
Add this line to your application's Gemfile:
|
@@ -39,7 +53,6 @@ Or install it yourself as:
|
|
39
53
|
|
40
54
|
To have an access for `Truemail::Client` you must configure it first as in the example below:
|
41
55
|
|
42
|
-
|
43
56
|
### Setting global configuration
|
44
57
|
|
45
58
|
```ruby
|
@@ -66,9 +79,9 @@ After successful configuration, you can establish connection with Truemail serve
|
|
66
79
|
|
67
80
|
```ruby
|
68
81
|
Truemail::Client.validate('admin@bestweb.com.ua')
|
82
|
+
```
|
69
83
|
|
70
|
-
|
71
|
-
|
84
|
+
```json
|
72
85
|
{
|
73
86
|
"date": "2020-02-26 17:00:56 +0200",
|
74
87
|
"email": "admin@bestweb.com.ua",
|
@@ -83,7 +96,8 @@ Truemail::Client.validate('admin@bestweb.com.ua')
|
|
83
96
|
"blacklisted_domains": null,
|
84
97
|
"smtp_safe_check": false,
|
85
98
|
"email_pattern": "default gem value",
|
86
|
-
"smtp_error_body_pattern": "default gem value"
|
99
|
+
"smtp_error_body_pattern": "default gem value",
|
100
|
+
"not_rfc_mx_lookup_flow": false
|
87
101
|
}
|
88
102
|
}
|
89
103
|
```
|
@@ -96,6 +110,16 @@ Truemail::Client.validate('admin@bestweb.com.ua')
|
|
96
110
|
}
|
97
111
|
```
|
98
112
|
|
113
|
+
### Checking server health status
|
114
|
+
|
115
|
+
After successful configuration, you can check health-status of Truemail server.
|
116
|
+
|
117
|
+
```ruby
|
118
|
+
Truemail::Client.server_healthy?
|
119
|
+
|
120
|
+
=> true
|
121
|
+
```
|
122
|
+
|
99
123
|
### Additional features
|
100
124
|
|
101
125
|
#### Read global configuration
|
@@ -104,7 +128,6 @@ After successful configuration, you can read current `Truemail::Client` configur
|
|
104
128
|
|
105
129
|
```ruby
|
106
130
|
Truemail::Client.configuration
|
107
|
-
|
108
131
|
=> #<Truemail::Client::Configuration:0x000055eafc588878
|
109
132
|
@host="example.com",
|
110
133
|
@port=80,
|
@@ -119,7 +142,6 @@ Truemail::Client.configuration.port = 8080
|
|
119
142
|
=> 8080
|
120
143
|
|
121
144
|
Truemail::Client.configuration
|
122
|
-
|
123
145
|
=> #<Truemail::Client::Configuration:0x000055eafc588878
|
124
146
|
@host="example.com",
|
125
147
|
@port=8080,
|
@@ -142,23 +164,16 @@ Truemail::Client.configuration
|
|
142
164
|
|
143
165
|
## Truemail family
|
144
166
|
|
145
|
-
All Truemail
|
146
|
-
|
147
|
-
### truemail
|
148
|
-
|
149
|
-
gem `truemail` - Configurable plain Ruby email validator, https://github.com/rubygarage/truemail
|
150
|
-
|
151
|
-
### truemail server
|
152
|
-
|
153
|
-
Lightweight rack based web API wrapper for Truemail, https://github.com/truemail-rb/truemail-rack
|
154
|
-
|
155
|
-
### truemail-rack-docker-image
|
156
|
-
|
157
|
-
Lightweight rack based web API [dockerized image](https://hub.docker.com/r/truemail/truemail-rack) :whale: of Truemail server, https://github.com/truemail-rb/truemail-rack-docker-image
|
158
|
-
|
159
|
-
### truemail-rspec
|
167
|
+
All Truemail solutions: https://truemail-rb.org
|
160
168
|
|
161
|
-
|
169
|
+
| Name | Type | Description |
|
170
|
+
| --- | --- | --- |
|
171
|
+
| [truemail](https://github.com/truemail-rb/truemail) | ruby gem | Configurable framework agnostic plain Ruby email validator, main core |
|
172
|
+
| [truemail server](https://github.com/truemail-rb/truemail-rack) | ruby app | Lightweight rack based web API wrapper for Truemail |
|
173
|
+
| [truemail-rack-docker](https://github.com/truemail-rb/truemail-rack-docker-image) | docker image | Lightweight rack based web API [dockerized image](https://hub.docker.com/r/truemail/truemail-rack) :whale: of Truemail server |
|
174
|
+
| [truemail-crystal-client](https://github.com/truemail-rb/truemail-crystal-client) | crystal shard | Truemail web API client library for Crystal |
|
175
|
+
| [truemail-java-client](https://github.com/truemail-rb/truemail-java-client) | java lib | Truemail web API client library for Java |
|
176
|
+
| [truemail-rspec](https://github.com/truemail-rb/truemail-rspec) | ruby gem | Truemail configuration and validator RSpec helpers |
|
162
177
|
|
163
178
|
## Contributing
|
164
179
|
|
data/lib/truemail/client.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
require_relative '../truemail/client/version'
|
4
|
+
require_relative '../truemail/client/configuration'
|
5
|
+
require_relative '../truemail/client/http'
|
6
6
|
|
7
7
|
module Truemail
|
8
8
|
module Client
|
@@ -12,7 +12,7 @@ module Truemail
|
|
12
12
|
class << self
|
13
13
|
def configuration(&block)
|
14
14
|
@configuration ||= begin
|
15
|
-
return unless
|
15
|
+
return unless block
|
16
16
|
configuration = Truemail::Client::Configuration.new(&block)
|
17
17
|
raise_unless(configuration.complete?, Truemail::Client::INCOMPLETE_CONFIG)
|
18
18
|
configuration
|
@@ -29,7 +29,12 @@ module Truemail
|
|
29
29
|
|
30
30
|
def validate(email)
|
31
31
|
raise_unless(Truemail::Client.configuration, Truemail::Client::NOT_CONFIGURED)
|
32
|
-
Truemail::Client::Http.new(email).run
|
32
|
+
Truemail::Client::Http.new(email: email).run
|
33
|
+
end
|
34
|
+
|
35
|
+
def server_healthy?
|
36
|
+
raise_unless(Truemail::Client.configuration, Truemail::Client::NOT_CONFIGURED)
|
37
|
+
Truemail::Client::Http.new(Truemail::Client::Http::HEALTHCHECK_ENDPOINT).run.empty?
|
33
38
|
end
|
34
39
|
|
35
40
|
private
|