vault-invoice-builder-client 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.travis.yml +1 -2
- data/Gemfile +3 -3
- data/Gemfile.lock +26 -40
- data/lib/vault-invoice-builder-client/client.rb +6 -4
- data/lib/vault-invoice-builder-client/version.rb +1 -1
- data/test/client_test.rb +18 -0
- data/vault-invoice-builder-client.gemspec +4 -2
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c4ea1ae41c6b2cb1fe62592f8663d461fd9b7ebe2317155e948f979d00a5e3f5
|
4
|
+
data.tar.gz: ad1a632491e4528035c8494ff1b0241db0b64f759f0a46e244beee1533d304c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00d092d1d26d34f253317c5636ed2fb7120c9b333713033d920bcfb36e0d6e9addda1cce241da00d7694860e3234fce431f6b3a7e678e782ca00195ec0e621c6
|
7
|
+
data.tar.gz: b017770449c29e572b5bb3f565ec94186b2c287c24bc46148106a56240d4543461512f25572dd344c4b25154e846499741cccdddd8dc7e8e4f90a2604efa8977
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -3,14 +3,14 @@ source 'https://rubygems.org'
|
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
group :development do
|
6
|
-
gem 'rake'
|
7
|
-
gem 'yard'
|
8
6
|
gem 'byebug'
|
9
7
|
gem 'multi_json'
|
8
|
+
gem 'rake'
|
9
|
+
gem 'yard'
|
10
10
|
end
|
11
11
|
|
12
12
|
group :test do
|
13
|
+
gem 'pry'
|
13
14
|
gem 'rr'
|
14
15
|
gem 'vault-test-tools'
|
15
|
-
gem 'pry'
|
16
16
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
vault-invoice-builder-client (0.0.
|
4
|
+
vault-invoice-builder-client (0.0.7)
|
5
5
|
excon
|
6
6
|
multi_json
|
7
7
|
yajl-ruby
|
@@ -9,48 +9,34 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
method_source (0.8.2)
|
24
|
-
mini_portile (0.6.2)
|
25
|
-
minitest (4.7.5)
|
26
|
-
multi_json (1.11.1)
|
27
|
-
nokogiri (1.6.6.2)
|
28
|
-
mini_portile (~> 0.6.0)
|
29
|
-
pry (0.10.4)
|
12
|
+
byebug (11.0.1)
|
13
|
+
coderay (1.1.2)
|
14
|
+
excon (0.65.0)
|
15
|
+
logfmt (0.0.8)
|
16
|
+
method_source (0.9.2)
|
17
|
+
mini_portile2 (2.4.0)
|
18
|
+
minitest (5.11.3)
|
19
|
+
multi_json (1.13.1)
|
20
|
+
nokogiri (1.10.3)
|
21
|
+
mini_portile2 (~> 2.4.0)
|
22
|
+
pry (0.12.2)
|
30
23
|
coderay (~> 1.1.0)
|
31
|
-
method_source (~> 0.
|
32
|
-
|
33
|
-
rack (1.
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
slop (3.6.0)
|
40
|
-
turn (0.9.7)
|
41
|
-
ansi
|
42
|
-
minitest (~> 4)
|
43
|
-
vault-test-tools (0.3.9)
|
44
|
-
guard-minitest
|
24
|
+
method_source (~> 0.9.0)
|
25
|
+
rack (2.0.7)
|
26
|
+
rack-test (1.1.0)
|
27
|
+
rack (>= 1.0, < 3)
|
28
|
+
rake (12.3.3)
|
29
|
+
rr (1.2.1)
|
30
|
+
scrolls (0.9.0)
|
31
|
+
vault-test-tools (1.0.0)
|
45
32
|
logfmt
|
46
|
-
minitest (~>
|
33
|
+
minitest (~> 5.11)
|
47
34
|
nokogiri
|
48
|
-
rack-test
|
35
|
+
rack-test (~> 1.1)
|
49
36
|
rr
|
50
|
-
scrolls
|
51
|
-
|
52
|
-
|
53
|
-
yard (0.8.7.6)
|
37
|
+
scrolls (= 0.9)
|
38
|
+
yajl-ruby (1.4.1)
|
39
|
+
yard (0.9.20)
|
54
40
|
|
55
41
|
PLATFORMS
|
56
42
|
ruby
|
@@ -66,4 +52,4 @@ DEPENDENCIES
|
|
66
52
|
yard
|
67
53
|
|
68
54
|
BUNDLED WITH
|
69
|
-
1.
|
55
|
+
1.17.3
|
@@ -40,13 +40,15 @@ module Vault::InvoiceBuilder
|
|
40
40
|
# @raise [Excon::Errors::HTTPStatusError] Raised if the server returns an
|
41
41
|
# unsuccessful HTTP status code.
|
42
42
|
# @return [Excon::Response] The response object.
|
43
|
-
def post_url(statement_url, json_size=nil)
|
43
|
+
def post_url(statement_url, json_size=nil, options={})
|
44
44
|
connection = Excon.new(@url)
|
45
|
-
|
45
|
+
params = { url: statement_url, json_size: json_size }.merge(options)
|
46
|
+
connection.post(
|
46
47
|
path: "/statements",
|
47
48
|
headers: {'Content-Type' => 'application/json'},
|
48
|
-
body: JSON.generate(
|
49
|
-
expects: [202]
|
49
|
+
body: JSON.generate(params),
|
50
|
+
expects: [202]
|
51
|
+
)
|
50
52
|
end
|
51
53
|
|
52
54
|
# @deprecated Please use {#post_url} instead
|
data/test/client_test.rb
CHANGED
@@ -151,4 +151,22 @@ class ClientTest < Vault::TestCase
|
|
151
151
|
assert_equal(100, doc[:json_size])
|
152
152
|
end
|
153
153
|
|
154
|
+
def test_post_url_with_options
|
155
|
+
json = { url: 'http://encrypted.url.example', json_size: 100, run_rate_statement: 'true' }
|
156
|
+
Excon.stub(method: :post) do |request|
|
157
|
+
assert_equal('vault-invoice-builder.herokuapp.com', request[:host])
|
158
|
+
assert_equal(443, request[:port])
|
159
|
+
assert_equal('/statements', request[:path])
|
160
|
+
assert_equal('application/json', request[:headers]['Content-Type'])
|
161
|
+
assert_equal(json, MultiJson.load(request[:body], {symbolize_keys: true}))
|
162
|
+
Excon.stubs.pop
|
163
|
+
{status: 202, body: JSON.generate(url: 'http://encrypted.url.example', json_size: 100, run_rate_statement: 'true')}
|
164
|
+
end
|
165
|
+
response = @client.post_url('http://encrypted.url.example', 100, run_rate_statement: 'true')
|
166
|
+
doc = MultiJson.load(response.body, symbolize_keys: true)
|
167
|
+
assert_equal(202, response.status)
|
168
|
+
assert_equal('http://encrypted.url.example', doc[:url])
|
169
|
+
assert_equal(100, doc[:json_size])
|
170
|
+
assert_equal('true', doc[:run_rate_statement])
|
171
|
+
end
|
154
172
|
end
|
@@ -5,9 +5,11 @@ require 'vault-invoice-builder-client/version'
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "vault-invoice-builder-client"
|
7
7
|
gem.version = Vault::InvoiceBuilder::Client::VERSION
|
8
|
-
gem.authors = ["Chris Continanza", "Jamu Kakar", "Matthew Manning"
|
8
|
+
gem.authors = ["Chris Continanza", "Jamu Kakar", "Matthew Manning",
|
9
|
+
"Nick Yoo", "Jessie Young"]
|
9
10
|
gem.email = ["csquared@heroku.com", "jkakar@heroku.com",
|
10
|
-
"matthew@heroku.com"
|
11
|
+
"matthew@heroku.com", "nickhyoo@gmail.com",
|
12
|
+
"jessie.a.young@gmail.com"]
|
11
13
|
gem.description = "Client for Vault::InvoiceBuilder"
|
12
14
|
gem.summary = "A simple wrapper for the Vault::InvoiceBuilder HTTP API"
|
13
15
|
gem.homepage = "https://github.com/heroku/vault-invoice-builder-client"
|
metadata
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vault-invoice-builder-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Continanza
|
8
8
|
- Jamu Kakar
|
9
9
|
- Matthew Manning
|
10
|
+
- Nick Yoo
|
11
|
+
- Jessie Young
|
10
12
|
autorequire:
|
11
13
|
bindir: bin
|
12
14
|
cert_chain: []
|
13
|
-
date:
|
15
|
+
date: 2019-07-25 00:00:00.000000000 Z
|
14
16
|
dependencies:
|
15
17
|
- !ruby/object:Gem::Dependency
|
16
18
|
name: excon
|
@@ -59,6 +61,8 @@ email:
|
|
59
61
|
- csquared@heroku.com
|
60
62
|
- jkakar@heroku.com
|
61
63
|
- matthew@heroku.com
|
64
|
+
- nickhyoo@gmail.com
|
65
|
+
- jessie.a.young@gmail.com
|
62
66
|
executables: []
|
63
67
|
extensions: []
|
64
68
|
extra_rdoc_files: []
|
@@ -95,10 +99,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
99
|
- !ruby/object:Gem::Version
|
96
100
|
version: '0'
|
97
101
|
requirements: []
|
98
|
-
|
99
|
-
rubygems_version: 2.5.1
|
102
|
+
rubygems_version: 3.0.3
|
100
103
|
signing_key:
|
101
104
|
specification_version: 4
|
102
105
|
summary: A simple wrapper for the Vault::InvoiceBuilder HTTP API
|
103
106
|
test_files: []
|
104
|
-
has_rdoc:
|