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 +4 -4
- checksums.yaml.gz.sig +3 -1
- data.tar.gz.sig +0 -0
- data/active_shipping.gemspec +1 -1
- data/lib/active_shipping/carriers/ups.rb +12 -0
- data/lib/active_shipping/version.rb +1 -1
- data/test/remote/ups_test.rb +18 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47ab305f494f8f8dcce83d1e6fe8d4bb564040a3
|
4
|
+
data.tar.gz: af1c599bb5301f5837f0f770d0554cec064f19f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6d5272f9e661af04ac7c31a22c0ee667cdc755a626373058e54f37593f0e4403282375261af1cd3bd9c47ed1bb4075242309f24f5b39be598a596a8325121af
|
7
|
+
data.tar.gz: 21851000dd9aee050f2cbc9d6e8daf1180bf941a0f19ebd8e1bb27260bbcb148eb136d639a697235313514c97a9dfedb6f0752817aee9714df8151089b17b0e7
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1,3 @@
|
|
1
|
-
|
1
|
+
���^V�v�A��ǁ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
|
data/active_shipping.gemspec
CHANGED
@@ -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}
|
data/test/remote/ups_test.rb
CHANGED
@@ -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.
|
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-
|
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
|
-
-
|
391
|
+
- lib
|
392
392
|
required_ruby_version: !ruby/object:Gem::Requirement
|
393
393
|
requirements:
|
394
394
|
- - ">="
|
metadata.gz.sig
CHANGED
Binary file
|