broach 0.1.3 → 0.1.4

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/broach/session.rb +3 -3
  2. metadata +2 -2
@@ -39,7 +39,7 @@ module Broach
39
39
  def get(path)
40
40
  response = REST.get(url_for(path), headers_for(:get), credentials)
41
41
  if response.ok?
42
- return JSON.parse(response.body)
42
+ JSON.parse(response.body)
43
43
  else
44
44
  handle_response(:get, path, response)
45
45
  end
@@ -48,9 +48,9 @@ module Broach
48
48
  # Posts a resource to a certain path on the server. When the POST is successful
49
49
  # the parsed body is returned, otherwise an exception is raised.
50
50
  def post(path, payload)
51
- response = REST.post(url_for(path), JSON.dump(payload), headers_for(:post), credentials)
51
+ response = REST.post(url_for(path), payload.to_json, headers_for(:post), credentials)
52
52
  if response.created?
53
- return JSON.parse(response.body)
53
+ JSON.parse(response.body)
54
54
  else
55
55
  handle_response(:post, path, response)
56
56
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: broach
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manfred Stienstra
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-16 00:00:00 +01:00
12
+ date: 2009-12-23 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency