active_shipping 1.1.0 → 1.1.1

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
2
  SHA1:
3
- metadata.gz: 5f255b6e48e25f1a22656abd5424216bea74ef80
4
- data.tar.gz: 7bafa8bea0f1a247ebb9aef8668c663b1b3eab44
3
+ metadata.gz: 592608c29fbeaad3bfc7f21fa36ed5099d903a9a
4
+ data.tar.gz: 4bf3a6fb28099af32c2f18d734ae79a4e6ba4463
5
5
  SHA512:
6
- metadata.gz: f79e434be0cb714e9edfdb8d9e72bdfc5d1411de34593a373e914031b1c92f3890a937f8e8741cc6cc8218d434910c89cfd1dfbc1479aaf244dbfbad929a5dbe
7
- data.tar.gz: 3a316e22f8772503f7e807d7ca4ffc057bbe8e88412cf32bcd697cc195b8ab0632a7508ea901e7d31ddcd7c7f145a390da6ffdd06bda2ea34598cd6dcf3170b9
6
+ metadata.gz: 56aa07c21b4a2fc856e0c4fe98fa4a10a196fd7bb4b708551434f45e61e5707d62bcc11425791ec07d3d5c86e4db7c40a7b67dfeeec01f870c2e7266e986d6a8
7
+ data.tar.gz: bf184014cff572470b44061be4d873a614f9ba4ef3b1e908afe8885066f15cc360b78f24ba6bf00e44da1ffa8600bd938051f5a548b13833f240938606213e95
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # ActiveShipping CHANGELOG
2
2
 
3
+ ### v1.1.1
4
+
5
+ - Fix bug with USPS tracking not handling optional fields being absent.
6
+
3
7
  ### v1.1.0
4
8
 
5
9
  - USPS: Allows package tracking disambiguation and exposes predicted arrival date and event codes.
@@ -238,9 +238,9 @@ module ActiveShipping
238
238
 
239
239
  timestamp = "#{node.at('EventDate').text}, #{node.at('EventTime').text}"
240
240
  event_code = node.at('EventCode').text
241
- city = node.at('EventCity').text
242
- state = node.at('EventState').text
243
- zip_code = node.at('EventZIPCode').text
241
+ city = node.at('EventCity').try(:text)
242
+ state = node.at('EventState').try(:text)
243
+ zip_code = node.at('EventZIPCode').try(:text)
244
244
 
245
245
  country_node = node.at('EventCountry')
246
246
  country = country_node ? country_node.text : ''
@@ -555,7 +555,8 @@ module ActiveShipping
555
555
  tracking_details << xml.root.at('TrackInfo/TrackSummary')
556
556
 
557
557
  tracking_number = xml.root.at('TrackInfo').attributes['ID'].value
558
- scheduled_delivery = Time.parse(xml.root.at('PredictedDeliveryDate').text)
558
+ prediction_node = xml.root.at('PredictedDeliveryDate') || xml.root.at('ExpectedDeliveryDate')
559
+ scheduled_delivery = prediction_node ? Time.parse(prediction_node.text) : nil
559
560
 
560
561
  tracking_details.each do |event|
561
562
  details = extract_event_details(event)
@@ -1,3 +1,3 @@
1
1
  module ActiveShipping
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -8,7 +8,6 @@
8
8
  <DestinationState>IL</DestinationState>
9
9
  <DestinationZip>61536</DestinationZip>
10
10
  <EmailEnabled>true</EmailEnabled>
11
- <ExpectedDeliveryDate>April 28, 2015</ExpectedDeliveryDate>
12
11
  <KahalaIndicator>false</KahalaIndicator>
13
12
  <MailTypeCode>DM</MailTypeCode>
14
13
  <MPDATE>2015-04-24 02:08:04.000000</MPDATE>
@@ -17,7 +16,6 @@
17
16
  <OriginState>TX</OriginState>
18
17
  <OriginZip>76226</OriginZip>
19
18
  <PodEnabled>false</PodEnabled>
20
- <PredictedDeliveryDate>April 28, 2015</PredictedDeliveryDate>
21
19
  <RestoreEnabled>false</RestoreEnabled>
22
20
  <RramEnabled>false</RramEnabled>
23
21
  <RreEnabled>false</RreEnabled>
@@ -31,7 +29,6 @@
31
29
  <EventTime>8:29 am</EventTime>
32
30
  <EventDate>April 28, 2015</EventDate>
33
31
  <Event>Out for Delivery, in truck</Event>
34
- <EventCity>OTTAWA</EventCity>
35
32
  <EventState>ON</EventState>
36
33
  <EventZIPCode>61536</EventZIPCode>
37
34
  <EventCountry>Canada</EventCountry>
@@ -123,6 +123,8 @@ class USPSTest < Minitest::Test
123
123
  response = @carrier.find_tracking_info('9102901000462189604217', :test => true)
124
124
  assert_equal 'Canada', response.shipment_events.last.location.country.name
125
125
  assert_equal :out_for_delivery, response.status
126
+ assert_nil response.scheduled_delivery_date
127
+ assert_nil response.shipment_events.last.location.city
126
128
  end
127
129
 
128
130
  def test_find_tracking_info_destination
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_shipping
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James MacAulay
@@ -33,7 +33,7 @@ cert_chain:
33
33
  fl3hbtVFTqbOlwL9vy1fudXcolIE/ZTcxQ+er07ZFZdKCXayR9PPs64heamfn0fp
34
34
  TConQSX2BnZdhIEYW+cKzEC/bLc=
35
35
  -----END CERTIFICATE-----
36
- date: 2015-05-14 00:00:00.000000000 Z
36
+ date: 2015-05-15 00:00:00.000000000 Z
37
37
  dependencies:
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: quantified
metadata.gz.sig CHANGED
Binary file