vault-invoice-builder-client 0.0.6 → 0.0.7

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
- SHA1:
3
- metadata.gz: d133898637556b60b1b42dfd36ec3c9ec334c229
4
- data.tar.gz: 745b364b00e69abd3bbb3c0ac2ce590084193023
2
+ SHA256:
3
+ metadata.gz: c4ea1ae41c6b2cb1fe62592f8663d461fd9b7ebe2317155e948f979d00a5e3f5
4
+ data.tar.gz: ad1a632491e4528035c8494ff1b0241db0b64f759f0a46e244beee1533d304c8
5
5
  SHA512:
6
- metadata.gz: a91fe5e9f61ad580e9f6a49bdc715919ced237fd54ea3c5626728c14de081401249c40b351a35da87cec476da5bfbcb85107fbc2f089b4c3cc51a1b7b5f8388a
7
- data.tar.gz: 091b769faab4fbd7cede084bf253e8bd65066bb6974e2c0a6f95ee842c03dfc056659219c1938cd1c178c3db2bd9be7646db15fba407ff85f7549725153953fb
6
+ metadata.gz: 00d092d1d26d34f253317c5636ed2fb7120c9b333713033d920bcfb36e0d6e9addda1cce241da00d7694860e3234fce431f6b3a7e678e782ca00195ec0e621c6
7
+ data.tar.gz: b017770449c29e572b5bb3f565ec94186b2c287c24bc46148106a56240d4543461512f25572dd344c4b25154e846499741cccdddd8dc7e8e4f90a2604efa8977
@@ -1,4 +1,3 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0.0
4
- - 1.9.3
3
+ - 2.5.3
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vault-invoice-builder-client (0.0.5)
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
- ansi (1.5.0)
13
- byebug (5.0.0)
14
- columnize (= 0.9.0)
15
- coderay (1.1.1)
16
- columnize (0.9.0)
17
- excon (0.56.0)
18
- guard-compat (1.2.1)
19
- guard-minitest (2.4.4)
20
- guard-compat (~> 1.2)
21
- minitest (>= 3.0)
22
- logfmt (0.0.7)
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.8.1)
32
- slop (~> 3.4)
33
- rack (1.6.4)
34
- rack-test (0.6.3)
35
- rack (>= 1.0)
36
- rake (10.4.2)
37
- rr (1.1.2)
38
- scrolls (0.3.8)
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 (~> 4.7.4)
33
+ minitest (~> 5.11)
47
34
  nokogiri
48
- rack-test
35
+ rack-test (~> 1.1)
49
36
  rr
50
- scrolls
51
- turn
52
- yajl-ruby (1.2.1)
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.15.4
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
- response = connection.post(
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(url: statement_url, json_size: json_size),
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
@@ -2,7 +2,7 @@ module Vault
2
2
  module InvoiceBuilder
3
3
  class Client
4
4
  # The `Vault::InvoiceBuilder::Client` gem version.
5
- VERSION = '0.0.6'
5
+ VERSION = '0.0.7'
6
6
  end
7
7
  end
8
8
  end
@@ -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.6
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: 2017-08-30 00:00:00.000000000 Z
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
- rubyforge_project:
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: