shipping-calc 0.1.4 → 0.1.5
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.
- data/History.txt +5 -0
- data/lib/shipping_calc.rb +1 -1
- data/lib/shipping_calc/dhl.rb +5 -0
- data/test/freight_quote/freight_quote_test.rb +1 -0
- metadata +2 -2
data/History.txt
CHANGED
data/lib/shipping_calc.rb
CHANGED
@@ -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.
|
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',
|
data/lib/shipping_calc/dhl.rb
CHANGED
@@ -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."
|
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
|
+
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
|
+
date: 2008-04-20 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|