shipping-calc 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ === 0.1.5 / 2008-04-20
2
+
3
+ * DHL quotes now throw an exception if the DHL's sytem is online (like it is
4
+ right now!).
5
+
1
6
  === 0.1.4 / 2008-04-12
2
7
 
3
8
  * Fixed some tests and documentation
@@ -32,7 +32,7 @@ require 'shipping_calc/freight_quote'
32
32
  module ShippingCalc
33
33
  class ShippingCalcError < StandardError
34
34
  end
35
- VERSION = "0.1.4"
35
+ VERSION = "0.1.5"
36
36
 
37
37
  US_STATES = ['AK', 'AL', 'AR', 'AZ', 'CA', 'CO', 'CT', 'DC',
38
38
  'DE', 'FL', 'GA', 'HI', 'IA', 'ID', 'IL', 'IN',
@@ -174,7 +174,12 @@ module ShippingCalc
174
174
  # Parses the server's response. Currently, it only returns the estimate
175
175
  # value of the shipping.
176
176
  def parse_response(resp)
177
+ p resp
177
178
  doc = Document.new(resp)
179
+ if resp =~ /Fault/
180
+ raise ShippingCalcError.new("DHL's system is currently offline.")
181
+ return
182
+ end
178
183
  result = doc.elements["//Shipment/Result/Desc"].text
179
184
 
180
185
  if result == "Shipment estimate successful."
@@ -6,6 +6,7 @@ include ShippingCalc
6
6
  class FreightQuoteTest < Test::Unit::TestCase
7
7
 
8
8
  def setup
9
+
9
10
  @opts = {
10
11
  :api_email => "xmltest@FreightQuote.com",
11
12
  :api_password => "XML",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shipping-calc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Federico Builes
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-04-12 00:00:00 -05:00
12
+ date: 2008-04-20 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency