toji 2.4.1 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 913d49d53fa4cd879ce28a4fe4961edccdc8217c1357712666d1a803c16e89a6
4
- data.tar.gz: 51eb32477e501ed38527a8cb55ac752d037cb31a10f2eddc706b4dafe8c26d3a
3
+ metadata.gz: 3b3aca220f9d2ddc9b8278354a088af1c73609c3912388124db4d965db1b3e82
4
+ data.tar.gz: 91c7e9e3f6705f45bc7206bbbb0b98ad077a1ccc9ce41736a245eeccfdcd15da
5
5
  SHA512:
6
- metadata.gz: 7332c31932db265a7d38e21336c2ad0b7993752de274661874485db5da66c4c03a32cd6b26001b6c33e91c574a5c85f685f97cfbf552f7f59f8d8b40d2fa5bd8
7
- data.tar.gz: bbaae3eb542de0b7458562126ef9b27ccc8805a588327ddbee1150ab572797945b109bc5ed0d4b39ac5384f5f275c4820d9dd5d00b93354f5038f87fcb9607b4
6
+ metadata.gz: f5004d92b8c087d31d613e6705246c251160f6580f717c526b85a02d6cfdc0569c92d282f31b0fc0d9ba19a4fab963374cc0de876bbdf9ba9c6004add6009aec
7
+ data.tar.gz: 246c143b4ba5c2e9c1b6e2b4f310ba42064ce0faf307b1f451aac60f7b554d1d4da9a9bd866164008b7188deb5d089d92f684978c3e92b8c7a4f819cee0c9d47
@@ -7,7 +7,7 @@ koji = Example::Brew::Koji.load_yaml_file(File.dirname(__FILE__)+"/koji_making.y
7
7
  table = Terminal::Table.new do |t|
8
8
  t << ["作業", "日数", "品温(度)", "操作室温", "乾湿差(度)", "経過時間", "日時"]
9
9
  t << :separator
10
- koji.each {|s|
10
+ koji.wrapped_states.each {|s|
11
11
  temp = s.temps.map(&:to_s).join(" / ")
12
12
  t << [s.mark, s.day_label, temp, s.room_temp, s.room_psychrometry, s.elapsed_time, s.display_time]
13
13
  }
@@ -8,7 +8,7 @@ moromi = Example::Brew::Moromi.load_yaml_file(File.dirname(__FILE__)+"/moromi.ya
8
8
  table = Terminal::Table.new do |t|
9
9
  t << ["作業", "日数", "品温(度)", "操作室温", "ボーメ及び日本酒度", "アルコール度数", "BMD", "アルコール期待値(16.5 +3)", "経過時間", "日時"]
10
10
  t << :separator
11
- moromi.each {|s|
11
+ moromi.wrapped_states.each {|s|
12
12
  temp = s.temps.map(&:to_s).join(" / ")
13
13
  t << [s.mark, s.day_label, temp, s.room_temp, s.display_baume, s.alcohol, s.bmd&.round(2), s.expected_alcohol(16.5, +3, 1.5)&.round(2), s.elapsed_time, s.display_time]
14
14
  }
@@ -7,7 +7,7 @@ shubo = Example::Brew::Shubo.load_yaml_file(File.dirname(__FILE__)+"/shubo.yaml"
7
7
  table = Terminal::Table.new do |t|
8
8
  t << ["作業", "日数", "品温(度)", "ボーメ", "酸度", "経過時間", "日時"]
9
9
  t << :separator
10
- shubo.each {|s|
10
+ shubo.wrapped_states.each {|s|
11
11
  temp = s.temps.map(&:to_s).join(" / ")
12
12
  t << [s.mark, s.day_label, temp, s.baume, s.acid, s.elapsed_time, s.display_time]
13
13
  }
@@ -1,8 +1,6 @@
1
1
  module Toji
2
2
  module Brew
3
3
  module Base
4
- include Enumerable
5
-
6
4
  REQUIRED_KEYS = [
7
5
  :time,
8
6
  :elapsed_time,
@@ -45,10 +43,6 @@ module Toji
45
43
  nil
46
44
  end
47
45
 
48
- def each(&block)
49
- wrapped_states.each(&block)
50
- end
51
-
52
46
  def has_keys
53
47
  result = REQUIRED_KEYS.dup
54
48
 
@@ -24,7 +24,7 @@ module Toji
24
24
  result = []
25
25
 
26
26
  @actuals.each {|moromi, name|
27
- states = moromi.select{|s| s.alcohol && s.baume}
27
+ states = moromi.wrapped_states.select{|s| s.alcohol && s.baume}
28
28
 
29
29
  xs = states.map(&:alcohol)
30
30
  ys = states.map(&:baume)
@@ -47,13 +47,13 @@ module Toji
47
47
 
48
48
  def min_baume
49
49
  @actuals.map {|moromi, name|
50
- moromi.map(&:baume).compact.min
50
+ moromi.wrapped_states.map(&:baume).compact.min
51
51
  }.compact.min || 0
52
52
  end
53
53
 
54
54
  def max_baume
55
55
  @actuals.map {|moromi, name|
56
- moromi.map(&:baume).compact.max
56
+ moromi.wrapped_states.map(&:baume).compact.max
57
57
  }.compact.max || 0
58
58
  end
59
59
 
@@ -56,13 +56,13 @@ module Toji
56
56
  xs = []
57
57
  ys = []
58
58
  text = []
59
- @brew.each {|r|
60
- val = r.send(key)
59
+ @brew.wrapped_states.each {|s|
60
+ val = s.send(key)
61
61
  if val
62
62
  [val].flatten.each_with_index {|v,i|
63
- xs << r.elapsed_time_with_offset + i
63
+ xs << s.elapsed_time_with_offset + i
64
64
  ys << v
65
- text << r.display_time
65
+ text << s.display_time
66
66
  }
67
67
  end
68
68
  }
@@ -102,7 +102,7 @@ module Toji
102
102
  def annotations
103
103
  return [] if !@enable_annotations
104
104
 
105
- @brew.select{|s| s.mark}.map {|s|
105
+ @brew.wrapped_states.select{|s| s.mark}.map {|s|
106
106
  {
107
107
  x: s.elapsed_time_with_offset,
108
108
  y: s.temps.first || 0,
@@ -131,7 +131,7 @@ module Toji
131
131
  end
132
132
 
133
133
  rows = []
134
- @brew.each {|state|
134
+ @brew.wrapped_states.each {|state|
135
135
  rows << keys.map {|k|
136
136
  v = state&.send(k)
137
137
  if Array===v
@@ -1,3 +1,3 @@
1
1
  module Toji
2
- VERSION = "2.4.1"
2
+ VERSION = "2.5.0"
3
3
  end
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.1
4
+ version: 2.5.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-23 00:00:00.000000000 Z
11
+ date: 2020-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport