active_shipping 1.0.0 → 1.0.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: d67ea13d5af138aa5a66c9cdf708edae95282d94
4
- data.tar.gz: 061f00b789943cfb9def0ca495315a6d0dd482a3
3
+ metadata.gz: 47ab305f494f8f8dcce83d1e6fe8d4bb564040a3
4
+ data.tar.gz: af1c599bb5301f5837f0f770d0554cec064f19f7
5
5
  SHA512:
6
- metadata.gz: a426a84ca1c081e64b1bcffa792ccfbecc594648f14272ec6c00385fe4ce6fbab54c9cc9ec1505059dc7cca8b0604cb2faaf9bbbc55a647c728239137e95fa0d
7
- data.tar.gz: 46d1e8c45a4c5fc7594626c1bf8000db652cf5a88cbd49e992323b0de9c2b597d62988bfb93991da6a90a09fae36e1f5c27aef224d038a4f02464b428eb0e5a7
6
+ metadata.gz: e6d5272f9e661af04ac7c31a22c0ee667cdc755a626373058e54f37593f0e4403282375261af1cd3bd9c47ed1bb4075242309f24f5b39be598a596a8325121af
7
+ data.tar.gz: 21851000dd9aee050f2cbc9d6e8daf1180bf941a0f19ebd8e1bb27260bbcb148eb136d639a697235313514c97a9dfedb6f0752817aee9714df8151089b17b0e7
checksums.yaml.gz.sig CHANGED
@@ -1 +1,3 @@
1
- ��{��wHe��_DG��r������c����J����GXexG3T���w�@�$~���f�8�$��QE�>�7�/F/���sS���M�|~��/;G��(��~�~�i$�� W!�-��>7��v�>Q>�~��z�*�9 �=��C���J�w�,��T�6����6&��-y�ܐd��Z�HZ�XJ��_�ݦ����1d�#��������ݰDz����� �2��+�n�G|��T@K�w�P�\��x�cU�,
1
+ ���^VvA��ǁE�>T�<p?Zj;6u�ɕ��ĭM_C�|/`�ƤݨL��o���7�|��,�
2
+ ���(��b �X��?��?�[�`�#�:3,��T��3�� wnT��GuO�~��L0�&q9;{>�V����,I�h��(��&v�:� x��瑫��1�q�d/� 5h�ټx�~t��%&@_e ������0��L7��{��-��]Z+)�y?%�;W_�j�w�ž�0�b*
3
+ >�$����f���)%
data.tar.gz.sig CHANGED
Binary file
@@ -28,5 +28,5 @@ Gem::Specification.new do |s|
28
28
  s.files = `git ls-files`.split($/)
29
29
  s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
30
30
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
31
- s.require_path = ['lib']
31
+ s.require_path = 'lib'
32
32
  end
@@ -443,6 +443,18 @@ module ActiveShipping
443
443
  build_address_artifact_format_location(xml, 'TransitFrom', origin)
444
444
  build_address_artifact_format_location(xml, 'TransitTo', destination)
445
445
 
446
+ xml.ShipmentWeight do
447
+ xml.UnitOfMeasurement do
448
+ xml.Code(options[:imperial] ? 'LBS' : 'KGS')
449
+ end
450
+
451
+ value = packages.inject(0) do |sum, package|
452
+ sum + (options[:imperial] ? package.lbs.to_f : package.kgs.to_f )
453
+ end
454
+
455
+ xml.Weight([value.round(3), 0.1].max)
456
+ end
457
+
446
458
  xml.InvoiceLineTotal do
447
459
  xml.CurrencyCode('USD')
448
460
  total_value = packages.inject(0) {|sum, package| sum + package.value}
@@ -1,3 +1,3 @@
1
1
  module ActiveShipping
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -293,4 +293,22 @@ class RemoteUPSTest < Minitest::Test
293
293
  refute response.rates.empty?
294
294
  assert_equal ["UPS Ground"], response.rates.map(&:service_name)
295
295
  end
296
+
297
+ def test_delivery_date_estimates_intl
298
+ today = Date.current
299
+ response = @carrier.get_delivery_date_estimates(
300
+ location_fixtures[:new_york_with_name],
301
+ location_fixtures[:ottawa_with_name],
302
+ package_fixtures.values_at(:books),
303
+ pickup_date=today,
304
+ {
305
+ :test => true
306
+ }
307
+ )
308
+
309
+ assert response.success?
310
+ refute_empty response.delivery_estimates
311
+ ww_express_estimate = response.delivery_estimates.select {|de| de.service_name == "UPS Worldwide Express"}.first
312
+ assert_equal Date.parse(1.business_day.from_now.to_s), ww_express_estimate.date
313
+ end
296
314
  end
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.0.0
4
+ version: 1.0.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-06 00:00:00.000000000 Z
36
+ date: 2015-05-08 00:00:00.000000000 Z
37
37
  dependencies:
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: quantified
@@ -388,7 +388,7 @@ metadata: {}
388
388
  post_install_message:
389
389
  rdoc_options: []
390
390
  require_paths:
391
- - - lib
391
+ - lib
392
392
  required_ruby_version: !ruby/object:Gem::Requirement
393
393
  requirements:
394
394
  - - ">="
metadata.gz.sig CHANGED
Binary file