client-api 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/client-api/request.rb +5 -0
- data/lib/client-api/validator.rb +4 -4
- data/lib/client-api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eebdc4ad8824071aab56f642ba4fe5131f461eeb3de119b63393395046ac2f1c
|
4
|
+
data.tar.gz: e036d606575cfd73b6c7cb6db993a95d78ef8a681eec3d0deb3eb73de5756f0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a75e87c8963ce9f2d1eaba9a13f436f9c7e275085b902ef350b6dc0ccca448987c18cc6348a07da7a7e9c13efaacfb7238001313a9c78ad1bf9ce3cfc28d2b8
|
7
|
+
data.tar.gz: ab2c68003e8c1cec1a19e4c463b651ff85aeba7b3d3cd245083c156cba742dd6f4f6c593409dd0d392868bcf61c2bf2bf3aba5b5b313c6f18fbdd64f8edbb573
|
data/lib/client-api/request.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "net/http"
|
2
|
+
require 'openssl'
|
2
3
|
|
3
4
|
module ClientApi
|
4
5
|
|
@@ -51,6 +52,10 @@ module ClientApi
|
|
51
52
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
52
53
|
http.read_timeout = time_out.to_i
|
53
54
|
@http = http
|
55
|
+
elsif uri(args).scheme == "http"
|
56
|
+
http.use_ssl = false
|
57
|
+
http.read_timeout = time_out.to_i
|
58
|
+
@http = http
|
54
59
|
end
|
55
60
|
end
|
56
61
|
|
data/lib/client-api/validator.rb
CHANGED
@@ -26,9 +26,9 @@ module ClientApi
|
|
26
26
|
|
27
27
|
# datatype validation
|
28
28
|
if (type == "boolean" || type == "bool") && value.nil?
|
29
|
-
expect(%w[TrueClass, FalseClass].any? {|bool| @resp.class.to_s.include? bool}).to eq(true), lambda {"[key]: \"#{data[:key]}\"".blue + "\n
|
29
|
+
expect(%w[TrueClass, FalseClass].any? {|bool| @resp.class.to_s.include? bool}).to eq(true), lambda {"[key]: \"#{data[:key]}\"".blue + "\n datatype shouldn't be \n[type]: \"#{data[:type]}\"\n"}
|
30
30
|
else
|
31
|
-
expect(datatype(type, value)).to eq(@resp.class), lambda {"[key]: \"#{data[:key]}\"".blue + "\n
|
31
|
+
expect(datatype(type, value)).to eq(@resp.class), lambda {"[key]: \"#{data[:key]}\"".blue + "\n datatype shouldn't be \n[type]: \"#{data[:type]}\"\n"}
|
32
32
|
end
|
33
33
|
|
34
34
|
when '!', '!=', '!eql?', 'not equal', '!equal?'
|
@@ -37,9 +37,9 @@ module ClientApi
|
|
37
37
|
|
38
38
|
# datatype validation
|
39
39
|
if (type == "boolean" || type == "bool") && value.nil?
|
40
|
-
expect(%w[TrueClass, FalseClass].any? {|bool| @resp.class.to_s.include? bool}).not_to eq(true), lambda {"[key]: \"#{data[:key]}\"".blue + "\n
|
40
|
+
expect(%w[TrueClass, FalseClass].any? {|bool| @resp.class.to_s.include? bool}).not_to eq(true), lambda {"[key]: \"#{data[:key]}\"".blue + "\n datatype shouldn't be \n[type]: \"#{data[:type]}\"\n"}
|
41
41
|
else
|
42
|
-
expect(datatype(type, value)).not_to eq(@resp.class), lambda {"[key]: \"#{data[:key]}\"".blue + "\n
|
42
|
+
expect(datatype(type, value)).not_to eq(@resp.class), lambda {"[key]: \"#{data[:key]}\"".blue + "\n datatype shouldn't be \n[type]: \"#{data[:type]}\"\n"}
|
43
43
|
end
|
44
44
|
else
|
45
45
|
raise_error('operator not matching')
|
data/lib/client-api/version.rb
CHANGED