hal-client 3.8.0 → 3.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/lib/hal_client/version.rb +1 -1
- data/lib/hal_client.rb +9 -3
- 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: 3aa1556d1a5044c04bc66ad6b1e49105fbc124b7
|
4
|
+
data.tar.gz: a266b7c77869e4f5b1429a4360ad3fa29d0de134
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd05cd62bdc95763d81d78e85c19042a8818ccafde1d4449d7ada687b1bde79d1f839a327c6162c42ced12a89fad171f0426d40f4fbe4206f8ae4f63cfe37a0f
|
7
|
+
data.tar.gz: 755b04edb28982ba19f242355a69d9d2e7d7481744e80678641cbf37717ec2677a6cf690237926ed21a7d4e0cd7b88364016b5868092ba888755fc632f9faf00
|
data/.travis.yml
CHANGED
data/lib/hal_client/version.rb
CHANGED
data/lib/hal_client.rb
CHANGED
@@ -147,12 +147,18 @@ class HalClient
|
|
147
147
|
def interpret_response(resp)
|
148
148
|
case resp.status
|
149
149
|
when 200...300
|
150
|
+
location = resp.headers["Location"]
|
151
|
+
|
150
152
|
begin
|
151
|
-
Representation.new
|
153
|
+
Representation.new(hal_client: self, parsed_json: MultiJson.load(resp.to_s),
|
154
|
+
href: location)
|
152
155
|
rescue MultiJson::ParseError, InvalidRepresentationError => e
|
153
|
-
if
|
154
|
-
|
156
|
+
if location
|
157
|
+
# response doesn't have a HAL body but we know what resource
|
158
|
+
# was created so we can be helpful.
|
159
|
+
Representation.new(hal_client: self, href: location)
|
155
160
|
else
|
161
|
+
# nothing useful to be done
|
156
162
|
resp
|
157
163
|
end
|
158
164
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hal-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.8.
|
4
|
+
version: 3.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|