avatax-ruby 0.0.5 → 0.0.6
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 +4 -4
- data/.circleci/config.yml +18 -0
- data/README.md +1 -0
- data/lib/avatax/client.rb +16 -13
- data/lib/avatax/version.rb +1 -1
- metadata +3 -3
- data/circle.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ba801841c9fb5c89927803cd261d1c1e7f687dd
|
4
|
+
data.tar.gz: 30f065fccf556c7ef0139ab9d61575d4b27d1cf3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 025e522f605da7b6535e10d0360b5cfce37c5454227f4608218354f6dd12e8f9fc33d77b1c5e0d5904c3fc6e5c987ffbf9946d78d5dd786b05584137d88ed7f2
|
7
|
+
data.tar.gz: aea34b7ea27b0ac4ac96544a93ad245d7bc507d0b5a78e5d2b03f442dd78c78a95955e3b280b858a49b12e25ce39d75ee3ab7d3520702df25df1d8cdaf210fbd
|
@@ -0,0 +1,18 @@
|
|
1
|
+
version: 2
|
2
|
+
jobs:
|
3
|
+
build:
|
4
|
+
docker:
|
5
|
+
- image: circleci/ruby:2.3-jessie
|
6
|
+
steps:
|
7
|
+
- checkout
|
8
|
+
- run:
|
9
|
+
name: bundle install
|
10
|
+
command: bundle install
|
11
|
+
- run:
|
12
|
+
name: RSpec
|
13
|
+
command: bundle exec rspec
|
14
|
+
environment:
|
15
|
+
AVATAX_USERNAME: test
|
16
|
+
AVATAX_PASSWORD: test
|
17
|
+
AVATAX_ENV: sandbox
|
18
|
+
|
data/README.md
CHANGED
data/lib/avatax/client.rb
CHANGED
@@ -50,8 +50,23 @@ module Avatax
|
|
50
50
|
|
51
51
|
def initialize(args = {})
|
52
52
|
@configuration = Avatax::Configuration.new(args)
|
53
|
+
@connection = args[:connection] || build_default_connection
|
53
54
|
|
54
|
-
|
55
|
+
create_instances
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
|
60
|
+
def create_instances
|
61
|
+
namespaces = self.class.instance_variable_get(:@namespaces)
|
62
|
+
namespaces.each do |klass|
|
63
|
+
reader = klass.to_s.split('::').last.underscore
|
64
|
+
self.class.send(:define_method, reader.to_sym) { klass.new @connection }
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def build_default_connection
|
69
|
+
Faraday.new(url: @configuration.base_url) do |conn|
|
55
70
|
conn.request :json
|
56
71
|
conn.request(
|
57
72
|
:basic_auth,
|
@@ -66,18 +81,6 @@ module Avatax
|
|
66
81
|
|
67
82
|
conn.adapter Faraday.default_adapter
|
68
83
|
end
|
69
|
-
|
70
|
-
create_instances
|
71
|
-
end
|
72
|
-
|
73
|
-
private
|
74
|
-
|
75
|
-
def create_instances
|
76
|
-
namespaces = self.class.instance_variable_get(:@namespaces)
|
77
|
-
namespaces.each do |klass|
|
78
|
-
reader = klass.to_s.split('::').last.underscore
|
79
|
-
self.class.send(:define_method, reader.to_sym) { klass.new @connection }
|
80
|
-
end
|
81
84
|
end
|
82
85
|
end
|
83
86
|
end
|
data/lib/avatax/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avatax-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taylor Scott
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -171,6 +171,7 @@ executables: []
|
|
171
171
|
extensions: []
|
172
172
|
extra_rdoc_files: []
|
173
173
|
files:
|
174
|
+
- ".circleci/config.yml"
|
174
175
|
- ".gitignore"
|
175
176
|
- ".rubocop.yml"
|
176
177
|
- ".ruby-gemset"
|
@@ -182,7 +183,6 @@ files:
|
|
182
183
|
- avatax.gemspec
|
183
184
|
- bin/console
|
184
185
|
- bin/setup
|
185
|
-
- circle.yml
|
186
186
|
- lib/avatax.rb
|
187
187
|
- lib/avatax/api/accounts.rb
|
188
188
|
- lib/avatax/api/addresses.rb
|