onering-client 0.0.15 → 0.0.16

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.
Files changed (2) hide show
  1. data/lib/onering/api.rb +2 -2
  2. metadata +4 -3
@@ -61,7 +61,7 @@ module Onering
61
61
  response = @_http.request(request)
62
62
 
63
63
  if response.code.to_i >= 400
64
- rv = JSON.load(response.body)
64
+ rv = JSON.load(response.body) unless response.body.empty?
65
65
 
66
66
  if rv['errors']
67
67
  msg = "#{rv['errors']['type']}: #{rv['errors']['message']}"
@@ -74,7 +74,7 @@ module Onering
74
74
  end
75
75
  else
76
76
  if response['Content-Type'] == 'application/json'
77
- rv = JSON.load(response.body)
77
+ rv = (response.body.empty? ? nil : JSON.load(response.body))
78
78
  else
79
79
  rv = response.body
80
80
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onering-client
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 63
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 15
10
- version: 0.0.15
9
+ - 16
10
+ version: 0.0.16
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gary Hetzel
@@ -93,3 +93,4 @@ specification_version: 3
93
93
  summary: Onering client API
94
94
  test_files: []
95
95
 
96
+ has_rdoc: