work_md 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/work_md/commands/parse.rb +8 -1
- data/lib/work_md/parser/engine.rb +13 -4
- data/lib/work_md/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a981624ebcb01d89fcb6097d5969c8a4953c548c5f0af0ccad81c2ae56af7945
|
4
|
+
data.tar.gz: 2e22f7de5b3fc2e72025337b7176cb637e09d67ff56e2bbfd2f025ea21108eea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72060087a643c751da31160dc7d24b8747655ae1f42561fd1d64b4de9172304472d22fcda8da3d10dbf11a1cab27cbed48a5406a63881113cee9cc3a64e69620
|
7
|
+
data.tar.gz: cb634d22d720628d72a13e6b7975a27934f43064ef9bcacd82eb63d67999703b8df8d00ac5adb923c6d6fa9ab21d34c811b700a6f41ec6a03c5730a4f29ec3c1
|
@@ -65,7 +65,14 @@ module WorkMd
|
|
65
65
|
end
|
66
66
|
f.puts("---\n\n")
|
67
67
|
f.puts("### #{t[:pomodoros]} (#{parser.average_pomodoros} #{t[:per_day]}):\n\n")
|
68
|
-
f.puts(parser.
|
68
|
+
f.puts(parser.pomodoros_sum)
|
69
|
+
f.puts("\n\n")
|
70
|
+
|
71
|
+
parser.pomodoros_bars.each do |pomodoro_bar|
|
72
|
+
f.puts(pomodoro_bar)
|
73
|
+
f.puts("\n\n")
|
74
|
+
end
|
75
|
+
f.puts("\n\n")
|
69
76
|
end
|
70
77
|
|
71
78
|
editor = WorkMd::Config.editor
|
@@ -75,20 +75,29 @@ module WorkMd
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def average_pomodoros
|
78
|
-
if @parsed_files.size.positive? &&
|
79
|
-
return (
|
78
|
+
if @parsed_files.size.positive? && pomodoros_sum.positive?
|
79
|
+
return (pomodoros_sum.to_f / @parsed_files.size).round(1)
|
80
80
|
end
|
81
81
|
|
82
82
|
0
|
83
83
|
end
|
84
84
|
|
85
|
-
def
|
85
|
+
def pomodoros_sum
|
86
86
|
raise IS_NOT_FROZEN_ERROR_MESSAGE unless @frozen
|
87
87
|
|
88
|
-
@
|
88
|
+
@pomodoros_sum ||=
|
89
89
|
@parsed_files.reduce(0) { |sum, f| sum + f.pomodoros || 0 }
|
90
90
|
end
|
91
91
|
|
92
|
+
def pomodoros_bars
|
93
|
+
raise IS_NOT_FROZEN_ERROR_MESSAGE unless @frozen
|
94
|
+
|
95
|
+
@pomodoros_bars ||=
|
96
|
+
@parsed_files.map do |f|
|
97
|
+
"(#{f.date}) #{(1..f.pomodoros).map { '◘' }.join }"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
92
101
|
def freeze
|
93
102
|
@frozen = true
|
94
103
|
end
|
data/lib/work_md/version.rb
CHANGED