ocean-rails 3.7.2 → 3.7.3

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: 9ee2e4f23d522e6cc485c827979be527bde0cf0d
4
- data.tar.gz: dac5ee572b1d4ecd6b37a963141c810f29ba39e5
3
+ metadata.gz: aeca7252a82ca7b563ccf1e82c01e193a416026f
4
+ data.tar.gz: a003f64cb6bab3da9f119265b4187527d58cab1d
5
5
  SHA512:
6
- metadata.gz: 4b06fe7bbe0e80a77388cf17e38efc43e0d0bc2ba321ff049eb7d06d0c87b80ea69e2251979ffdb3cdc3688c6d5dc60fa63cb972d76ceb83fdaa969348ecb95e
7
- data.tar.gz: 19214dcaf3f29dea4b8a6b411ea35879f19c477976041dc318be088c9eb00d1bac84ece4b628b15fb088056a119cdae7d46b74d1a20b85b1b84db53b5173cefc
6
+ metadata.gz: 3ef103871d6b82357cb2b20caa0db66fc4c19125cab4812c52b463caaf60facff9f145965f4c242db41bfc57f6d7b46adf0c88516526e6895c11950a47c5a910
7
+ data.tar.gz: 62ef3eb48d620fa2c1c8304ec52972c3fa1346376e7bec62663ac8ecfac022faa97d5fa96ce1f09574d937f51ac43e6e32b0f3c616f250fc82955370bbbe4feb
@@ -301,7 +301,7 @@ class Api
301
301
  rr.send :status=, response.status
302
302
  rr.send :status_message=, response.message
303
303
  rr.send :headers=, response.headers
304
- raise GetFailed unless response.success?
304
+ raise GetFailed, "#{response.status} #{response.message}" unless response.success?
305
305
  begin
306
306
  raw = response.body
307
307
  rescue JSON::ParserError
@@ -344,7 +344,11 @@ class Api
344
344
  credentials: credentials, x_api_token: token,
345
345
  retries: retries, backoff_time: backoff_time, backoff_rate: backoff_rate,
346
346
  backoff_max: backoff_max
347
- raise PutFailed unless response.success?
347
+ self.response = response
348
+ self.status = response.status
349
+ self.status_message = response.message
350
+ self.headers = response.headers
351
+ raise PutFailed, "#{response.status} #{response.message}" unless response.success?
348
352
  begin
349
353
  self.raw = response.body
350
354
  rescue JSON::ParserError
@@ -354,10 +358,6 @@ class Api
354
358
  return if resource_type && type != resource_type
355
359
  self.resource = resource
356
360
  self.resource_type = type
357
- self.response = response
358
- self.status = response.status
359
- self.status_message = response.message
360
- self.headers = response.headers
361
361
  self.present = true
362
362
  end
363
363
 
@@ -368,7 +368,11 @@ class Api
368
368
  credentials: credentials, x_api_token: token,
369
369
  retries: retries, backoff_time: backoff_time, backoff_rate: backoff_rate,
370
370
  backoff_max: backoff_max
371
- raise PostFailed unless response.success?
371
+ self.response = response
372
+ self.status = response.status
373
+ self.status_message = response.message
374
+ self.headers = response.headers
375
+ raise PostFailed, "#{response.status} #{response.message}" unless response.success?
372
376
  begin
373
377
  raw = response.body
374
378
  rescue JSON::ParserError
@@ -391,7 +395,7 @@ class Api
391
395
  self.status = response.status
392
396
  self.status_message = response.message
393
397
  self.headers = response.headers
394
- raise DeleteFailed unless response.success?
398
+ raise DeleteFailed, "#{response.status} #{response.message}" unless response.success?
395
399
  end
396
400
 
397
401
  end
data/lib/ocean/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ocean
2
- VERSION = "3.7.2"
2
+ VERSION = "3.7.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocean-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.2
4
+ version: 3.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Bengtson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-05 00:00:00.000000000 Z
11
+ date: 2014-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus