fanforce 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/fanforce/main.rb CHANGED
@@ -36,6 +36,21 @@ class Fanforce
36
36
  "#{url}?#{to_query_string(req_params)}"
37
37
  end
38
38
 
39
+ def get_curl_command(method, path, req_params={})
40
+ case method
41
+ when :get
42
+ "curl \"#{path}?#{to_param(req_params)}\""
43
+ when :post
44
+ "curl -X POST -d \"#{to_param(req_params)}\" #{path}"
45
+ when :put
46
+ "curl -X PUT -d \"#{to_param(req_params)}\" #{path.to_json}"
47
+ when :delete
48
+ "curl --request DELETE \"#{path}?#{to_param(req_params)}\""
49
+ else
50
+ raise 'Unknown request method'
51
+ end
52
+ end
53
+
39
54
  def post(path, req_params={})
40
55
  url = complete_url(path)
41
56
  req_params = apply_auth(req_params)
@@ -1,3 +1,3 @@
1
1
  class Fanforce
2
- VERSION = '0.4.4'
2
+ VERSION = '0.4.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fanforce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: