quickemailverification 1.0.1 → 1.0.2
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42e1ef168a79708ab9828720f8949801646a5d70f04dbdb78cb036f4784b7457
|
4
|
+
data.tar.gz: 2bd0b0a352049365676daf77088419ecbe714e5960149ceedc0625656405d935
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f52b7aaa94d0163c85f445ba73aa69fc72f5a8acbd504f6a030b6481d45ca3b41173e9a12b9c632a17cd32bd24edc082fc353f0535c2d003a85742b7093863b6
|
7
|
+
data.tar.gz: 0f0a7481a3279e8ff499f173bb8f3a8338087d1f35b5876146988d063496a8cfec926dcf0486ac933089a5d091339740ea7dc29e6a7cbea9e2aae01360a77d0a
|
@@ -22,6 +22,19 @@ module QuickEmailVerification
|
|
22
22
|
@client.get("/verify?email=#{email}", body, options)
|
23
23
|
end
|
24
24
|
|
25
|
+
# Return predefined response for predefined email address
|
26
|
+
#
|
27
|
+
# '/verify/sandbox?email=:email' GET
|
28
|
+
#
|
29
|
+
# email - send email address in query parameter
|
30
|
+
def sandbox(email, options = {})
|
31
|
+
body = options.fetch("query", {})
|
32
|
+
|
33
|
+
email = CGI::escape(email)
|
34
|
+
|
35
|
+
@client.get("/verify/sandbox?email=#{email}", body, options)
|
36
|
+
end
|
37
|
+
|
25
38
|
end
|
26
39
|
|
27
40
|
end
|
@@ -22,7 +22,7 @@ module QuickEmailVerification
|
|
22
22
|
@options = {
|
23
23
|
:base => "http://api.quickemailverification.com",
|
24
24
|
:api_version => "v1",
|
25
|
-
:user_agent => "quickemailverification-ruby/1.0.
|
25
|
+
:user_agent => "quickemailverification-ruby/1.0.2 (https://github.com/quickemailverification/quickemailverification-ruby)"
|
26
26
|
}
|
27
27
|
|
28
28
|
@options.update(options)
|
@@ -20,26 +20,28 @@ module QuickEmailVerification
|
|
20
20
|
when 400...499
|
21
21
|
body = QuickEmailVerification::HttpClient::ResponseHandler.get_body(env)
|
22
22
|
message = ""
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
23
|
+
arrErrCode = [400, 401, 402, 403, 404, 429]
|
24
|
+
if !arrErrCode.include?(code)
|
25
|
+
# If HTML, whole body is taken
|
26
|
+
if body.is_a?(String)
|
27
|
+
message = body
|
28
|
+
end
|
29
|
+
|
30
|
+
# If JSON, a particular field is taken and used
|
31
|
+
if type.include?("json") and body.is_a?(Hash)
|
32
|
+
if body.has_key?("message")
|
33
|
+
message = body["message"]
|
34
|
+
else
|
35
|
+
message = "Unable to select error message from json returned by request responsible for error"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
if message == ""
|
40
|
+
message = "Unable to understand the content type of response returned by request responsible for error"
|
41
|
+
end
|
42
|
+
|
43
|
+
raise QuickEmailVerification::Error::ClientError.new message, code
|
36
44
|
end
|
37
|
-
|
38
|
-
if message == ""
|
39
|
-
message = "Unable to understand the content type of response returned by request responsible for error"
|
40
|
-
end
|
41
|
-
|
42
|
-
raise QuickEmailVerification::Error::ClientError.new message, code
|
43
45
|
end
|
44
46
|
end
|
45
47
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quickemailverification
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- QuickEmailVerification
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|