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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92cf939c6c87c4e69bcbe24db9d93ec2882c51a6
4
- data.tar.gz: 549f159fdf57f395d7f835c400621aa8094e4fa2
3
+ metadata.gz: b2b6eac7fb141cc4c7dc62499f707640d17e4320
4
+ data.tar.gz: c7107b3bb7f5f892c1f4c8e75965a4d4a5c27e83
5
5
  SHA512:
6
- metadata.gz: 60286e9470ed3da27f17549912055dd9cc918f8d49689cc2baa08b48b9fe0bcb3a486cc44581c0276b254897bfc6ad502f83a1fa88bafb787b2a9a4592c2be89
7
- data.tar.gz: dda8e258f5d431d4e92beed827ce9308efa50e93cd2ee6342aec608273280e7c33fafc5e0ed5deba294f6e46412966f12ec199758cca2d181917ef92ad527ecc
6
+ metadata.gz: f8b1ce1b75ad54337024a86c272853296b6d465f2a84667b6b370529a21090a20a7f4e5e95a6298e9ed0988e072be88207e4b727f780a112f3a7186dfa8fc7c7
7
+ data.tar.gz: 3c222fa0a62b9b51399ee562b43cbb323ed0a1887d697e8cb1c4500753571c9a5141e73705e1dbb932edeaf894ef3d1a74d51f0f9c450e76aaca8aa626ffa8e1
data/lib/quovo/errors.rb CHANGED
@@ -4,4 +4,5 @@ module Quovo
4
4
  HttpError = Class.new(QuovoError)
5
5
  ForbiddenError = Class.new(HttpError)
6
6
  NotFoundError = Class.new(HttpError)
7
+ StubNotFoundError = Class.new(StandardError)
7
8
  end
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 |code, payload, elapsed|
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
- code,
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
- (code, payload), elapsed = with_timing { parse_response(transport.request(request), format) }
59
- yield(code, payload, elapsed)
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
- code = response.code
74
- body = response.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
- raise Quovo::NotFoundError, body if code =~ /404/
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
@@ -1,3 +1,3 @@
1
1
  module Quovo
2
- VERSION = '1.0.1'.freeze
2
+ VERSION = '1.0.2'.freeze
3
3
  end
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 = `git ls-files -z`.split("\x0").reject do |f|
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.1
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-06-17 00:00:00.000000000 Z
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: