fanforce-api 2.0.0.rc4 → 2.0.0.rc5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fanforce-api.gemspec +1 -2
- data/lib/fanforce/api/main.rb +8 -4
- data/lib/fanforce/api/version.rb +1 -1
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c4aa20005d31a17a1185f03e71be3b9115f4f35
|
4
|
+
data.tar.gz: 01d8d51a1951415750c122aa84dc7d93af61747c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e88e4e9238ca832e9a32e5edbb9b4b0466227b984158d1d4a7caf92b75b43b862601e0db57de9292fcfa7843e7a876954aa9d95ff12b2b95862b855631f0d1a1
|
7
|
+
data.tar.gz: 291f810b1770242c9a0b29ef01a6f26b981c912aa4ffc6da2261a20b9345c39cdeac011ca32bf7a7a31f800a421389dd0255f09ba264a8cca8fe2b1975c85b38
|
data/fanforce-api.gemspec
CHANGED
@@ -19,7 +19,6 @@ Gem::Specification.new do |gem|
|
|
19
19
|
|
20
20
|
gem.add_runtime_dependency 'rest-client', '~> 1.8.0'
|
21
21
|
gem.add_runtime_dependency 'uuid', '~> 2.3.7'
|
22
|
-
gem.add_runtime_dependency 'multi_json', '>= 1.7.2'
|
23
22
|
|
24
|
-
gem.add_runtime_dependency 'fanforce-base', '>= 2.0.0.
|
23
|
+
gem.add_runtime_dependency 'fanforce-base', '>= 2.0.0.rc3'
|
25
24
|
end
|
data/lib/fanforce/api/main.rb
CHANGED
@@ -26,7 +26,8 @@ class Fanforce::API
|
|
26
26
|
# @return [Fanforce::API::Response]
|
27
27
|
def get(path, params={})
|
28
28
|
params = inject_auth_params(params)
|
29
|
-
|
29
|
+
headers = {'Accept' => 'application/json'}
|
30
|
+
RestClient.get(request_url(path, params), headers) do |response, request, result, &block|
|
30
31
|
Fanforce::API::Response.process(response, request, request_url(path), params)
|
31
32
|
end
|
32
33
|
end
|
@@ -38,7 +39,8 @@ class Fanforce::API
|
|
38
39
|
def post(path, params={}, retries=0)
|
39
40
|
url = request_url(path)
|
40
41
|
params = inject_auth_params(params) unless retries > 0
|
41
|
-
|
42
|
+
headers = {'Content-Type' => 'application/json', 'Accept' => 'application/json'}
|
43
|
+
RestClient.post(url, MultiJson.dump(params), headers) do |response, request, result, &block|
|
42
44
|
if response.code == 400 and response.body == '{"error":"Invalid JSON"}' and retries <= 2
|
43
45
|
puts "retried #{path} #{retries+1} times"
|
44
46
|
post(path, params, retries+1)
|
@@ -55,7 +57,8 @@ class Fanforce::API
|
|
55
57
|
def put(path, params={}, retries=0)
|
56
58
|
url = request_url(path)
|
57
59
|
params = inject_auth_params(params) unless retries > 0
|
58
|
-
|
60
|
+
headers = {'Content-Type' => 'application/json', 'Accept' => 'application/json'}
|
61
|
+
RestClient.put(url, MultiJson.dump(params), headers) do |response, request, result, &block|
|
59
62
|
if response.code == 400 and response.body == '{"error":"Invalid JSON"}' and retries <= 2
|
60
63
|
puts "retried #{path} #{retries+1} times"
|
61
64
|
post(path, params, retries+1)
|
@@ -72,7 +75,8 @@ class Fanforce::API
|
|
72
75
|
def delete(path, params={})
|
73
76
|
url = request_url(path)
|
74
77
|
params = inject_auth_params(params)
|
75
|
-
|
78
|
+
headers = {'Accept' => 'application/json'}
|
79
|
+
RestClient.delete(request_url(path, params), headers) do |response, request, result, &block|
|
76
80
|
Fanforce::API::Response.process(response, request, url, params)
|
77
81
|
end
|
78
82
|
end
|
data/lib/fanforce/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fanforce-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.rc5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Caleb Clark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -38,34 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 2.3.7
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: multi_json
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 1.7.2
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 1.7.2
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: fanforce-base
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
45
|
- - ">="
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2.0.0.
|
47
|
+
version: 2.0.0.rc3
|
62
48
|
type: :runtime
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - ">="
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: 2.0.0.
|
54
|
+
version: 2.0.0.rc3
|
69
55
|
description:
|
70
56
|
email:
|
71
57
|
- cclark@fanforce.com
|