toji 2.3.1 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/example/example_core.rb +0 -39
- data/example/moromi.rb +1 -1
- data/example/recipe.rb +17 -10
- data/lib/toji/brew/wrapped_state.rb +0 -27
- data/lib/toji/calendar.rb +1 -1
- data/lib/toji/product/event.rb +0 -10
- data/lib/toji/recipe/step.rb +4 -2
- data/lib/toji/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: fb5e686c2915d1ed44e16fbe3ce58eb232c7ae5d0710c7c8fbc5c924cc4524f7
|
4
|
+
data.tar.gz: ca2702441c730f3586be75b300aa1ec07720a88c02f8be76cf88680000ddc2c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0b8df9e1c731727b2ef95aed906e04dbc90f584f57d640d1cf509e4ffd4688a73e94e11fd8b24b4b014dba47da6a8f717babe534d2bdb275e171326cb937e13
|
7
|
+
data.tar.gz: 2dc73ccb8bf508bcc7bf61e04fd750b001f58466d127c5ac828664bced4ceb009f2bbc85c777dbf7d78a4e34d20d8d4e8961358dc136e132bce6729cc8a3404e
|
data/example/example_core.rb
CHANGED
@@ -69,20 +69,6 @@ module Example
|
|
69
69
|
class Step
|
70
70
|
include Toji::Recipe::Step
|
71
71
|
|
72
|
-
def to_h
|
73
|
-
{
|
74
|
-
name: name,
|
75
|
-
kake: kake,
|
76
|
-
koji: koji,
|
77
|
-
water: water,
|
78
|
-
lactic_acid: lactic_acid,
|
79
|
-
alcohol: alcohol,
|
80
|
-
yeast: yeast,
|
81
|
-
koji_interval_days: koji_interval_days,
|
82
|
-
kake_interval_days: kake_interval_days,
|
83
|
-
}
|
84
|
-
end
|
85
|
-
|
86
72
|
def self.create(name:, kake: 0, koji: 0, water: 0, lactic_acid: 0, alcohol: 0, yeast: 0, koji_interval_days: 0, kake_interval_days: 0)
|
87
73
|
new.tap {|o|
|
88
74
|
o.name = name
|
@@ -106,16 +92,6 @@ module Example
|
|
106
92
|
@steps = []
|
107
93
|
end
|
108
94
|
|
109
|
-
#def to_h
|
110
|
-
# {
|
111
|
-
# steps: steps.map(&:to_h),
|
112
|
-
# cumulative_rice_totals: cumulative_rice_totals,
|
113
|
-
# cumulative_shubo_rates: cumulative_shubo_rates,
|
114
|
-
# shubo_rate: shubo_rate,
|
115
|
-
# rice_rates: rice_rates,
|
116
|
-
# }
|
117
|
-
#end
|
118
|
-
|
119
95
|
def self.create(steps)
|
120
96
|
new.tap {|o|
|
121
97
|
o.steps = steps
|
@@ -282,21 +258,6 @@ module Example
|
|
282
258
|
@color = color
|
283
259
|
end
|
284
260
|
|
285
|
-
def to_h
|
286
|
-
{
|
287
|
-
id: id,
|
288
|
-
name: name,
|
289
|
-
description: @description,
|
290
|
-
recipe: @recipe.table_data,
|
291
|
-
start_date: @start_date,
|
292
|
-
koji_dates: koji_dates,
|
293
|
-
kake_dates: kake_dates,
|
294
|
-
events: events.map(&:to_h),
|
295
|
-
events_group: events_group,
|
296
|
-
color: @color,
|
297
|
-
}
|
298
|
-
end
|
299
|
-
|
300
261
|
def self.create(args)
|
301
262
|
if self===args
|
302
263
|
args
|
data/example/moromi.rb
CHANGED
@@ -3,7 +3,7 @@ require_relative 'example_core'
|
|
3
3
|
require 'terminal-table'
|
4
4
|
|
5
5
|
|
6
|
-
moromi =
|
6
|
+
moromi = Example::Brew::Moromi.load_yaml_file(File.dirname(__FILE__)+"/moromi.yaml")
|
7
7
|
|
8
8
|
table = Terminal::Table.new do |t|
|
9
9
|
t << ["作業", "日数", "品温(度)", "操作室温", "ボーメ及び日本酒度", "アルコール度数", "BMD", "アルコール期待値(16.5 +3)", "経過時間", "日時"]
|
data/example/recipe.rb
CHANGED
@@ -2,30 +2,37 @@ require 'toji'
|
|
2
2
|
require_relative 'example_core'
|
3
3
|
require 'terminal-table'
|
4
4
|
|
5
|
-
recipe = Example::Recipe::TEMPLATES[:sokujo_nada].scale(900)
|
5
|
+
recipe = Example::Recipe::TEMPLATES[:sokujo_nada].scale(900).round(2)
|
6
6
|
step_names = recipe.steps.map(&:name)
|
7
7
|
|
8
8
|
table = Terminal::Table.new do |t|
|
9
9
|
t << [""] + step_names
|
10
10
|
t << :separator
|
11
11
|
t << ["[原料]"]
|
12
|
-
t << ["酵母(g or 本)"] + recipe.steps.map(&:yeast)
|
13
|
-
t << ["乳酸(ml)"] + recipe.steps.map(&:lactic_acid)
|
14
|
-
t << ["掛米(g)"] + recipe.steps.map(&:kake)
|
15
|
-
t << ["麹米(g)"] + recipe.steps.map(&:koji)
|
16
|
-
t << ["汲水(ml)"] + recipe.steps.map(&:water)
|
17
|
-
t << ["醸造アルコール(ml)"] + recipe.steps.map(&:alcohol)
|
12
|
+
t << ["酵母(g or 本)"] + recipe.steps.map(&:yeast)
|
13
|
+
t << ["乳酸(ml)"] + recipe.steps.map(&:lactic_acid)
|
14
|
+
t << ["掛米(g)"] + recipe.steps.map(&:kake)
|
15
|
+
t << ["麹米(g)"] + recipe.steps.map(&:koji)
|
16
|
+
t << ["汲水(ml)"] + recipe.steps.map(&:water)
|
17
|
+
t << ["醸造アルコール(ml)"] + recipe.steps.map(&:alcohol)
|
18
18
|
t << :separator
|
19
19
|
t << ["[合計]"]
|
20
|
-
t << ["総米(g)"] + recipe.steps.map(&:rice_total)
|
20
|
+
t << ["総米(g)"] + recipe.steps.map(&:rice_total)
|
21
21
|
t << ["麹歩合(%)"] + recipe.steps.map{|s| s.koji_rate * 100}.map{|v| v&.round(2)}
|
22
22
|
t << ["汲水歩合(%)"] + recipe.steps.map{|s| s.water_rate * 100}.map{|v| v&.round(2)}
|
23
23
|
t << :separator
|
24
24
|
t << ["[累計]"]
|
25
|
-
t << ["総米(g)"] + recipe.cumulative_rice_totals
|
25
|
+
t << ["総米(g)"] + recipe.cumulative_rice_totals
|
26
26
|
t << ["白米比率"] + recipe.rice_rates.map{|v| v&.round(2)}
|
27
27
|
t << ["酒母歩合(%)"] + recipe.cumulative_shubo_rates.map{|s| s * 100}.map{|v| v&.round(2)}
|
28
|
-
t << ["タンク内容量(ml)"] + recipe.
|
28
|
+
t << ["タンク内容量(ml)"] + recipe.steps.map {|s|
|
29
|
+
kake = Toji::Ingredient::Kake::Expected.create(s.kake)
|
30
|
+
koji = Toji::Ingredient::Koji::Expected.create(s.koji)
|
31
|
+
s.yeast.to_f + s.lactic_acid.to_f + kake.steamed.to_f + koji.dekoji.to_f + s.water.to_f + s.alcohol.to_f
|
32
|
+
}.then {|a|
|
33
|
+
sum = 0.0
|
34
|
+
a.map {|x| sum += x}
|
35
|
+
}.map{|v| v&.round(2)}
|
29
36
|
end
|
30
37
|
puts table
|
31
38
|
puts
|
@@ -104,33 +104,6 @@ module Toji
|
|
104
104
|
target_alc - (_baume - target_nihonshudo * -0.1) * coef
|
105
105
|
end
|
106
106
|
end
|
107
|
-
|
108
|
-
def to_h
|
109
|
-
{
|
110
|
-
elapsed_time: elapsed_time,
|
111
|
-
time: time,
|
112
|
-
mark: mark,
|
113
|
-
temps: temps,
|
114
|
-
preset_temp: preset_temp,
|
115
|
-
room_temp: room_temp,
|
116
|
-
room_psychrometry: room_psychrometry,
|
117
|
-
acid: acid,
|
118
|
-
amino_acid: amino_acid,
|
119
|
-
alcohol: alcohol,
|
120
|
-
warmings: warmings,
|
121
|
-
note: note,
|
122
|
-
|
123
|
-
day: day,
|
124
|
-
day_label: day_label,
|
125
|
-
elapsed_time_with_offset: elapsed_time_with_offset,
|
126
|
-
baume: baume,
|
127
|
-
nihonshudo: nihonshudo,
|
128
|
-
display_baume: display_baume,
|
129
|
-
display_time: display_time,
|
130
|
-
moromi_day: moromi_day,
|
131
|
-
bmd: bmd,
|
132
|
-
}
|
133
|
-
end
|
134
107
|
end
|
135
108
|
end
|
136
109
|
end
|
data/lib/toji/calendar.rb
CHANGED
data/lib/toji/product/event.rb
CHANGED
data/lib/toji/recipe/step.rb
CHANGED
@@ -22,7 +22,8 @@ module Toji
|
|
22
22
|
# なお、留め仕込みまでの麹歩合が20%を下回ると蒸米の溶解糖化に影響が出るので注意がいる
|
23
23
|
# 出典: 酒造教本 P95
|
24
24
|
def koji_rate
|
25
|
-
koji.to_f / rice_total
|
25
|
+
val = koji.to_f / rice_total
|
26
|
+
val.nan? ? 0.0 : val
|
26
27
|
end
|
27
28
|
|
28
29
|
# 汲水歩合
|
@@ -35,7 +36,8 @@ module Toji
|
|
35
36
|
#
|
36
37
|
# 出典: 酒造教本 P96
|
37
38
|
def water_rate
|
38
|
-
water.to_f / rice_total
|
39
|
+
val = water.to_f / rice_total
|
40
|
+
val.nan? ? 0.0 : val
|
39
41
|
end
|
40
42
|
|
41
43
|
def round(ndigit=0, mini_ndigit=nil, half: :up)
|
data/lib/toji/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoshida Tetsuya
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|