truemail-client 0.4.0 → 0.5.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/.ruby-version +1 -1
- data/lib/truemail/client/version.rb +1 -1
- metadata +16 -164
- data/.circleci/config.yml +0 -131
- data/.circleci/gemspec_compatible +0 -41
- data/.codeclimate.yml +0 -13
- data/.github/BRANCH_NAMING_CONVENTION.md +0 -36
- data/.github/ISSUE_TEMPLATE/bug_report.md +0 -28
- data/.github/ISSUE_TEMPLATE/feature_request.md +0 -27
- data/.github/ISSUE_TEMPLATE/issue_report.md +0 -28
- data/.github/ISSUE_TEMPLATE/question.md +0 -22
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -49
- data/.gitignore +0 -11
- data/.overcommit.yml +0 -32
- data/.reek.yml +0 -21
- data/.rspec +0 -2
- data/.rubocop.yml +0 -407
- data/.ruby-gemset +0 -1
- data/CHANGELOG.md +0 -103
- data/CODE_OF_CONDUCT.md +0 -74
- data/CONTRIBUTING.md +0 -46
- data/Gemfile +0 -5
- data/README.md +0 -194
- data/Rakefile +0 -8
- data/truemail-client.gemspec +0 -48
data/README.md
DELETED
@@ -1,194 +0,0 @@
|
|
1
|
-
# 
|
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/master)
|
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)
|
11
|
-
|
12
|
-
`truemail-client` gem - [Truemail web API](https://github.com/truemail-rb/truemail-rack) client library for Ruby.
|
13
|
-
|
14
|
-
> Actual and maintainable documentation :books: for developers is living [here](https://truemail-rb.org/truemail-ruby-client).
|
15
|
-
|
16
|
-
## Table of Contents
|
17
|
-
|
18
|
-
- [Requirements](#requirements)
|
19
|
-
- [Installation](#installation)
|
20
|
-
- [Usage](#usage)
|
21
|
-
- [Setting global configuration](#setting-global-configuration)
|
22
|
-
- [Establishing connection with Truemail API](#establishing-connection-with-truemail-api)
|
23
|
-
- [Checking server health status](#checking-server-health-status)
|
24
|
-
- [Additional features](#additional-features)
|
25
|
-
- [Truemail family](#truemail-family)
|
26
|
-
- [Contributing](#contributing)
|
27
|
-
- [License](#license)
|
28
|
-
- [Code of Conduct](#code-of-conduct)
|
29
|
-
- [Versioning](#versioning)
|
30
|
-
- [Changelog](CHANGELOG.md)
|
31
|
-
|
32
|
-
## Requirements
|
33
|
-
|
34
|
-
Ruby MRI 2.5.0+
|
35
|
-
|
36
|
-
## Installation
|
37
|
-
|
38
|
-
Add this line to your application's Gemfile:
|
39
|
-
|
40
|
-
```ruby
|
41
|
-
gem 'truemail-client'
|
42
|
-
```
|
43
|
-
|
44
|
-
And then execute:
|
45
|
-
|
46
|
-
$ bundle
|
47
|
-
|
48
|
-
Or install it yourself as:
|
49
|
-
|
50
|
-
$ gem install truemail-client
|
51
|
-
|
52
|
-
## Usage
|
53
|
-
|
54
|
-
To have an access for `Truemail::Client` you must configure it first as in the example below:
|
55
|
-
|
56
|
-
### Setting global configuration
|
57
|
-
|
58
|
-
```ruby
|
59
|
-
require 'truemail/client'
|
60
|
-
|
61
|
-
Truemail::Client.configure do |config|
|
62
|
-
# Required parameter (String). It should be a hostname or an ip address where Truemail server runs
|
63
|
-
config.host = 'example.com'
|
64
|
-
|
65
|
-
# Required parameter (String). It should be valid Truemail server access token
|
66
|
-
config.token = 'token'
|
67
|
-
|
68
|
-
# Optional parameter (Boolean). By default it is equal false
|
69
|
-
config.secure_connection = true
|
70
|
-
|
71
|
-
# Optional parameter (Integer). By default it is equal 9292
|
72
|
-
config.port = 80
|
73
|
-
end
|
74
|
-
```
|
75
|
-
|
76
|
-
### Establishing connection with Truemail API
|
77
|
-
|
78
|
-
After successful configuration, you can establish connection with Truemail server.
|
79
|
-
|
80
|
-
```ruby
|
81
|
-
Truemail::Client.validate('admin@bestweb.com.ua')
|
82
|
-
```
|
83
|
-
|
84
|
-
```json
|
85
|
-
{
|
86
|
-
"date": "2020-02-26 17:00:56 +0200",
|
87
|
-
"email": "admin@bestweb.com.ua",
|
88
|
-
"validation_type": "smtp",
|
89
|
-
"success": true,
|
90
|
-
"errors": null,
|
91
|
-
"smtp_debug": null,
|
92
|
-
"configuration": {
|
93
|
-
"validation_type_by_domain": null,
|
94
|
-
"whitelist_validation": false,
|
95
|
-
"whitelisted_domains": null,
|
96
|
-
"blacklisted_domains": null,
|
97
|
-
"blacklisted_mx_ip_addresses": null,
|
98
|
-
"dns": null,
|
99
|
-
"smtp_safe_check": false,
|
100
|
-
"email_pattern": "default gem value",
|
101
|
-
"smtp_error_body_pattern": "default gem value",
|
102
|
-
"not_rfc_mx_lookup_flow": false
|
103
|
-
}
|
104
|
-
}
|
105
|
-
```
|
106
|
-
|
107
|
-
`Truemail::Client.validate` always returns JSON data. If something goes wrong you will receive JSON with error details:
|
108
|
-
|
109
|
-
```json
|
110
|
-
{
|
111
|
-
"truemail_client_error": "error details"
|
112
|
-
}
|
113
|
-
```
|
114
|
-
|
115
|
-
### Checking server health status
|
116
|
-
|
117
|
-
After successful configuration, you can check health-status of Truemail server.
|
118
|
-
|
119
|
-
```ruby
|
120
|
-
Truemail::Client.server_healthy?
|
121
|
-
|
122
|
-
=> true
|
123
|
-
```
|
124
|
-
|
125
|
-
### Additional features
|
126
|
-
|
127
|
-
#### Read global configuration
|
128
|
-
|
129
|
-
After successful configuration, you can read current `Truemail::Client` configuration instance anywhere in your application.
|
130
|
-
|
131
|
-
```ruby
|
132
|
-
Truemail::Client.configuration
|
133
|
-
=> #<Truemail::Client::Configuration:0x000055eafc588878
|
134
|
-
@host="example.com",
|
135
|
-
@port=80,
|
136
|
-
@secure_connection=true,
|
137
|
-
@token="token">
|
138
|
-
```
|
139
|
-
|
140
|
-
#### Update global configuration
|
141
|
-
|
142
|
-
```ruby
|
143
|
-
Truemail::Client.configuration.port = 8080
|
144
|
-
=> 8080
|
145
|
-
|
146
|
-
Truemail::Client.configuration
|
147
|
-
=> #<Truemail::Client::Configuration:0x000055eafc588878
|
148
|
-
@host="example.com",
|
149
|
-
@port=8080,
|
150
|
-
@secure_connection=true,
|
151
|
-
@token="token">
|
152
|
-
```
|
153
|
-
|
154
|
-
#### Reset global configuration
|
155
|
-
|
156
|
-
Also you can reset Truemail::Client configuration.
|
157
|
-
|
158
|
-
```ruby
|
159
|
-
Truemail::Client.reset_configuration!
|
160
|
-
=> nil
|
161
|
-
Truemail::Client.configuration
|
162
|
-
=> nil
|
163
|
-
```
|
164
|
-
|
165
|
-
---
|
166
|
-
|
167
|
-
## Truemail family
|
168
|
-
|
169
|
-
All Truemail solutions: https://truemail-rb.org
|
170
|
-
|
171
|
-
| Name | Type | Description |
|
172
|
-
| --- | --- | --- |
|
173
|
-
| [truemail](https://github.com/truemail-rb/truemail) | ruby gem | Configurable framework agnostic plain Ruby email validator, main core |
|
174
|
-
| [truemail server](https://github.com/truemail-rb/truemail-rack) | ruby app | Lightweight rack based web API wrapper for Truemail |
|
175
|
-
| [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 |
|
176
|
-
| [truemail-crystal-client](https://github.com/truemail-rb/truemail-crystal-client) | crystal shard | Truemail web API client library for Crystal |
|
177
|
-
| [truemail-java-client](https://github.com/truemail-rb/truemail-java-client) | java lib | Truemail web API client library for Java |
|
178
|
-
| [truemail-rspec](https://github.com/truemail-rb/truemail-rspec) | ruby gem | Truemail configuration and validator RSpec helpers |
|
179
|
-
|
180
|
-
## Contributing
|
181
|
-
|
182
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/truemail-rb/truemail-ruby-client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. Please check the [open tickets](https://github.com/truemail-rb/truemail-ruby-client/issues). Be sure to follow Contributor Code of Conduct below and our [Contributing Guidelines](CONTRIBUTING.md).
|
183
|
-
|
184
|
-
## License
|
185
|
-
|
186
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
187
|
-
|
188
|
-
## Code of Conduct
|
189
|
-
|
190
|
-
Everyone interacting in the `truemail-ruby-client` project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md).
|
191
|
-
|
192
|
-
## Versioning
|
193
|
-
|
194
|
-
`truemail-ruby-client` uses [Semantic Versioning 2.0.0](https://semver.org)
|
data/Rakefile
DELETED
data/truemail-client.gemspec
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
lib = ::File.expand_path('lib', __dir__)
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require 'truemail/client/version'
|
6
|
-
|
7
|
-
Gem::Specification.new do |spec|
|
8
|
-
spec.name = 'truemail-client'
|
9
|
-
spec.version = Truemail::Client::VERSION
|
10
|
-
spec.authors = ['Vladislav Trotsenko']
|
11
|
-
spec.email = ['admin@bestweb.com.ua']
|
12
|
-
|
13
|
-
spec.summary = %(truemail-client)
|
14
|
-
spec.description = %(Truemail web API client library for Ruby)
|
15
|
-
|
16
|
-
spec.homepage = 'https://github.com/truemail-rb/truemail-ruby-client'
|
17
|
-
spec.license = 'MIT'
|
18
|
-
|
19
|
-
spec.metadata = {
|
20
|
-
'homepage_uri' => 'https://truemail-rb.org',
|
21
|
-
'changelog_uri' => 'https://github.com/truemail-rb/truemail-ruby-client/blob/master/CHANGELOG.md',
|
22
|
-
'source_code_uri' => 'https://github.com/truemail-rb/truemail-ruby-client',
|
23
|
-
'documentation_uri' => 'https://truemail-rb.org/truemail-ruby-client',
|
24
|
-
'bug_tracker_uri' => 'https://github.com/truemail-rb/truemail-ruby-client/issues'
|
25
|
-
}
|
26
|
-
|
27
|
-
spec.required_ruby_version = '>= 2.5.0'
|
28
|
-
|
29
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
30
|
-
spec.bindir = 'exe'
|
31
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| ::File.basename(f) }
|
32
|
-
spec.require_paths = ['lib']
|
33
|
-
|
34
|
-
spec.add_development_dependency 'bundler-audit', '~> 0.9.0.1'
|
35
|
-
spec.add_development_dependency 'fasterer', '~> 0.9.0'
|
36
|
-
spec.add_development_dependency 'ffaker', '~> 2.20'
|
37
|
-
spec.add_development_dependency 'json_matchers', '~> 0.11.1'
|
38
|
-
spec.add_development_dependency 'overcommit', '~> 0.58.0'
|
39
|
-
spec.add_development_dependency 'pry-byebug', '~> 3.9'
|
40
|
-
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
|
41
|
-
spec.add_development_dependency 'reek', '~> 6.1'
|
42
|
-
spec.add_development_dependency 'rspec', '~> 3.10'
|
43
|
-
spec.add_development_dependency 'rubocop', '~> 1.25'
|
44
|
-
spec.add_development_dependency 'rubocop-performance', '~> 1.13', '>= 1.13.2'
|
45
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 2.8'
|
46
|
-
spec.add_development_dependency 'simplecov', '~> 0.17.1'
|
47
|
-
spec.add_development_dependency 'webmock', '~> 3.14'
|
48
|
-
end
|