friendly_shipping 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11feea7117aee582e6cf2fd45e1d3957b84ac4eb99e7746f69a72ec03813a098
|
4
|
+
data.tar.gz: 9528284726091701e148ce72644cb0fef51317224bee1bcb4115be966d35913f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f079e4e7bbc7f8352933936c35efa22648706b1e83b3b0d050f506453cac1628bd2628f407b3f9d1ebab9e97471761bee9d5f918b034b107a0ec67333774e6e7
|
7
|
+
data.tar.gz: 44c1225326a3a0a51716f1ace18488f2890b1790229b8ffe1422087d28473f804b15d9a39d0b3c923f5e1d9e94cabd41ddd4bc20475bf967cfd883760bf00aa0
|
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.7.2] - 2023-01-24
|
8
|
+
- ShipEngine Service: Allow sending a label image ID when creating labels (#152)
|
9
|
+
|
10
|
+
## [0.7.1] - 2023-01-20
|
11
|
+
- ShipEngine Service: Include package dimensions even if package code given
|
12
|
+
|
7
13
|
## [0.7.0] - 2022-12-14
|
8
14
|
- Removes dependency on unmaintained data_uri gem
|
9
15
|
- Bumps required Ruby to 2.7
|
@@ -10,22 +10,26 @@ module FriendlyShipping
|
|
10
10
|
# @attribute label_format [Symbol] The format for the label. Possible Values: :png, :zpl and :pdf. Default :pdf
|
11
11
|
# @attribute label_download_type [Symbol] Whether to download directly (`:inline`) or
|
12
12
|
# obtain a URL to the label (`:url`). Default :url
|
13
|
+
# @attribute label_image_id [String] Identifier for image uploaded to ShipEngine. Default: nil
|
13
14
|
# @attribute package_options [Enumberable<LabelPackageOptions>] Package options for the packages in the shipment
|
14
15
|
#
|
15
16
|
class LabelOptions < FriendlyShipping::ShipmentOptions
|
16
17
|
attr_reader :shipping_method,
|
18
|
+
:label_download_type,
|
17
19
|
:label_format,
|
18
|
-
:
|
20
|
+
:label_image_id
|
19
21
|
|
20
22
|
def initialize(
|
21
23
|
shipping_method:,
|
22
|
-
label_format: :pdf,
|
23
24
|
label_download_type: :url,
|
25
|
+
label_format: :pdf,
|
26
|
+
label_image_id: nil,
|
24
27
|
**kwargs
|
25
28
|
)
|
26
29
|
@shipping_method = shipping_method
|
27
|
-
@label_format = label_format
|
28
30
|
@label_download_type = label_download_type
|
31
|
+
@label_format = label_format
|
32
|
+
@label_image_id = label_image_id
|
29
33
|
super(**kwargs.merge(package_options_class: LabelPackageOptions))
|
30
34
|
end
|
31
35
|
end
|
@@ -25,6 +25,10 @@ module FriendlyShipping
|
|
25
25
|
shipment_hash[:test_label] = true
|
26
26
|
end
|
27
27
|
|
28
|
+
if options.label_image_id
|
29
|
+
shipment_hash[:label_image_id] = options.label_image_id
|
30
|
+
end
|
31
|
+
|
28
32
|
shipment_hash
|
29
33
|
end
|
30
34
|
|
@@ -53,16 +57,13 @@ module FriendlyShipping
|
|
53
57
|
["reference#{index + 1}".to_sym, message]
|
54
58
|
end.to_h
|
55
59
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
height: package.container.height.convert_to(:inches).value.to_f.round(2)
|
64
|
-
}
|
65
|
-
end
|
60
|
+
package_hash[:package_code] = package_options.package_code
|
61
|
+
package_hash[:dimensions] = {
|
62
|
+
unit: 'inch',
|
63
|
+
width: package.container.width.convert_to(:inches).value.to_f.round(2),
|
64
|
+
length: package.container.length.convert_to(:inches).value.to_f.round(2),
|
65
|
+
height: package.container.height.convert_to(:inches).value.to_f.round(2)
|
66
|
+
}
|
66
67
|
package_hash
|
67
68
|
end
|
68
69
|
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.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Meyerhoff
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-monads
|