truemail 1.9.1 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE.md +1 -1
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +1 -1
- data/lib/truemail.rb +9 -2
- data/lib/truemail/core.rb +1 -0
- data/lib/truemail/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: caf982d3dd889a337ae95ab4d4fa79157964e02d83656016ecead8d0831c4d46
|
4
|
+
data.tar.gz: 9b7ec050811c49072d18f7cd9e36229b982af742f24db3a031d4ab1e2e08f780
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8991eb0d33e2aaff25fdbe9fc95b45e8ee6e0c2661b9c82e622eca182f22570b01f27848b60353bf1ce70419c94cbe23cd51871872e0f92f624676d8a0c317c
|
7
|
+
data.tar.gz: 7b8e1b24a90019bf21cb1534f64962ba8b68fe8fd6734a564d57c69fbf483c8e35a14bfd35317c58023f6f54616cad591439ac6eddef878604522d929dd6e42a
|
data/.github/ISSUE_TEMPLATE.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
- [ ] I have updated truemail to the latest version
|
6
6
|
- [ ] I have read the [Contribution Guidelines](https://github.com/rubygarage/truemail/blob/master/CONTRIBUTING.md)
|
7
|
-
- [ ] I have read the [documentation](https://
|
7
|
+
- [ ] I have read the [documentation](https://truemail-rb.org/truemail-gem)
|
8
8
|
- [ ] I have searched for [existing GitHub issues](https://github.com/rubygarage/truemail/issues)
|
9
9
|
|
10
10
|
### Issue Description
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,18 @@
|
|
2
2
|
|
3
3
|
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).
|
4
4
|
|
5
|
+
## [1.9.2] - 2020.10.02
|
6
|
+
|
7
|
+
### Added
|
8
|
+
|
9
|
+
- `Truemail::TypeError`
|
10
|
+
- error handling for invalid types as input email
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
|
14
|
+
- Updated `Truemail.validate`
|
15
|
+
- Updated `Truemail.valid?`
|
16
|
+
|
5
17
|
## [1.9.1] - 2020.09.21
|
6
18
|
|
7
19
|
### Changed
|
data/Gemfile.lock
CHANGED
data/lib/truemail.rb
CHANGED
@@ -5,6 +5,7 @@ require_relative 'truemail/core'
|
|
5
5
|
module Truemail
|
6
6
|
INCOMPLETE_CONFIG = 'verifier_email is required parameter'
|
7
7
|
NOT_CONFIGURED = 'use Truemail.configure before or pass custom configuration'
|
8
|
+
INVALID_TYPE = 'email should be a String'
|
8
9
|
|
9
10
|
class << self
|
10
11
|
def configuration(&block)
|
@@ -25,10 +26,12 @@ module Truemail
|
|
25
26
|
end
|
26
27
|
|
27
28
|
def validate(email, custom_configuration: nil, **options)
|
29
|
+
check_argument_type(email)
|
28
30
|
Truemail::Validator.new(email, configuration: determine_configuration(custom_configuration), **options).run
|
29
31
|
end
|
30
32
|
|
31
33
|
def valid?(email, **options)
|
34
|
+
check_argument_type(email)
|
32
35
|
validate(email, **options).result.valid?
|
33
36
|
end
|
34
37
|
|
@@ -38,8 +41,12 @@ module Truemail
|
|
38
41
|
|
39
42
|
private
|
40
43
|
|
41
|
-
def raise_unless(condition, message)
|
42
|
-
raise
|
44
|
+
def raise_unless(condition, message, error_class = Truemail::ConfigurationError)
|
45
|
+
raise error_class, message unless condition
|
46
|
+
end
|
47
|
+
|
48
|
+
def check_argument_type(argument)
|
49
|
+
raise_unless(argument.is_a?(String), Truemail::INVALID_TYPE, Truemail::TypeError)
|
43
50
|
end
|
44
51
|
|
45
52
|
def determine_configuration(custom_configuration)
|
data/lib/truemail/core.rb
CHANGED
data/lib/truemail/version.rb
CHANGED
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.9.
|
4
|
+
version: 1.9.2
|
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-
|
11
|
+
date: 2020-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simpleidn
|