seshbot-packing 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/seshbot/packing/package.rb +8 -2
- data/lib/seshbot/packing/recipe.rb +33 -3
- data/lib/seshbot/packing/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcd108047bea2fe4b890f489dfae607149553eda6580377307ba0da508b09106
|
4
|
+
data.tar.gz: fa66fc1bf3d90177921fd3abb9916140bffe80d83a3ebcd991e4ea7c6090bf26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 489a49b0e178294f885d70301b339292a85de575044a6c4a1473a25793cf851f288b95a50530c26fb6fadfc5b94639f4eaec35c218aa659be37a064942597b16
|
7
|
+
data.tar.gz: 6e2bd8737ef03133ae76ae6811f6ddc96efe5e72ff8db287471a0be89f8c631587335f8032a69196498bf4d449548b628d98d24adecde619845a7b2dc58c4266
|
data/Gemfile.lock
CHANGED
@@ -49,8 +49,14 @@ module Seshbot
|
|
49
49
|
|
50
50
|
|
51
51
|
def unpack(product_type_counts)
|
52
|
-
|
53
|
-
|
52
|
+
final_result = product_type_counts
|
53
|
+
|
54
|
+
while true
|
55
|
+
new_result = pack_single_step(final_result, unpacking: true)
|
56
|
+
break if new_result == final_result
|
57
|
+
final_result = new_result
|
58
|
+
end
|
59
|
+
final_result
|
54
60
|
end
|
55
61
|
|
56
62
|
def pack_single_step(product_type_counts, unpacking:)
|
@@ -4,23 +4,53 @@ module Seshbot
|
|
4
4
|
class << self
|
5
5
|
def get_recipes
|
6
6
|
{
|
7
|
-
"
|
7
|
+
"bottles_twenty_four_pack_4"=>{
|
8
8
|
"input_fragment"=>"B306",
|
9
9
|
"input_quantity"=>4,
|
10
10
|
"output_fragment"=>"B324",
|
11
11
|
"output_quantity"=>1
|
12
12
|
},
|
13
|
-
"
|
13
|
+
"bottles_twenty_four_pack_3"=>{
|
14
14
|
"input_fragment"=>"B306",
|
15
15
|
"input_quantity"=>3,
|
16
16
|
"output_fragment"=>"B318",
|
17
17
|
"output_quantity"=>1
|
18
18
|
},
|
19
|
-
"
|
19
|
+
"bottles_twelve_pack"=>{
|
20
20
|
"input_fragment"=>"B306",
|
21
21
|
"input_quantity"=>2,
|
22
22
|
"output_fragment"=>"B312",
|
23
23
|
"output_quantity"=>1
|
24
|
+
},
|
25
|
+
"bottles_six_pack"=>{
|
26
|
+
"input_fragment"=>"B301",
|
27
|
+
"input_quantity"=>6,
|
28
|
+
"output_fragment"=>"B306",
|
29
|
+
"output_quantity"=>1
|
30
|
+
},
|
31
|
+
"cans_twenty_four_pack_4"=>{
|
32
|
+
"input_fragment"=>"C306",
|
33
|
+
"input_quantity"=>4,
|
34
|
+
"output_fragment"=>"C324",
|
35
|
+
"output_quantity"=>1
|
36
|
+
},
|
37
|
+
"cans_twenty_four_pack_3"=>{
|
38
|
+
"input_fragment"=>"C306",
|
39
|
+
"input_quantity"=>3,
|
40
|
+
"output_fragment"=>"C318",
|
41
|
+
"output_quantity"=>1
|
42
|
+
},
|
43
|
+
"cans_twelve_pack"=>{
|
44
|
+
"input_fragment"=>"C306",
|
45
|
+
"input_quantity"=>2,
|
46
|
+
"output_fragment"=>"C312",
|
47
|
+
"output_quantity"=>1
|
48
|
+
},
|
49
|
+
"cans_six_pack"=>{
|
50
|
+
"input_fragment"=>"C301",
|
51
|
+
"input_quantity"=>6,
|
52
|
+
"output_fragment"=>"C306",
|
53
|
+
"output_quantity"=>1
|
24
54
|
}
|
25
55
|
}
|
26
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seshbot-packing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shaun
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|