sifiapi 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/faraday/response/parse_json.rb +1 -1
- data/lib/sifi_api/resource.rb +1 -2
- data/lib/sifi_api/version.rb +1 -1
- metadata +10 -10
@@ -4,7 +4,7 @@ module Faraday
|
|
4
4
|
|
5
5
|
def call(env)
|
6
6
|
@app.call(env).on_complete do
|
7
|
-
if env[:response_headers]["content-type"].include?("application/json")
|
7
|
+
if (env[:response_headers]["content-type"] || "").include?("application/json")
|
8
8
|
env[:body] = convert_to_json(env[:body])
|
9
9
|
end
|
10
10
|
end
|
data/lib/sifi_api/resource.rb
CHANGED
@@ -32,7 +32,6 @@ class SifiApi::Resource
|
|
32
32
|
resource_name = resource.to_s.pluralize
|
33
33
|
response = @connection.post(@user_key, self.resource + "/#{resource_name}", params)
|
34
34
|
if response && response.body
|
35
|
-
handle_response
|
36
35
|
record = response.body[resource_name].first
|
37
36
|
SifiApi.const_get(resource.to_s.classify).new(record, @connection, @user_key)
|
38
37
|
end
|
@@ -94,7 +93,7 @@ class SifiApi::Resource
|
|
94
93
|
execute_with_rescue do
|
95
94
|
response = @connection.send(action["method"].downcase, @user_key, action["href"])
|
96
95
|
if response && response.status == 200
|
97
|
-
if response[:content_type].include?("application/json")
|
96
|
+
if (response[:content_type] || "").include?("application/json")
|
98
97
|
@json = response.body[resource_name].first
|
99
98
|
return self
|
100
99
|
elsif ["text/csv", "application/zip"].include?(response[:content_type])
|
data/lib/sifi_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sifiapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-03 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
16
|
-
requirement: &
|
16
|
+
requirement: &2156231220 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.7.6
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2156231220
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: multi_json
|
27
|
-
requirement: &
|
27
|
+
requirement: &2156230600 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.0.3
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2156230600
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: activesupport
|
38
|
-
requirement: &
|
38
|
+
requirement: &2156229820 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 3.0.10
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2156229820
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: i18n
|
49
|
-
requirement: &
|
49
|
+
requirement: &2156229160 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: 0.5.0
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2156229160
|
58
58
|
description: ''
|
59
59
|
email:
|
60
60
|
- brandon@simpli.fi
|