quovo 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/quovo/errors.rb +1 -0
- data/lib/quovo/request.rb +10 -10
- data/lib/quovo/version.rb +1 -1
- data/quovo.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2b6eac7fb141cc4c7dc62499f707640d17e4320
|
4
|
+
data.tar.gz: c7107b3bb7f5f892c1f4c8e75965a4d4a5c27e83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8b1ce1b75ad54337024a86c272853296b6d465f2a84667b6b370529a21090a20a7f4e5e95a6298e9ed0988e072be88207e4b727f780a112f3a7186dfa8fc7c7
|
7
|
+
data.tar.gz: 3c222fa0a62b9b51399ee562b43cbb323ed0a1887d697e8cb1c4500753571c9a5141e73705e1dbb932edeaf894ef3d1a74d51f0f9c450e76aaca8aa626ffa8e1
|
data/lib/quovo/errors.rb
CHANGED
data/lib/quovo/request.rb
CHANGED
@@ -9,12 +9,12 @@ module Quovo
|
|
9
9
|
|
10
10
|
yield(request) if block_given?
|
11
11
|
|
12
|
-
do_http_request(request, config.request_timeout, format) do |
|
12
|
+
do_http_request(request, config.request_timeout, format) do |status_code, payload, elapsed|
|
13
13
|
Quovo.run_hooks!(
|
14
14
|
path,
|
15
15
|
method.to_s.upcase,
|
16
16
|
strip_sensitive(params, config),
|
17
|
-
|
17
|
+
status_code,
|
18
18
|
strip_sensitive(payload, config),
|
19
19
|
elapsed
|
20
20
|
)
|
@@ -55,8 +55,8 @@ module Quovo
|
|
55
55
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
56
56
|
|
57
57
|
http.start do |transport|
|
58
|
-
(
|
59
|
-
yield(
|
58
|
+
(status_code, payload), elapsed = with_timing { parse_response(transport.request(request), format) }
|
59
|
+
yield(status_code, payload, elapsed)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -70,13 +70,13 @@ module Quovo
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def parse_response(response, format)
|
73
|
-
|
74
|
-
body
|
73
|
+
status_code = response.code
|
74
|
+
body = response.body
|
75
|
+
raise Quovo::NotFoundError, body if status_code =~ /404/
|
76
|
+
raise Quovo::ForbiddenError, body if status_code =~ /403/
|
77
|
+
raise Quovo::HttpError, body if status_code =~ /^[45]/
|
75
78
|
payload = format == :json ? JSON.parse(body) : body
|
76
|
-
|
77
|
-
raise Quovo::ForbiddenError, body if code =~ /403/
|
78
|
-
raise Quovo::HttpError, body if code =~ /^[45]/
|
79
|
-
[code, payload]
|
79
|
+
[status_code, payload]
|
80
80
|
end
|
81
81
|
|
82
82
|
def with_timing
|
data/lib/quovo/version.rb
CHANGED
data/quovo.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.require_paths = ['lib']
|
18
18
|
|
19
19
|
spec.required_ruby_version = '>= 2.0'
|
20
|
-
spec.files
|
20
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
21
21
|
f.match(%r{^(tests|bin|)/}) || f[0] == '.'
|
22
22
|
end
|
23
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quovo
|
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
|
- Alex Gorkunov
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-07-04 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Quovo RESTful API client, configurable, thread-safe and well-tested
|
15
15
|
email:
|