fluffy-ruby 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3214e2be1efb9f2ada97be76889b23bd109c95c3
4
- data.tar.gz: 67388f22003ec6c065149e0391c83fd11ff999f7
3
+ metadata.gz: df63476d08e11dd837b8ec07e9ba6d12166d80b8
4
+ data.tar.gz: 49384b5034f7d50716d7c5a28340fd698d2a7e6c
5
5
  SHA512:
6
- metadata.gz: 7a89b89065801b3d73825c2b749819e998baa51497edd8365d72531fb324e2325f1d365369f6e3d0f35899f5b39715c38196272d999662958fa8683b8ee45e5d
7
- data.tar.gz: 5d366ba769fb8697aac86b5438dc8c387dec850273dd62ad9d582a0b3663ef446f762d4ee70b7f1483fe4f93ad0218b023138f5eafbf02fa247b23bce7a0127e
6
+ metadata.gz: dccbe3c837d7c2a6c7ad14817718f3b68953c4dc24751cefd0527cc4408446353a97a6f09c3de6829d1e1cce596310a2504505eb851a01cdc7c2b6a13a0adf9c
7
+ data.tar.gz: d823d9b23b7ff043d7e37dc636db8c51ae2be330b03e0918a42a49ade890bdd246ef49f74ae0db11a2dfbfb29e33290994c8de618035072a48bcfe7e9ef7bf59
@@ -57,9 +57,11 @@ module Fluffy
57
57
  #
58
58
  def patch(endpoint:, params: {})
59
59
  resp = self.http.patch([self.url, endpoint.is_a?(Array) ? endpoint.join('/') : endpoint].join('/'), params.to_json, {'Content-Type' => 'application/json', 'Accept' => 'application/json'})
60
- data = JSON.parse(resp.body)
61
- raise APIError.new(data['message'], data['error'], resp.status) if resp.status >= 400
62
- data['message']
60
+ if resp.body.empty?
61
+ data = JSON.parse(resp.body)
62
+ raise APIError.new(data['message'], data['error'], resp.status) if resp.status >= 400
63
+ data['message']
64
+ end
63
65
  end
64
66
 
65
67
  # Perform a HTTP DELETE request
@@ -1,5 +1,5 @@
1
1
  module Fluffy
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
 
4
4
  def self.version
5
5
  VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluffy-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matteo Cerutti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-31 00:00:00.000000000 Z
11
+ date: 2017-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json