physical 0.4.5 → 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 +16 -0
- data/lib/physical/package.rb +8 -0
- data/lib/physical/version.rb +1 -1
- data/physical.gemspec +1 -1
- metadata +5 -5
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,7 +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
|
+
|
14
|
+
## [0.4.7] - 2022-12-14
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
- Relax Dry::Types dependency to "~> 1.0" [#20]
|
18
|
+
|
9
19
|
## [0.4.5] - 2022-09-28
|
20
|
+
|
10
21
|
### Added
|
11
22
|
- Add `Physical::Pallet` class [#12]
|
12
23
|
- Convenience methods for weight, volume, and fill [#15]
|
@@ -19,22 +30,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
19
30
|
- Ruby 3 support [#18]
|
20
31
|
|
21
32
|
## [0.4.4] - 2019-10-29
|
33
|
+
|
22
34
|
### Added
|
23
35
|
- Add `#sku`, `#cost` and `#description` to `Physical::Item`
|
24
36
|
|
25
37
|
## [0.4.3] - 2019-10-14
|
38
|
+
|
26
39
|
### Added
|
27
40
|
- Add `#latitude` and `#longitude` to `Physical::Location`
|
28
41
|
|
29
42
|
## [0.4.2] - 2019-09-04
|
43
|
+
|
30
44
|
### Changed
|
31
45
|
- Relax `Measured` Gem dependency
|
32
46
|
|
33
47
|
## [0.4.1] - 2019-07-15
|
48
|
+
|
34
49
|
### Added
|
35
50
|
- Add `max_weight` to `Physical::Package`
|
36
51
|
|
37
52
|
## [0.4.0] - 2019-07-10
|
53
|
+
|
38
54
|
### Added
|
39
55
|
- `Measured::Density` Type and density calculations [@tvdeyen](https://github.com/mamhoff/physical/pull/19)
|
40
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
data/physical.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
spec.required_ruby_version = '>= 2.4'
|
23
23
|
spec.add_runtime_dependency "carmen", "~> 1.0"
|
24
|
-
spec.add_runtime_dependency "dry-types", "~> 1.5
|
24
|
+
spec.add_runtime_dependency "dry-types", "~> 1.5"
|
25
25
|
spec.add_runtime_dependency "measured", "~> 2.4"
|
26
26
|
spec.add_runtime_dependency "money", ">= 5"
|
27
27
|
|
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
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.5
|
33
|
+
version: '1.5'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.5
|
40
|
+
version: '1.5'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: measured
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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
|