active_tax 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d3957d7cbf857c872fa87e0914723bc14759eebb
4
- data.tar.gz: c059ac91dd7e8795fca58948dae1e994cfcc5cf4
2
+ SHA256:
3
+ metadata.gz: c39904da2bd27e394e5b441bb8a94b6dc677c988566c4c9920a313c6e71616f4
4
+ data.tar.gz: 924a836078bc0f86bf0d4b5f08aa4ccb4d1e35391f944213a8a77df94b24d1aa
5
5
  SHA512:
6
- metadata.gz: 4c767319d745816e2a11bc30f5d74d2a3f7ccdf705d0594ecce85c5485ee1e32c167413863a7875680dc784cb0b4077f700c68869c0ce851512f00e810dcbe0c
7
- data.tar.gz: e1a1098beac1550d69aa4225520fde314013d46494e2a67bad22aacc7f017e1a2f7799dd178944d68c95f5eadc473b3ff401955a7c68e864676f6030d86104fb
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.0.0'
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 a Struct with #rate, #location_code, and #result_code properties.
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 = ["jamon@clearsightstudio.com"]
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"
@@ -1,10 +1,10 @@
1
1
  module ActiveTax
2
2
  module States
3
3
  class WA
4
- API_URI = "http://rateservice.dor.wa.gov/text"
4
+ API_URI = "http://webgis.dor.wa.gov/webapi/AddressRates.aspx/text"
5
5
 
6
6
  def self.tax(address={})
7
- # http://rateservice.dor.wa.gov/text?output=text&addr=6500%20Linderson%20way&city=&zip=98501
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]}",
@@ -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
@@ -1,3 +1,3 @@
1
1
  module ActiveTax
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
data/test/test_tax.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require_relative './test_helper'
2
2
 
3
- class TestTax < Minitest::Unit::TestCase
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, -1
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.0.0
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: 2017-09-12 00:00:00.000000000 Z
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
- - jamon@clearsightstudio.com
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.4.5
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