wealthforge-ruby 2.2.4 → 2.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wealthforge/connection.rb +19 -10
- data/lib/wealthforge/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: b531b0ecb28d082fd17c60e19e226f587003b832
|
4
|
+
data.tar.gz: 3b06336df63f8a4a9bbebb1f74f2fff3e45a46a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2720af1510a893dc82577ccd6de6bd4955c0f772cfaa0740f9dac5fac7bd34b85a249d3cd84bad87d24d243df9b4ba3c39c4169244eb430daf68d6a526857b25
|
7
|
+
data.tar.gz: f0595c97c1cc9327967befe00ad58a6fe06a2efb06555a5830044f27fa888fa1688c223e02f776d75d6018d7e95f46b4e19db64ab97bcdafb2f620f881d2e946
|
@@ -18,9 +18,7 @@ class WealthForge::Connection
|
|
18
18
|
rescue => e
|
19
19
|
raise WealthForge::ApiException.new(e)
|
20
20
|
end
|
21
|
-
|
22
|
-
check_result(result)
|
23
|
-
result
|
21
|
+
JSON.parse(response.body)
|
24
22
|
end
|
25
23
|
|
26
24
|
|
@@ -38,6 +36,20 @@ class WealthForge::Connection
|
|
38
36
|
end
|
39
37
|
|
40
38
|
|
39
|
+
def self.patch(endpoint, params)
|
40
|
+
begin
|
41
|
+
response = connection.patch do |req|
|
42
|
+
req.url endpoint
|
43
|
+
req.headers['Content-Type'] = 'application/json'
|
44
|
+
req.body = params.to_json
|
45
|
+
end
|
46
|
+
rescue => e
|
47
|
+
raise WealthForge::ApiException.new(e)
|
48
|
+
end
|
49
|
+
response.body
|
50
|
+
end
|
51
|
+
|
52
|
+
|
41
53
|
def self.file_upload (endpoint, file, filename, mime_type)
|
42
54
|
payload = {:file => Faraday::UploadIO.new(file, mime_type, filename)}
|
43
55
|
begin
|
@@ -56,25 +68,22 @@ class WealthForge::Connection
|
|
56
68
|
set_token
|
57
69
|
return Faraday.new(:url => @api_url) do |faraday|
|
58
70
|
faraday.request :url_encoded
|
71
|
+
faraday.options.timeout = 5
|
72
|
+
faraday.options.open_timeout = 5
|
59
73
|
faraday.headers['Authorization'] = @wf_token
|
60
|
-
faraday.adapter Faraday.default_adapter
|
61
74
|
faraday.use CustomErrors
|
75
|
+
faraday.adapter Faraday.default_adapter
|
62
76
|
end
|
63
77
|
end
|
64
78
|
|
65
79
|
|
66
|
-
def self.check_result(result)
|
67
|
-
puts "WF log: #{result.inspect}"
|
68
|
-
end
|
69
|
-
|
70
|
-
|
71
80
|
def self.connection_multipart
|
72
81
|
set_token
|
73
82
|
return Faraday.new(:url => @api_url) do |faraday|
|
74
83
|
faraday.request :multipart
|
75
84
|
faraday.headers['Authorization'] = @wf_token
|
76
|
-
faraday.adapter Faraday.default_adapter
|
77
85
|
faraday.use CustomErrors
|
86
|
+
faraday.adapter Faraday.default_adapter
|
78
87
|
end
|
79
88
|
end
|
80
89
|
|
data/lib/wealthforge/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wealthforge-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dino Simone | dinosimone.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.14.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.14.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mime-types
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 2.1.0
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: bundler
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '1.13'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '1.13'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rake
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|