wealthforge-ruby 2.2.3 → 2.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb10ed89703b868cf24d1ea795c5f95e859e201e
4
- data.tar.gz: 7763f933910a7402d7175c8707a6f6ddc6bf51b7
3
+ metadata.gz: dcd8122910f6620bbbc235b951d7185c3237c9f1
4
+ data.tar.gz: 21112526fe39abcd43a61fe5fa66a0246995cff8
5
5
  SHA512:
6
- metadata.gz: 289ee7236c93d4112aa1dae5b2799d2c7d25ecbdda6f24325519a83d0b26f62d686a36a84dd563507b2b0b08420474d97c0df961ea59010badc103b19180b91a
7
- data.tar.gz: 52f126e05a81560617bf4f3dda49c317e26852646c01e227872daf2161f98198362aa25c56de4fb58831843830a30e56ef316703c579b062c7d35f983dcb87c0
6
+ metadata.gz: d57a41dd0c40ae3273dd6e215e500b7f128a9bd320bf06e163a6608af7915ec2081621c30e6f3f3d394539e2f92f141c4c553f050e623655a712c2df05180094
7
+ data.tar.gz: e90c12a26e768203a99f46604a05fa498fb029c888aab048af7f334414870058166a0754aae1898976b9246e174c168bf2036e33ae47522faf2b2103ae5cb25e
@@ -1,8 +1,6 @@
1
- require 'pp'
2
-
3
1
  class WealthForge::ApiException < StandardError
4
2
  def initialize(e = nil)
5
- pp e
3
+ puts "API error: #{e.inspect}"
6
4
  super e
7
5
  set_backtrace e.backtrace if e
8
6
  end
@@ -5,7 +5,6 @@ require 'csv'
5
5
  require 'timeout'
6
6
  require 'resolv-replace'
7
7
  require 'jwt'
8
- require 'pp'
9
8
 
10
9
  class WealthForge::Connection
11
10
 
@@ -19,9 +18,7 @@ class WealthForge::Connection
19
18
  rescue => e
20
19
  raise WealthForge::ApiException.new(e)
21
20
  end
22
- result = JSON.parse(response.body)
23
- check_result(result)
24
- result
21
+ JSON.parse(response.body)
25
22
  end
26
23
 
27
24
 
@@ -39,6 +36,20 @@ class WealthForge::Connection
39
36
  end
40
37
 
41
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
+
42
53
  def self.file_upload (endpoint, file, filename, mime_type)
43
54
  payload = {:file => Faraday::UploadIO.new(file, mime_type, filename)}
44
55
  begin
@@ -57,6 +68,8 @@ class WealthForge::Connection
57
68
  set_token
58
69
  return Faraday.new(:url => @api_url) do |faraday|
59
70
  faraday.request :url_encoded
71
+ faraday.options.timeout = 5
72
+ faraday.options.open_timeout = 5
60
73
  faraday.headers['Authorization'] = @wf_token
61
74
  faraday.adapter Faraday.default_adapter
62
75
  faraday.use CustomErrors
@@ -64,14 +77,6 @@ class WealthForge::Connection
64
77
  end
65
78
 
66
79
 
67
- def self.check_result(result)
68
- pp result
69
- unless result['errors'].nil?
70
- pp result
71
- end
72
- end
73
-
74
-
75
80
  def self.connection_multipart
76
81
  set_token
77
82
  return Faraday.new(:url => @api_url) do |faraday|
@@ -1,3 +1,3 @@
1
1
  module WealthForge
2
- VERSION = '2.2.3'
2
+ VERSION = '2.2.8'
3
3
  end
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.3
4
+ version: 2.2.8
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: 2018-09-05 00:00:00.000000000 Z
11
+ date: 2020-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday