active_shipping 0.9.10 → 0.9.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -277,11 +277,15 @@ module ActiveMerchant
277
277
  )
278
278
 
279
279
  tracking_details.elements.each('Events') do |event|
280
- location = Location.new(
281
- :city => event.elements['Address'].get_text('City').to_s,
282
- :state => event.elements['Address'].get_text('StateOrProvinceCode').to_s,
283
- :postal_code => event.elements['Address'].get_text('PostalCode').to_s,
284
- :country => event.elements['Address'].get_text('CountryCode').to_s)
280
+ address = event.elements['Address']
281
+
282
+ city = address.get_text('City').to_s
283
+ state = address.get_text('StateOrProvinceCode').to_s
284
+ zip_code = address.get_text('PostalCode').to_s
285
+ country = address.get_text('CountryCode').to_s
286
+ next if country.blank?
287
+
288
+ location = Location.new(:city => city, :state => state, :postal_code => zip_code, :country => country)
285
289
  description = event.get_text('EventDescription').to_s
286
290
 
287
291
  # for now, just assume UTC, even though it probably isn't
@@ -1,3 +1,3 @@
1
1
  module ActiveShipping
2
- VERSION = "0.9.10"
2
+ VERSION = "0.9.11"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_shipping
3
3
  version: !ruby/object:Gem::Version
4
- hash: 47
4
+ hash: 45
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 10
10
- version: 0.9.10
9
+ - 11
10
+ version: 0.9.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - James MacAulay
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2011-03-09 00:00:00 +01:00
21
+ date: 2011-03-30 00:00:00 -04:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency