getty_up 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,11 @@
1
1
  module GettyUp
2
2
  module API
3
3
  module Util
4
- def post_json(request, endpoint)
5
- puts '--- Request to Getty --'
6
- puts request
4
+ def post_json(request, endpoint, debug = false)
5
+ if debug
6
+ puts '--- Request to Getty --'
7
+ puts request
8
+ end
7
9
 
8
10
  #You may wish to replace this code with your preferred library for posting and receiving JSON data.
9
11
  uri = URI.parse(endpoint)
@@ -11,8 +13,10 @@ module GettyUp
11
13
  http.use_ssl = true
12
14
 
13
15
  response = http.post(uri.path, request.to_json, {'Content-Type' =>'application/json'}).body
14
- puts '--- Response from Getty --'
15
- puts response
16
+ if debug
17
+ puts '--- Response from Getty --'
18
+ puts response
19
+ end
16
20
  JSON.parse(response)
17
21
  end
18
22
 
@@ -1,3 +1,3 @@
1
1
  module GettyUp
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: getty_up
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-06 00:00:00.000000000 Z
12
+ date: 2013-03-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails