vizjerai-avalara 0.1.0 → 0.2.0
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 +8 -8
- data/CHANGELOG.md +5 -0
- data/lib/avalara/configuration.rb +14 -5
- data/lib/avalara/version.rb +1 -1
- data/spec/avalara.yml.example +1 -1
- data/spec/models/avalara/configuration_spec.rb +33 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
N2Q5YTM1NDg2ODkxNjY5YWFmMjMxOTEzNjJhZTJlOGM4MTQzYjIyNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzI0MGRhY2Y1M2FlNzA5NmVhNWRhYzQ5NTc5NzYwYzhiNDRhMjc5Mw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjBiZjZlNThlYTk4YmZiZTM3NmY5NzU0MjQxMmViYzdjZGNkZTQ1OGJjN2Yx
|
10
|
+
NzQ2MTA0MDkxZDUwYWRhNzUxYjRiMWE2ODU1YjE5MzQyMzk5MTA2YjdjMTdj
|
11
|
+
N2YzNWQzMmU4ZWJiNGYxMzc4OTQwMDUxZDgwN2QzOTRhNGJhMzA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjBjZmQ0ODE3OTliNmE2ZjA3MTU3NzhlOGYzNDk2ZTEzNzU0Nzc5YTE4NzUw
|
14
|
+
Njc5NDlhYzcwNGZlOWJkMmE3NzE1NWJmOGNkNDQwYmRhMTY5NDUyOTdkYjJi
|
15
|
+
NDY1NmM0NmIyMGQwMmJiMWFiZDJmOWEyYjkzNzA2ZTAzZWI5ZjM=
|
data/CHANGELOG.md
CHANGED
@@ -7,17 +7,26 @@ class Avalara::Configuration
|
|
7
7
|
attr_accessor :username
|
8
8
|
attr_writer :version
|
9
9
|
|
10
|
+
# Public: Changes the default endpoint between production and test.
|
11
|
+
# Default: nil
|
12
|
+
#
|
13
|
+
# set to true to change the default to the test endpoint at 'https://development.avalara.net'
|
14
|
+
# set to false or leave default to use the production endpoint at 'https://rest.avalara.net'
|
15
|
+
#
|
16
|
+
# Returns nil or the value of test
|
17
|
+
#
|
18
|
+
attr_accessor :test
|
19
|
+
|
10
20
|
##
|
11
|
-
# Public: Get the API endpoint used by the configuration.
|
12
|
-
# set, the endpoint will default to the official production endpoint at
|
13
|
-
# 'https://rest.avalara.net'.
|
21
|
+
# Public: Get the API endpoint used by the configuration.
|
14
22
|
#
|
15
|
-
# If
|
23
|
+
# If the default endpoints are not needed the endpoint can be overridden with another one.
|
16
24
|
#
|
17
25
|
# Returns the String for the API endpoint.
|
18
26
|
#
|
19
27
|
def endpoint
|
20
|
-
@endpoint
|
28
|
+
return @endpoint if @endpoint
|
29
|
+
test ? 'https://development.avalara.net' : 'https://rest.avalara.net'
|
21
30
|
end
|
22
31
|
|
23
32
|
##
|
data/lib/avalara/version.rb
CHANGED
data/spec/avalara.yml.example
CHANGED
@@ -7,7 +7,7 @@ describe Avalara::Configuration do
|
|
7
7
|
|
8
8
|
context '#endpoint' do
|
9
9
|
it 'defaults to https://rest.avalara.net' do
|
10
|
-
configuration.endpoint.
|
10
|
+
expect(configuration.endpoint).to eq 'https://rest.avalara.net'
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'may be overridden' do
|
@@ -15,8 +15,38 @@ describe Avalara::Configuration do
|
|
15
15
|
configuration.endpoint = 'https://example.local/'
|
16
16
|
}.to change(configuration, :endpoint).to('https://example.local/')
|
17
17
|
end
|
18
|
+
|
19
|
+
context 'with test == true' do
|
20
|
+
it 'defaults to https://development.avalara.net' do
|
21
|
+
expect {
|
22
|
+
configuration.test = true
|
23
|
+
}.to change(configuration, :endpoint).to 'https://development.avalara.net'
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'can be overridden' do
|
27
|
+
expect {
|
28
|
+
configuration.test = true
|
29
|
+
configuration.endpoint = 'https://example.local/'
|
30
|
+
}.to change(configuration, :endpoint).to('https://example.local/')
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
context 'with test == false' do
|
35
|
+
it 'defaults to https://rest.avalara.net' do
|
36
|
+
expect {
|
37
|
+
configuration.test = false
|
38
|
+
}.to_not change(configuration, :endpoint)
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'can be overridden' do
|
42
|
+
expect {
|
43
|
+
configuration.test = false
|
44
|
+
configuration.endpoint = 'https://example.local/'
|
45
|
+
}.to change(configuration, :endpoint).to('https://example.local/')
|
46
|
+
end
|
47
|
+
end
|
18
48
|
end
|
19
|
-
|
49
|
+
|
20
50
|
context '#version' do
|
21
51
|
it 'defaults to 1.0' do
|
22
52
|
configuration.version.should == '1.0'
|
@@ -52,4 +82,4 @@ describe Avalara::Configuration do
|
|
52
82
|
}.to change(configuration, :password).to('abcdefg')
|
53
83
|
end
|
54
84
|
end
|
55
|
-
end
|
85
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vizjerai-avalara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Fortuna
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hashie
|