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 +4 -4
- data/lib/apisync/http_client.rb +8 -9
- data/lib/apisync/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c5eabb3330e2c8e39db11ba74aea1a709ab963d
|
4
|
+
data.tar.gz: b6a84de9c235f91a3c8d7113779a85c53ff37a2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c59a64c92bf959b4558a69676a66a31dba29c725674f5ba524bc6c8db69ab72d3a5fbe09f92fa48a38d14039a85f0a01d2682d591f717ebf3e10ffd64ed4461
|
7
|
+
data.tar.gz: d6e02c77bacf2333c4441f492c7769ebc25eaba5f5ee21cfebae93ab99f8fbb6877c5f11d9218f83e54c0dca892650e8ac9a4ea3ef613dfe933bf476b812bac8
|
data/lib/apisync/http_client.rb
CHANGED
@@ -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
|
-
|
66
|
-
|
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
|
data/lib/apisync/version.rb
CHANGED