physical 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -1
- data/lib/physical/package.rb +8 -0
- data/lib/physical/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45adbe9fa036b31165e380d114a9742467b551368e2a2dfc720452f2fba97e4c
|
4
|
+
data.tar.gz: 351f94658f866fe313b7499bcacef7de4a00c8370587dbbde9d81b093f6dd04d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fd937c2f74862b1d28a0f819622e8d7a29b141bca24b175707adea171ef1a7e95f86494757fe32d9d24088356ebc31967688a0b1c6b895171f0e5a746fd4e35
|
7
|
+
data.tar.gz: df819d350b08f636b8afd2d56294982564f2662205b091b429fd58cc1d1c7db507a385a04966b2c153c336ae5eb46887ae1f9f226267ae227db21a69ef2ecb36
|
data/CHANGELOG.md
CHANGED
@@ -6,12 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## Unreleased
|
8
8
|
|
9
|
+
## [0.4.8] - 2023-03-21
|
10
|
+
|
11
|
+
### Added
|
12
|
+
- Add `#items_value` to `Physical::Package` [#21]
|
13
|
+
|
9
14
|
## [0.4.7] - 2022-12-14
|
10
15
|
|
11
16
|
### Changed
|
12
|
-
- Relax Dry::Types dependency to "~> 1.0"
|
17
|
+
- Relax Dry::Types dependency to "~> 1.0" [#20]
|
13
18
|
|
14
19
|
## [0.4.5] - 2022-09-28
|
20
|
+
|
15
21
|
### Added
|
16
22
|
- Add `Physical::Pallet` class [#12]
|
17
23
|
- Convenience methods for weight, volume, and fill [#15]
|
@@ -24,22 +30,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
24
30
|
- Ruby 3 support [#18]
|
25
31
|
|
26
32
|
## [0.4.4] - 2019-10-29
|
33
|
+
|
27
34
|
### Added
|
28
35
|
- Add `#sku`, `#cost` and `#description` to `Physical::Item`
|
29
36
|
|
30
37
|
## [0.4.3] - 2019-10-14
|
38
|
+
|
31
39
|
### Added
|
32
40
|
- Add `#latitude` and `#longitude` to `Physical::Location`
|
33
41
|
|
34
42
|
## [0.4.2] - 2019-09-04
|
43
|
+
|
35
44
|
### Changed
|
36
45
|
- Relax `Measured` Gem dependency
|
37
46
|
|
38
47
|
## [0.4.1] - 2019-07-15
|
48
|
+
|
39
49
|
### Added
|
40
50
|
- Add `max_weight` to `Physical::Package`
|
41
51
|
|
42
52
|
## [0.4.0] - 2019-07-10
|
53
|
+
|
43
54
|
### Added
|
44
55
|
- `Measured::Density` Type and density calculations [@tvdeyen](https://github.com/mamhoff/physical/pull/19)
|
45
56
|
- Use `Measured::Density` Type when initializing `Physical::Package#void_fill_density` [@mamhoff](https://github.com/mamhoff/physical/pull/22)
|
data/lib/physical/package.rb
CHANGED
@@ -28,6 +28,14 @@ module Physical
|
|
28
28
|
container.weight + items_weight + void_fill_weight
|
29
29
|
end
|
30
30
|
|
31
|
+
# Cost is optional. We will only return an aggregate if all items
|
32
|
+
# have cost defined. Otherwise we will retun nil.
|
33
|
+
# @return Money
|
34
|
+
def items_value
|
35
|
+
items_cost = items.map(&:cost)
|
36
|
+
items_cost.reduce(&:+) if items_cost.compact.size == items_cost.size
|
37
|
+
end
|
38
|
+
|
31
39
|
# @return [Measured::Weight]
|
32
40
|
def items_weight
|
33
41
|
items.map(&:weight).reduce(Measured::Weight(0, :g), &:+)
|
data/lib/physical/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: physical
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Meyerhoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carmen
|
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
230
230
|
- !ruby/object:Gem::Version
|
231
231
|
version: '0'
|
232
232
|
requirements: []
|
233
|
-
rubygems_version: 3.
|
233
|
+
rubygems_version: 3.3.26
|
234
234
|
signing_key:
|
235
235
|
specification_version: 4
|
236
236
|
summary: A facade to deal with physical packages
|