truemail-client 0.4.1 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md DELETED
@@ -1,195 +0,0 @@
1
- # ![Truemail web API client library for Ruby](https://truemail-rb.org/assets/images/truemail_logo.png)
2
-
3
- [![Maintainability](https://api.codeclimate.com/v1/badges/ccc7167f4f49d4a10146/maintainability)](https://codeclimate.com/github/truemail-rb/truemail-ruby-client/maintainability)
4
- [![Test Coverage](https://api.codeclimate.com/v1/badges/ccc7167f4f49d4a10146/test_coverage)](https://codeclimate.com/github/truemail-rb/truemail-ruby-client/test_coverage)
5
- [![CircleCI](https://circleci.com/gh/truemail-rb/truemail-ruby-client/tree/master.svg?style=svg)](https://circleci.com/gh/truemail-rb/truemail-ruby-client/tree/master)
6
- [![Gem Version](https://badge.fury.io/rb/truemail-client.svg)](https://badge.fury.io/rb/truemail-client)
7
- [![Downloads](https://img.shields.io/gem/dt/truemail-client.svg?colorA=004d99&colorB=0073e6)](https://rubygems.org/gems/truemail-client)
8
- [![Gitter](https://badges.gitter.im/truemail-rb/community.svg)](https://gitter.im/truemail-rb/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
9
- [![GitHub](https://img.shields.io/github/license/truemail-rb/truemail-ruby-client)](LICENSE.txt)
10
- [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](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-go](https://github.com/truemail-rb/truemail-go) | go package | Configurable Golang email validator, main core |
175
- | [truemail server](https://github.com/truemail-rb/truemail-rack) | ruby app | Lightweight rack based web API wrapper for Truemail |
176
- | [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 |
177
- | [truemail-crystal-client](https://github.com/truemail-rb/truemail-crystal-client) | crystal shard | Truemail web API client library for Crystal |
178
- | [truemail-java-client](https://github.com/truemail-rb/truemail-java-client) | java lib | Truemail web API client library for Java |
179
- | [truemail-rspec](https://github.com/truemail-rb/truemail-rspec) | ruby gem | Truemail configuration and validator RSpec helpers |
180
-
181
- ## Contributing
182
-
183
- 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).
184
-
185
- ## License
186
-
187
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
188
-
189
- ## Code of Conduct
190
-
191
- 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).
192
-
193
- ## Versioning
194
-
195
- `truemail-ruby-client` uses [Semantic Versioning 2.0.0](https://semver.org)
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- task default: :spec
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'lib/truemail/client/version'
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'truemail-client'
7
- spec.version = Truemail::Client::VERSION
8
- spec.authors = ['Vladislav Trotsenko']
9
- spec.email = ['admin@bestweb.com.ua']
10
-
11
- spec.summary = %(truemail-client)
12
- spec.description = %(Truemail web API client library for Ruby)
13
-
14
- spec.homepage = 'https://github.com/truemail-rb/truemail-ruby-client'
15
- spec.license = 'MIT'
16
-
17
- spec.metadata = {
18
- 'homepage_uri' => 'https://truemail-rb.org',
19
- 'changelog_uri' => 'https://github.com/truemail-rb/truemail-ruby-client/blob/master/CHANGELOG.md',
20
- 'source_code_uri' => 'https://github.com/truemail-rb/truemail-ruby-client',
21
- 'documentation_uri' => 'https://truemail-rb.org/truemail-ruby-client',
22
- 'bug_tracker_uri' => 'https://github.com/truemail-rb/truemail-ruby-client/issues'
23
- }
24
-
25
- spec.required_ruby_version = '>= 2.5.0'
26
-
27
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
28
- spec.bindir = 'exe'
29
- spec.executables = spec.files.grep(%r{^exe/}) { |f| ::File.basename(f) }
30
- spec.require_paths = ['lib']
31
-
32
- spec.add_development_dependency 'ffaker', '~> 2.20'
33
- spec.add_development_dependency 'json_matchers', '~> 0.11.1'
34
- spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
35
- spec.add_development_dependency 'rspec', '~> 3.11'
36
- spec.add_development_dependency 'webmock', '~> 3.14'
37
- end