chargehound 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +2 -0
- data/lib/chargehound.rb +2 -1
- data/lib/chargehound/api_request.rb +3 -0
- data/lib/chargehound/version.rb +1 -1
- data/test/chargehound_test.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31be9dbdfb185724f781b20725eb877783e3c664
|
4
|
+
data.tar.gz: 9319f70f475d27941ba96704aec1eacf799ae49d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f02ea14de6beeb51ab586ebd55a2be71b9e2ac0398b6a0f5350b16fbfbcfb723b6ba3185ef746aa38ad3682e1dc74ec19907d5d4997558c218fc81614a888930
|
7
|
+
data.tar.gz: 16ec1a8b42319611385c23586084898dc5be3ec2ebf17d85945d3ac2ff25981e1aa69c38f5c0318cabb9e8fb6a79ec9e24f3f102528cef2280b43d8247d93a41
|
data/CHANGELOG
CHANGED
data/lib/chargehound.rb
CHANGED
@@ -6,9 +6,10 @@ module Chargehound
|
|
6
6
|
@host = 'api.chargehound.com'
|
7
7
|
@base_path = '/v1/'
|
8
8
|
@api_key = ''
|
9
|
+
@version = nil
|
9
10
|
@timeout = 60
|
10
11
|
|
11
12
|
class << self
|
12
|
-
attr_accessor :api_key, :host, :base_path, :timeout
|
13
|
+
attr_accessor :api_key, :host, :base_path, :timeout, :version
|
13
14
|
end
|
14
15
|
end
|
@@ -50,6 +50,9 @@ module Chargehound
|
|
50
50
|
'Accept' => 'application/json',
|
51
51
|
'User-Agent' => "Chargehound/v1 RubyBindings/#{VERSION}"
|
52
52
|
}
|
53
|
+
unless Chargehound.version.nil?
|
54
|
+
headers['Chargehound-Version'] = Chargehound.version
|
55
|
+
end
|
53
56
|
body && headers['Content-Type'] = 'application/json'
|
54
57
|
headers
|
55
58
|
end
|
data/lib/chargehound/version.rb
CHANGED
data/test/chargehound_test.rb
CHANGED
@@ -10,6 +10,7 @@ describe Chargehound do
|
|
10
10
|
after do
|
11
11
|
Chargehound.api_key = ''
|
12
12
|
Chargehound.host = original_host
|
13
|
+
Chargehound.version = nil
|
13
14
|
WebMock.reset!
|
14
15
|
end
|
15
16
|
|
@@ -23,6 +24,17 @@ describe Chargehound do
|
|
23
24
|
assert_requested stub
|
24
25
|
end
|
25
26
|
|
27
|
+
it 'can set the version on the module' do
|
28
|
+
Chargehound.api_key = 'API_KEY'
|
29
|
+
Chargehound.version = '1999-01-01'
|
30
|
+
stub = stub_request(:get, 'https://api.chargehound.com/v1/disputes')
|
31
|
+
.with(headers: { 'Chargehound-Version' => '1999-01-01' })
|
32
|
+
.to_return(body: {}.to_json)
|
33
|
+
|
34
|
+
Chargehound::Disputes.list
|
35
|
+
assert_requested stub
|
36
|
+
end
|
37
|
+
|
26
38
|
it 'can set the base host on the module' do
|
27
39
|
Chargehound.host = 'test'
|
28
40
|
stub = stub_request(:get, 'https://test/v1/disputes')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chargehound
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chargehound
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07
|
11
|
+
date: 2017-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|