work_md 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/work_md/commands/parse.rb +14 -5
- data/lib/work_md/config.rb +10 -3
- data/lib/work_md/parser/engine.rb +24 -2
- data/lib/work_md/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b324912bdc2b9d7db489110bdc56623c26de285
|
4
|
+
data.tar.gz: cda8ba5718f0420da7593340f67213570672c18c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f96829690a7ff140f4fafdf7545944fff09fc9459c41119b13f3c965491a2d7dab6a39b9dba64acce475596b498e7c4957e31b4349aa59a80081ee197404a425
|
7
|
+
data.tar.gz: 161880115ce5a27df36dfa390e0fd08a0597ea0efd72d1ce4ad26008a3463058d2adcb6141059e0a30ae22dac5ec02d2b372d67eb6db46d8e6a4c7f3425947f0
|
@@ -51,27 +51,36 @@ module WorkMd
|
|
51
51
|
f.puts("---\n\n")
|
52
52
|
f.puts("### #{t[:interruptions]} (#{parser.interruptions.size}):\n\n")
|
53
53
|
parser.interruptions.each do |interruption|
|
54
|
-
f.puts("- #{interruption}\n
|
54
|
+
f.puts("- #{interruption}\n")
|
55
55
|
end
|
56
56
|
f.puts("---\n\n")
|
57
57
|
f.puts("### #{t[:difficulties]} (#{parser.difficulties.size}):\n\n")
|
58
58
|
parser.difficulties.each do |difficulty|
|
59
|
-
f.puts("- #{difficulty}\n
|
59
|
+
f.puts("- #{difficulty}\n")
|
60
60
|
end
|
61
61
|
f.puts("---\n\n")
|
62
62
|
f.puts("### #{t[:observations]} (#{parser.observations.size}):\n\n")
|
63
63
|
parser.observations.each do |observation|
|
64
|
-
f.puts("- #{observation}\n
|
64
|
+
f.puts("- #{observation}\n")
|
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.pomodoros_sum)
|
68
|
+
f.puts("**#{t[:total]}: #{parser.pomodoros_sum}**")
|
69
69
|
f.puts("\n\n")
|
70
|
-
|
71
70
|
parser.pomodoros_bars.each do |pomodoro_bar|
|
72
71
|
f.puts(pomodoro_bar)
|
73
72
|
f.puts("\n\n")
|
74
73
|
end
|
74
|
+
f.puts("---\n\n")
|
75
|
+
f.puts("### #{t[:days_bars]}:\n\n")
|
76
|
+
f.puts("**#{t[:pomodoros]}: ⬛ | #{t[:meetings]}: 📅 | #{t[:interruptions]}: ⚠️ | #{t[:difficulties]}: 😓 | #{t[:observations]}: 📝 | #{t[:tasks]}: ✔️**")
|
77
|
+
|
78
|
+
f.puts("\n\n")
|
79
|
+
parser.days_bars.each do |day_bar|
|
80
|
+
f.puts(day_bar)
|
81
|
+
f.puts("\n\n")
|
82
|
+
end
|
83
|
+
|
75
84
|
f.puts("\n\n")
|
76
85
|
end
|
77
86
|
|
data/lib/work_md/config.rb
CHANGED
@@ -14,7 +14,9 @@ module WorkMd
|
|
14
14
|
difficulties: 'Dificuldades',
|
15
15
|
observations: 'Observações',
|
16
16
|
pomodoros: 'Pomodoros / Ciclos',
|
17
|
-
per_day: 'por dia'
|
17
|
+
per_day: 'por dia',
|
18
|
+
total: 'total',
|
19
|
+
days_bars: 'Resumo'
|
18
20
|
},
|
19
21
|
'en' =>
|
20
22
|
{
|
@@ -24,7 +26,10 @@ module WorkMd
|
|
24
26
|
difficulties: 'Difficulties',
|
25
27
|
observations: 'Observations',
|
26
28
|
pomodoros: 'Pomodoros / Cycles',
|
27
|
-
per_day: 'per day'
|
29
|
+
per_day: 'per day',
|
30
|
+
total: 'all',
|
31
|
+
days_bars: 'Summary'
|
32
|
+
|
28
33
|
},
|
29
34
|
'es' =>
|
30
35
|
{
|
@@ -34,7 +39,9 @@ module WorkMd
|
|
34
39
|
difficulties: 'Dificultades',
|
35
40
|
observations: 'Observaciones',
|
36
41
|
pomodoros: 'Pomodoros / Ciclos',
|
37
|
-
per_day: 'por día'
|
42
|
+
per_day: 'por día',
|
43
|
+
total: 'total',
|
44
|
+
days_bars: 'Abstracto'
|
38
45
|
}
|
39
46
|
|
40
47
|
}.freeze
|
@@ -89,15 +89,37 @@ module WorkMd
|
|
89
89
|
@parsed_files.reduce(0) { |sum, f| sum + f.pomodoros || 0 }
|
90
90
|
end
|
91
91
|
|
92
|
-
def pomodoros_bars
|
92
|
+
def pomodoros_bars(_file = nil)
|
93
93
|
raise IS_NOT_FROZEN_ERROR_MESSAGE unless @frozen
|
94
94
|
|
95
95
|
@pomodoros_bars ||=
|
96
96
|
@parsed_files.map do |f|
|
97
|
-
"(#{f.date}) #{(1..f.pomodoros).map { '
|
97
|
+
"(#{f.date}) #{(1..f.pomodoros).map { '⬛' }.join}"
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
101
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
102
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
103
|
+
def days_bars
|
104
|
+
raise IS_NOT_FROZEN_ERROR_MESSAGE unless @frozen
|
105
|
+
|
106
|
+
return @days_bars if @days_bars
|
107
|
+
|
108
|
+
@days_bars ||=
|
109
|
+
@parsed_files.map do |f|
|
110
|
+
pom = (1..f.pomodoros).map { '⬛' }.join
|
111
|
+
mee = f.meetings.map { '📅' }.join
|
112
|
+
int = f.interruptions.map { '⚠️' }.join
|
113
|
+
dif = f.difficulties.map { '😓' }.join
|
114
|
+
obs = f.observations.map { '📝' }.join
|
115
|
+
tas = f.tasks.map { '✔️' }.join
|
116
|
+
|
117
|
+
"(#{f.date}) #{pom}#{mee}#{int}#{dif}#{obs}#{tas}"
|
118
|
+
end
|
119
|
+
end
|
120
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
121
|
+
# rubocop:enable Metrics/PerceivedComplexity
|
122
|
+
|
101
123
|
def freeze
|
102
124
|
@frozen = true
|
103
125
|
end
|
data/lib/work_md/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: work_md
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrique Fernandez Teixeira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-box
|