orchestrate 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/orchestrate/api/errors.rb +1 -1
- data/lib/orchestrate/client.rb +7 -2
- data/lib/orchestrate/version.rb +1 -1
- data/test/orchestrate/client_test.rb +9 -0
- 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: 280e11fed61bfb3b020de4fbed4b67d4392fd8f7
|
4
|
+
data.tar.gz: b454f95ec082424d99e99882ca4c9707da555f55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e642894e20da91faa3aa746f217b6678273f9060e47aa4ad1664e3515208e8b96df6ebe4277d6b54c53995448ad7e74fc74dacae8760368821a1a42851275528
|
7
|
+
data.tar.gz: 03daed3e82a28e5c34de96568605dc313bb16338cf43369900eda1effee84ac000f380f6534c816341ad37353f734b2cd7418ef81f4ae0910618946145a703cd
|
data/README.md
CHANGED
@@ -104,6 +104,9 @@ end
|
|
104
104
|
|
105
105
|
## Release Notes
|
106
106
|
|
107
|
+
- June 24, 2014: release 0.6.3
|
108
|
+
- Fix #55 to handle ping responses when unauthorized
|
109
|
+
|
107
110
|
- June 24, 2014: release 0.6.2
|
108
111
|
- Fix #48 to remove trailing -gzip from Etag header for ref value.
|
109
112
|
- Custom #to_s and #inspect methods for Client, Response classes.
|
@@ -16,7 +16,7 @@ module Orchestrate::API
|
|
16
16
|
# @param response [Faraday::Response] The response that caused the error.
|
17
17
|
def initialize(response)
|
18
18
|
@response = response
|
19
|
-
if response.headers['Content-Type'] == 'application/json'
|
19
|
+
if response.headers['Content-Type'] == 'application/json' && response.body
|
20
20
|
super(response.body['message'])
|
21
21
|
else
|
22
22
|
super(response.body)
|
data/lib/orchestrate/client.rb
CHANGED
@@ -396,8 +396,13 @@ module Orchestrate
|
|
396
396
|
end
|
397
397
|
|
398
398
|
if ! response.success?
|
399
|
-
err_type =
|
400
|
-
|
399
|
+
err_type = if response.body
|
400
|
+
API::ERRORS.find do |err|
|
401
|
+
err.status == response.status && err.code == response.body['code']
|
402
|
+
end
|
403
|
+
else
|
404
|
+
errors = API::ERRORS.select {|err| err.status == response.status }
|
405
|
+
errors.length == 1 ? errors.first : nil
|
401
406
|
end
|
402
407
|
if err_type
|
403
408
|
raise err_type.new(response)
|
data/lib/orchestrate/version.rb
CHANGED
@@ -36,4 +36,13 @@ describe Orchestrate::Client do
|
|
36
36
|
client.ping
|
37
37
|
end
|
38
38
|
|
39
|
+
it "handles ping with invalid api_key and raises Unauthorized" do
|
40
|
+
client, stubs = make_client_and_artifacts
|
41
|
+
headers = response_headers
|
42
|
+
stubs.head("/v0") { [ 401, headers, '' ] }
|
43
|
+
assert_raises Orchestrate::API::Unauthorized do
|
44
|
+
client.ping
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
39
48
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orchestrate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Lyon
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-06-
|
13
|
+
date: 2014-06-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|