fanforce 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fanforce/main.rb +6 -4
- data/lib/fanforce/version.rb +1 -1
- metadata +1 -1
data/lib/fanforce/main.rb
CHANGED
@@ -37,15 +37,17 @@ class Fanforce
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def get_curl_command(method, path, req_params={})
|
40
|
+
req_params = apply_auth(req_params)
|
41
|
+
url = complete_url(path)
|
40
42
|
case method
|
41
43
|
when :get
|
42
|
-
"curl \"#{
|
44
|
+
"curl \"#{url}?#{to_param(req_params)}\""
|
43
45
|
when :post
|
44
|
-
"curl -X POST -d \"#{to_param(req_params)}\" #{
|
46
|
+
"curl -X POST -d \"#{to_param(req_params)}\" #{url}"
|
45
47
|
when :put
|
46
|
-
"curl -X PUT -d \"#{to_param(req_params)}\" #{
|
48
|
+
"curl -X PUT -d \"#{to_param(req_params)}\" #{url.to_json}"
|
47
49
|
when :delete
|
48
|
-
"curl --request DELETE \"#{
|
50
|
+
"curl --request DELETE \"#{url}?#{to_param(req_params)}\""
|
49
51
|
else
|
50
52
|
raise 'Unknown request method'
|
51
53
|
end
|
data/lib/fanforce/version.rb
CHANGED