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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa71061de205b5ea4b0a5eabe170f105eec8f0fc
4
- data.tar.gz: 5ad722a314c80c75e840709f96daccc1f644e902
3
+ metadata.gz: 3aa1556d1a5044c04bc66ad6b1e49105fbc124b7
4
+ data.tar.gz: a266b7c77869e4f5b1429a4360ad3fa29d0de134
5
5
  SHA512:
6
- metadata.gz: 6bf075feeccb75b8f3b09a2c3ce9f42167f2519d5207f34c13e36b618ab410092b9a0874d2fb1f56f33dc336284f24db1064620b77f57732860ab1d3aeee4dba
7
- data.tar.gz: 9c03d6184f359e014d3a354012b07220b436ad717159366db0d066d0ff9aa3b3f0f0140c2bd3a45416281ac224144fa8ab81d406ba69e4fb796e3bd091332ae5
6
+ metadata.gz: cd05cd62bdc95763d81d78e85c19042a8818ccafde1d4449d7ada687b1bde79d1f839a327c6162c42ced12a89fad171f0426d40f4fbe4206f8ae4f63cfe37a0f
7
+ data.tar.gz: 755b04edb28982ba19f242355a69d9d2e7d7481744e80678641cbf37717ec2677a6cf690237926ed21a7d4e0cd7b88364016b5868092ba888755fc632f9faf00
data/.travis.yml CHANGED
@@ -2,9 +2,9 @@ sudo: false
2
2
  cache: bundler
3
3
  language: ruby
4
4
  rvm:
5
- - "1.9.2"
6
5
  - "1.9.3"
7
6
  - "2.0.0"
8
7
  - "2.1.0"
9
- # - ruby-head
10
- - jruby-19mode # JRuby in 1.9 mode
8
+ - "2.2.0"
9
+ - jruby-19mode
10
+ - jruby-21mode
@@ -1,3 +1,3 @@
1
1
  class HalClient
2
- VERSION = "3.8.0"
2
+ VERSION = "3.8.1"
3
3
  end
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 hal_client: self, parsed_json: MultiJson.load(resp.to_s)
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 resp.headers["Location"]
154
- Representation.new hal_client: self, href: resp.headers["Location"]
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.0
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-01 00:00:00.000000000 Z
11
+ date: 2015-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http