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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ae4f1fc1fb52c92604622f0153d0107460a6e54
4
- data.tar.gz: b027aa621043764fab60cfdbace426d19b71d82c
3
+ metadata.gz: 3ba801841c9fb5c89927803cd261d1c1e7f687dd
4
+ data.tar.gz: 30f065fccf556c7ef0139ab9d61575d4b27d1cf3
5
5
  SHA512:
6
- metadata.gz: 56470a52eeeab1d2d247981a878e2d763e65e70d411162617f79b721cd1a81332495ec4a10e5d687aca62b04f00b50b6d65b9eedfef3548a15ed0073bd10ff73
7
- data.tar.gz: 82a8989a98fb366c97b934754f1193946b03af63bea93e33799e05a20cb6d5abedf2e34803ab5114f81b26cacb69addc8589982d8253c8614d13a72200ae3954
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
@@ -29,6 +29,7 @@ And then execute:
29
29
  client = Avatax::Client.new(
30
30
  username: 'avatax_user',
31
31
  password: 'avatax_password',
32
+ logger: Logger.new(STDOUT),
32
33
  env: :sandbox
33
34
  )
34
35
  ```
@@ -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
- @connection = Faraday.new(url: @configuration.base_url) do |conn|
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
@@ -1,3 +1,3 @@
1
1
  module Avatax
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
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.5
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: 2019-12-16 00:00:00.000000000 Z
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
data/circle.yml DELETED
@@ -1,6 +0,0 @@
1
- dependencies:
2
- pre:
3
- - gem install bundler
4
- test:
5
- pre:
6
- - bundle exec rubocop