friendly_shipping 0.4.3 → 0.4.4

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: 4d761859165aa830263e2c0a32ffb65f48b8a139
4
- data.tar.gz: '010484c2f0bce6443d15eecdf86b82d9ffb68ca5'
3
+ metadata.gz: 26ef19bf95bf17a1e4d817c37b57bc5e2b2b0916
4
+ data.tar.gz: 945c1eeb560ddb6e457d7fd82c696c1496122749
5
5
  SHA512:
6
- metadata.gz: acc250eb47504239555f0507a6e7aa063c9b6ad1b1cd32eb6b1f0da4b0997f0aa4b1519a6ffc058f8fdeec8e4eefbeb5753ef6779c7aad4032bfa7f003597c26
7
- data.tar.gz: 839c5d701cb9f12bca12036a8ca0834a96f2ce91f523f8269c17c5b2e0f16172dc7cb322d7a7a28de3e4ad0127859887e27ea86ff08954ac6cec971193687ec2
6
+ metadata.gz: aca264652de28e83178c63c5fec09b9dbba40c8ad9c6f59540c94dab1dc0009d31e760ec48b4eb162de11018948f52522540e10e79384de2f068806b6e3d1685
7
+ data.tar.gz: a0def3163d4e5c8856e0c4c92b48020eac8f93183949302c1d99ad401ad8595659fece76cd55e77008a80c71e256f28e97b9664ab0ed5de242f5c4a5a4caf733
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.4.4] - 2019-11-27
8
+
9
+ ### Changed
10
+ - UPS Labels: Allow passing ShipperReleaseIndicator
11
+ - UPS Labels: Fix bug that did not allow reference numbers
12
+
7
13
  ## [0.4.3] - 2019-11-27
8
14
 
9
15
  ### Changed
@@ -11,6 +11,8 @@ module FriendlyShipping
11
11
  # values are _reference number values_. Example: `{ reference_numbers: { xn: 'my_reference_1 }`
12
12
  # @option delivery_confirmation [Symbol] Can be set to any key from PACKAGE_DELIVERY_CONFIRMATION_CODES.
13
13
  # Only possible for domestic shipments or shipments between the US and Puerto Rico.
14
+ # @option shipper_release [Boolean] Indicates that the package may be released by driver without a signature from the
15
+ # consignee. Default: false
14
16
  class LabelPackageOptions < FriendlyShipping::PackageOptions
15
17
  PACKAGE_DELIVERY_CONFIRMATION_CODES = {
16
18
  delivery_confirmation: 1,
@@ -18,15 +20,17 @@ module FriendlyShipping
18
20
  delivery_confirmation_adult_signature_required: 3
19
21
  }.freeze
20
22
 
21
- attr_reader :reference_numbers
23
+ attr_reader :reference_numbers, :shipper_release
22
24
 
23
25
  def initialize(
24
26
  reference_numbers: {},
25
27
  delivery_confirmation: nil,
28
+ shipper_release: false,
26
29
  **kwargs
27
30
  )
28
31
  @reference_numbers = reference_numbers
29
32
  @delivery_confirmation = delivery_confirmation
33
+ @shipper_release = shipper_release
30
34
  super kwargs.merge(item_options_class: LabelItemOptions)
31
35
  end
32
36
 
@@ -158,7 +158,8 @@ module FriendlyShipping
158
158
  xml: xml,
159
159
  package: package,
160
160
  reference_numbers: reference_numbers,
161
- delivery_confirmation_code: delivery_confirmation_code
161
+ delivery_confirmation_code: delivery_confirmation_code,
162
+ shipper_release: package_options.shipper_release
162
163
  )
163
164
  end
164
165
  end
@@ -191,7 +192,7 @@ module FriendlyShipping
191
192
  # if the package is US -> US or PR -> PR the only type of reference numbers that are allowed are package-level
192
193
  # Otherwise the only type of reference numbers that are allowed are shipment-level
193
194
  def allow_package_level_reference_numbers(shipment)
194
- origin, destination = shipment.origin.country, shipment.destination.country
195
+ origin, destination = shipment.origin.country.code, shipment.destination.country.code
195
196
  [['US', 'US'], ['PR', 'PR']].include?([origin, destination])
196
197
  end
197
198
 
@@ -200,7 +201,7 @@ module FriendlyShipping
200
201
  # otherwise the delivery_confirmation option must be specified on the entire shipment.
201
202
  # See Appendix P of UPS Shipping Package XML Developers Guide for the rules on which the logic below is based.
202
203
  def package_level_delivery_confirmation?(shipment)
203
- origin, destination = shipment.origin.country, shipment.destination.country
204
+ origin, destination = shipment.origin.country.code, shipment.destination.country.code
204
205
  origin == destination || [['US', 'PR'], ['PR', 'US']].include?([origin, destination])
205
206
  end
206
207
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FriendlyShipping
4
- VERSION = "0.4.3"
4
+ VERSION = "0.4.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: friendly_shipping
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Meyerhoff
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-27 00:00:00.000000000 Z
11
+ date: 2019-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: data_uri