tax_cloud 0.5.0 → 0.7.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.
@@ -4,7 +4,7 @@ module TaxCloud #:nodoc:
4
4
  module Errors #:nodoc:
5
5
  # This error is raised when a SOAP call fails.
6
6
  class SoapError < TaxCloudError
7
- # Original SOAP failt.
7
+ # Original SOAP fault.
8
8
  attr_reader :fault
9
9
 
10
10
  # Create the new error.
@@ -3,6 +3,7 @@
3
3
  require 'tax_cloud/errors/tax_cloud_error'
4
4
  require 'tax_cloud/errors/missing_config_error'
5
5
  require 'tax_cloud/errors/missing_config_option_error'
6
+ require 'tax_cloud/errors/missing_cart_items_error'
6
7
  require 'tax_cloud/errors/soap_error'
7
8
  require 'tax_cloud/errors/unexpected_soap_response_error'
8
9
  require 'tax_cloud/errors/api_error'
@@ -28,7 +28,10 @@ module TaxCloud #:nodoc:
28
28
 
29
29
  # Lookup the tax rate for the transaction.
30
30
  # The returned information is based on the originating address, destination address, and cart items.
31
+ # Raises <tt>TaxCloud::Errors::MissingCartItems</tt> without calling TaxCloud when there are no cart items.
31
32
  def lookup
33
+ raise TaxCloud::Errors::MissingCartItems if cart_items.nil? || cart_items.empty?
34
+
32
35
  request_params = {
33
36
  'customerID' => customer_id,
34
37
  'cartID' => cart_id,
@@ -98,7 +101,7 @@ module TaxCloud #:nodoc:
98
101
  # Marks any included cart items as returned.
99
102
  #
100
103
  # === Options
101
- # [returned_date] The date the return occured. Default is today.
104
+ # [returned_date] The date the return occurred. Default is today.
102
105
  def returned(options = {})
103
106
  options = { returned_date: Date.today }.merge(options)
104
107
  request_params = {
@@ -2,5 +2,5 @@
2
2
 
3
3
  module TaxCloud #:nodoc:
4
4
  # The version of the <tt>tax_cloud</tt> gem.
5
- VERSION = '0.5.0'
5
+ VERSION = '0.7.0'
6
6
  end
data/script/release.rb ADDED
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ruby-gem-release/changelog'
4
+ require 'ruby-gem-release/workflow/ruby_gem'
5
+
6
+ # Builds the ruby-gem-release workflow used by the Rakefile, the Release GitHub Actions workflow, and test/test_release.rb.
7
+ module TaxCloudRelease
8
+ def self.workflow(**options)
9
+ RubyGemRelease::Workflow::RubyGem.new(
10
+ version: RubyGemRelease::Version::RubyConstant.new(path: 'lib/tax_cloud/version.rb', constant: 'VERSION'),
11
+ changelog: RubyGemRelease::Changelog::Intridea.new(placeholder: '* Your contribution here.'),
12
+ **options
13
+ )
14
+ end
15
+ end
data/tax_cloud.gemspec CHANGED
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- $LOAD_PATH.push File.expand_path('lib', __dir__)
4
- require 'tax_cloud/version'
3
+ require_relative 'lib/tax_cloud/version'
5
4
 
6
5
  Gem::Specification.new do |s|
7
6
  s.name = 'tax_cloud'