apisync 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2348b86381d8883f53acb3ada0ba8f264d934f00
4
- data.tar.gz: caf7c15f9c683b5c13df14f3e8a0ee0e0110c171
3
+ metadata.gz: 6c5eabb3330e2c8e39db11ba74aea1a709ab963d
4
+ data.tar.gz: b6a84de9c235f91a3c8d7113779a85c53ff37a2a
5
5
  SHA512:
6
- metadata.gz: 4b1cc68e78fdd16e2163580e1ac65cf04d94d21c7ea4bce02d8847153945ac375621b9b23277cd50edb961bf99dbae11e3b3bf7300e089081f16d725afd9aacb
7
- data.tar.gz: fe601906de8be22e5ce54a1fbb6ab0a763bd1d5effec7be5c6902114920d896ee2341ea3504a03c629707da74f05929a3fbc5e5b291634311ee22bef6747b9ed
6
+ metadata.gz: 4c59a64c92bf959b4558a69676a66a31dba29c725674f5ba524bc6c8db69ab72d3a5fbe09f92fa48a38d14039a85f0a01d2682d591f717ebf3e10ffd64ed4461
7
+ data.tar.gz: d6e02c77bacf2333c4441f492c7769ebc25eaba5f5ee21cfebae93ab99f8fbb6877c5f11d9218f83e54c0dca892650e8ac9a4ea3ef613dfe933bf476b812bac8
@@ -18,7 +18,7 @@ class Apisync
18
18
  url = request_url
19
19
  header = request_header.merge(headers)
20
20
 
21
- output_verbose_request(url, request_body, header)
21
+ output_verbose_request(:post, url, request_body, header)
22
22
 
23
23
  wrap_response(HTTParty.post(
24
24
  request_url,
@@ -34,7 +34,7 @@ class Apisync
34
34
  url = request_url(id: id)
35
35
  header = request_header.merge(headers)
36
36
 
37
- output_verbose_request(url, request_body, header)
37
+ output_verbose_request(:put, url, request_body, header)
38
38
 
39
39
  wrap_response(HTTParty.put(
40
40
  url,
@@ -47,7 +47,7 @@ class Apisync
47
47
  raise Apisync::InvalidFilter if !filters.nil? && !filters.is_a?(Hash)
48
48
 
49
49
  url = request_url(id: id, filters: filters)
50
- output_verbose_request(url)
50
+ output_verbose_request(:get, url)
51
51
 
52
52
  wrap_response(HTTParty.get(
53
53
  url,
@@ -61,9 +61,10 @@ class Apisync
61
61
  @options.fetch(:verbose, false)
62
62
  end
63
63
 
64
- def output_verbose_request(url, body = nil, headers = nil)
65
- log("[APISync] Request URL: #{url}")
66
- log("[APISync] Payload: #{body.to_json}")if body
64
+ def output_verbose_request(verb, url, body = nil, headers = nil)
65
+ msg = "[APISync] Request: #{verb.to_s.upcase} #{url}"
66
+ msg << " #{body.to_json}" if body
67
+ log(msg)
67
68
  end
68
69
 
69
70
  def request_url(id: nil, filters: nil)
@@ -106,9 +107,7 @@ class Apisync
106
107
  else
107
108
  if verbose?
108
109
  msg = "[APISync] Response: #{response.code}"
109
- if response.body != ""
110
- msg << " #{response.body}"
111
- end
110
+ msg << " #{response.body}" if response.body != ""
112
111
  log msg
113
112
  end
114
113
  response
@@ -1,3 +1,3 @@
1
1
  class Apisync
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apisync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre de Oliveira