vagrant_cloud 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vagrant_cloud/client.rb +15 -2
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3fe589f6de0c2adb068af34c80e7e78740fc3ab
|
4
|
+
data.tar.gz: 6894acccfd45d46a3adcfbeb2ff38fca58e24d2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86f7284a726434fcdde1d7dc860912a0c8cfdb8d6fb73181672ce07ec98e2a40028547c36f59fbaa3945c79139c302e610bd27d0a2df68619c1652ca888a0206
|
7
|
+
data.tar.gz: 1d6615c95f7b4c1864bb220e18c42c71d675468e635975765ec2038ace6abf136dc2983f5b02a4569b2a8d36c7fa2320458fc96df22c0c839e6d646b59f7e3f0
|
data/lib/vagrant_cloud/client.rb
CHANGED
@@ -50,11 +50,24 @@ module VagrantCloud
|
|
50
50
|
begin
|
51
51
|
result = RestClient::Request.execute(request_params)
|
52
52
|
|
53
|
-
|
54
|
-
parsed_result
|
53
|
+
parse_json(result)
|
55
54
|
rescue RestClient::ExceptionWithResponse => e
|
56
55
|
raise ClientError.new(e.message, e.http_body, e.http_code)
|
57
56
|
end
|
58
57
|
end
|
58
|
+
|
59
|
+
protected
|
60
|
+
|
61
|
+
# Parse string of JSON
|
62
|
+
#
|
63
|
+
# @param [String] string JSON encoded string
|
64
|
+
# @return [Object]
|
65
|
+
# @note This is included to provide expected behavior on
|
66
|
+
# Ruby 2.3. Once it has reached EOL this can be removed.
|
67
|
+
def parse_json(string)
|
68
|
+
JSON.parse(string)
|
69
|
+
rescue JSON::ParserError
|
70
|
+
raise if string != 'null'
|
71
|
+
end
|
59
72
|
end
|
60
73
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HashiCorp
|
@@ -9,22 +9,8 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-10-
|
12
|
+
date: 2018-10-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: json
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - "~>"
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: 2.1.0
|
21
|
-
type: :runtime
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - "~>"
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: 2.1.0
|
28
14
|
- !ruby/object:Gem::Dependency
|
29
15
|
name: rest-client
|
30
16
|
requirement: !ruby/object:Gem::Requirement
|