active_tax 1.0.0 → 1.1.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 +5 -5
- data/README.md +3 -4
- data/active_tax.gemspec +1 -1
- data/lib/active_tax/states/wa.rb +2 -2
- data/lib/active_tax/tax.rb +3 -3
- data/lib/active_tax/version.rb +1 -1
- data/test/test_tax.rb +2 -2
- metadata +4 -5
- data/.DS_Store +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c39904da2bd27e394e5b441bb8a94b6dc677c988566c4c9920a313c6e71616f4
|
4
|
+
data.tar.gz: 924a836078bc0f86bf0d4b5f08aa4ccb4d1e35391f944213a8a77df94b24d1aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caff39a4389911bb873d2a27a7ce0e4b66eed50a45a1ce2a69017c7dcefe0ac70f4859c072a0cd34f52fff0c908c421ed05fd29235247b42a5dd891b6ae893b4
|
7
|
+
data.tar.gz: '02835830e47258fa57c6331faeedff935214e0126644d66328891f692c6882175f8a22c1846752ce9266d27829741761f857abd3ec80afcb59953f866da8c403'
|
data/README.md
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
# ActiveTax
|
2
2
|
|
3
3
|
A Ruby gem for retrieving local sales tax rates from various government APIs.
|
4
|
-
Currently only supports Washington State sales tax, but feel free to write your
|
5
|
-
own state's implementations and do pull requests.
|
4
|
+
Currently only supports Washington State sales tax, but feel free to write your own state's implementations and do pull requests.
|
6
5
|
|
7
6
|
## Installation
|
8
7
|
|
9
8
|
Add this line to your application's Gemfile:
|
10
9
|
|
11
|
-
gem 'active_tax', '~> 1.
|
10
|
+
gem 'active_tax', '~> 1.1.0'
|
12
11
|
|
13
12
|
## Usage
|
14
13
|
|
@@ -20,7 +19,7 @@ tax = ActiveTax::Tax.new({
|
|
20
19
|
zip: "98501",
|
21
20
|
})
|
22
21
|
|
23
|
-
# tax is
|
22
|
+
# tax is an object with #rate, #location_code, and #result_code properties.
|
24
23
|
|
25
24
|
puts tax.rate #=> 0.087
|
26
25
|
puts tax.location_code #=> "3406"
|
data/active_tax.gemspec
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path('../lib/active_tax/version', __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.authors = ["Jamon Holmgren"]
|
6
|
-
gem.email = ["
|
6
|
+
gem.email = ["jamonholmgren@gmail.com"]
|
7
7
|
gem.description = "A Ruby gem for retrieving local sales tax rates from various government APIs. Currently only supports Washington State tax, but feel free to submit pull requests."
|
8
8
|
gem.summary = "A Ruby gem for retrieving local sales tax rates from various government APIs."
|
9
9
|
gem.homepage = "https://github.com/jamonholmgren/active_tax"
|
data/lib/active_tax/states/wa.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
module ActiveTax
|
2
2
|
module States
|
3
3
|
class WA
|
4
|
-
API_URI = "http://
|
4
|
+
API_URI = "http://webgis.dor.wa.gov/webapi/AddressRates.aspx/text"
|
5
5
|
|
6
6
|
def self.tax(address={})
|
7
|
-
# http://
|
7
|
+
# http://webgis.dor.wa.gov/webapi/AddressRates.aspx/text?output=text&addr=6500+Linderson+Way&city=Tumwater&zip=98501
|
8
8
|
params = {
|
9
9
|
output: "text",
|
10
10
|
addr: "#{address[:address]}",
|
data/lib/active_tax/tax.rb
CHANGED
@@ -23,15 +23,15 @@ module ActiveTax
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def rate
|
26
|
-
tax.rate
|
26
|
+
tax && tax.rate
|
27
27
|
end
|
28
28
|
|
29
29
|
def location_code
|
30
|
-
tax.location_code
|
30
|
+
tax && tax.location_code
|
31
31
|
end
|
32
32
|
|
33
33
|
def result_code
|
34
|
-
tax.result_code
|
34
|
+
tax && tax.result_code
|
35
35
|
end
|
36
36
|
|
37
37
|
private
|
data/lib/active_tax/version.rb
CHANGED
data/test/test_tax.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative './test_helper'
|
2
2
|
|
3
|
-
class TestTax < Minitest::
|
3
|
+
class TestTax < Minitest::Test
|
4
4
|
def test_real_rate
|
5
5
|
rate = ActiveTax::Tax.rate({
|
6
6
|
address: "6500 Linderson Way",
|
@@ -20,7 +20,7 @@ class TestTax < Minitest::Unit::TestCase
|
|
20
20
|
state: "WA"
|
21
21
|
})
|
22
22
|
|
23
|
-
assert_equal rate,
|
23
|
+
assert_equal rate, false
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_other_tax_info
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_tax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamon Holmgren
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -56,12 +56,11 @@ description: A Ruby gem for retrieving local sales tax rates from various govern
|
|
56
56
|
APIs. Currently only supports Washington State tax, but feel free to submit pull
|
57
57
|
requests.
|
58
58
|
email:
|
59
|
-
-
|
59
|
+
- jamonholmgren@gmail.com
|
60
60
|
executables: []
|
61
61
|
extensions: []
|
62
62
|
extra_rdoc_files: []
|
63
63
|
files:
|
64
|
-
- ".DS_Store"
|
65
64
|
- ".gitignore"
|
66
65
|
- Gemfile
|
67
66
|
- LICENSE
|
@@ -94,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
93
|
version: '0'
|
95
94
|
requirements: []
|
96
95
|
rubyforge_project:
|
97
|
-
rubygems_version: 2.
|
96
|
+
rubygems_version: 2.7.3
|
98
97
|
signing_key:
|
99
98
|
specification_version: 4
|
100
99
|
summary: A Ruby gem for retrieving local sales tax rates from various government APIs.
|
data/.DS_Store
DELETED
Binary file
|