2Performant 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/two_performant/oauth.rb +4 -6
  3. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.3
@@ -11,8 +11,6 @@ end
11
11
 
12
12
  class Net::HTTPGenericRequest
13
13
  def oauth_body_hash_required?
14
- puts 'pac oac'
15
-
16
14
  return false
17
15
  end
18
16
  end
@@ -30,22 +28,22 @@ class TwoPerformant
30
28
  def get(path, params_hash)
31
29
  params_hash ||= {}
32
30
  response = access_token.get("#{path}?#{params_hash.to_params}")
33
- JSON.parse(response.body)
31
+ (response.body && response.body.size > 0) ? JSON.parse(response.body) : nil
34
32
  end
35
33
 
36
34
  def post(path, params_hash)
37
35
  response = access_token.post(path, params_hash, @headers)
38
- JSON.parse(response.body)
36
+ (response.body && response.body.size > 0) ? JSON.parse(response.body) : nil
39
37
  end
40
38
 
41
39
  def put(path, params_hash)
42
40
  response = access_token.put(path, params_hash, @headers)
43
- JSON.parse(response.body)
41
+ (response.body && response.body.size > 0) ? JSON.parse(response.body) : nil
44
42
  end
45
43
 
46
44
  def delete(path, params)
47
45
  response = access_token.delete("#{path}?#{params.to_params}")
48
- JSON.parse(response.body)
46
+ (response.body && response.body.size > 0) ? JSON.parse(response.body) : nil
49
47
  end
50
48
  end
51
49
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: 2Performant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: