plaid 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/Rakefile +3 -1
- data/lib/plaid/connection.rb +3 -0
- data/lib/plaid/version.rb +1 -1
- data/spec/connection_spec.rb +15 -0
- metadata +20 -20
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NGU5NTgzYTgyOThjNzA3OWFjYzA2ZjQ2YmMyMGI0ODkzNjAwNWJhNQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NDMwYTM2ZDBlMzU2YWE4NWI1MzQxY2E0MzgzMTNmNmMzOTdkZjgwNw==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
M2QxZGI1ODU2YjMwMmRiNmFjZDJkYzM4NjI1NjJiNTM3NzE5N2NmY2I2ZDZj
|
10
|
+
YTBiNjE0ZmVhMDY5MjgzMGMxMWJmOTQ0ZjFkMTZmNzhhOTI5M2UxNWI3MWU0
|
11
|
+
NTgzMTI4MDYyZWQ5NGE4ODdlNGQ2ZmYyZDdmNWZhMThhYTRjOTc=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YjdkMTI2NzBhN2E5ZDVlZGMwMzZhZDBmY2RjMzJkYjU3YzlkZmZkM2E5ZmJi
|
14
|
+
MzVhMTU3ODk2ZTI4MGEyZjRmMjE1YzIyZGUxNzM2NTZhMzBkNmIzM2YwNTM1
|
15
|
+
MmEzODY2NTBkNDIzZjQxNjQ3Y2Q0MGViYjI5YWIwN2EyZTIxYmY=
|
data/Rakefile
CHANGED
data/lib/plaid/connection.rb
CHANGED
@@ -70,6 +70,9 @@ module Plaid
|
|
70
70
|
private
|
71
71
|
|
72
72
|
def parse_response(res)
|
73
|
+
# unfortunately, the JSON gem will raise an exception if the response is empty
|
74
|
+
raise Plaid::ServerError.new(res.code, res.msg, '') if res.body.to_s.length < 2
|
75
|
+
# we got a response from the server, so parse it
|
73
76
|
body = JSON.parse(res.body)
|
74
77
|
case res.code.delete('.').to_i
|
75
78
|
when 200 then body
|
data/lib/plaid/version.rb
CHANGED
data/spec/connection_spec.rb
CHANGED
@@ -43,6 +43,11 @@ describe Plaid::Connection do
|
|
43
43
|
stub = stub_request(:post, stub_url).to_return(status: 404, body: req_not_found)
|
44
44
|
expect { Plaid::Connection.post("testing") }.to raise_error(Plaid::NotFound, "product not found")
|
45
45
|
end
|
46
|
+
|
47
|
+
it "throws a Plaid::ServerError on empty response" do
|
48
|
+
stub = stub_request(:post, stub_url).to_return(status: 504, body: '')
|
49
|
+
expect { Plaid::Connection.post("testing") }.to raise_error(Plaid::ServerError, '')
|
50
|
+
end
|
46
51
|
end
|
47
52
|
|
48
53
|
describe "#get" do
|
@@ -124,6 +129,11 @@ describe Plaid::Connection do
|
|
124
129
|
stub = stub_request(:get, stub_url).to_return(status: 404, body: req_not_found)
|
125
130
|
expect { Plaid::Connection.secure_get("testing", "test_wells") }.to raise_error(Plaid::NotFound, "product not found")
|
126
131
|
end
|
132
|
+
|
133
|
+
it "throws a Plaid::ServerError on empty response" do
|
134
|
+
stub = stub_request(:get, stub_url).to_return(status: 504, body: '')
|
135
|
+
expect { Plaid::Connection.secure_get("testing", "test_wells") }.to raise_error(Plaid::ServerError, '')
|
136
|
+
end
|
127
137
|
end
|
128
138
|
|
129
139
|
describe "#patch" do
|
@@ -164,6 +174,11 @@ describe Plaid::Connection do
|
|
164
174
|
stub = stub_request(:patch, stub_url).to_return(status: 404, body: req_not_found)
|
165
175
|
expect { Plaid::Connection.patch("testing") }.to raise_error(Plaid::NotFound, "product not found")
|
166
176
|
end
|
177
|
+
|
178
|
+
it "throws a Plaid::ServerError on empty response" do
|
179
|
+
stub = stub_request(:patch, stub_url).to_return(status: 504, body: '')
|
180
|
+
expect { Plaid::Connection.patch("testing") }.to raise_error(Plaid::ServerError, '')
|
181
|
+
end
|
167
182
|
end
|
168
183
|
|
169
184
|
describe "#delete" do
|
metadata
CHANGED
@@ -1,97 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plaid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Crites
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.7'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '3.1'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: pry
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ! '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: pry-stack_explorer
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ! '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ! '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: webmock
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ! '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ! '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
description: Ruby gem wrapper for the Plaid API. Read more at the homepage, the wiki,
|
@@ -102,9 +102,9 @@ executables: []
|
|
102
102
|
extensions: []
|
103
103
|
extra_rdoc_files: []
|
104
104
|
files:
|
105
|
-
-
|
106
|
-
-
|
107
|
-
-
|
105
|
+
- .gitignore
|
106
|
+
- .rspec
|
107
|
+
- .travis.yml
|
108
108
|
- Gemfile
|
109
109
|
- LICENSE.txt
|
110
110
|
- README.md
|
@@ -142,17 +142,17 @@ require_paths:
|
|
142
142
|
- lib
|
143
143
|
required_ruby_version: !ruby/object:Gem::Requirement
|
144
144
|
requirements:
|
145
|
-
- -
|
145
|
+
- - ! '>='
|
146
146
|
- !ruby/object:Gem::Version
|
147
147
|
version: 1.9.3
|
148
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - ! '>='
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
requirements: []
|
154
154
|
rubyforge_project:
|
155
|
-
rubygems_version: 2.4.
|
155
|
+
rubygems_version: 2.4.8
|
156
156
|
signing_key:
|
157
157
|
specification_version: 4
|
158
158
|
summary: Ruby bindings for Plaid
|