howzit 2.1.23 → 2.1.24
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/CHANGELOG.md +12 -0
- data/lib/howzit/run_report.rb +31 -9
- data/lib/howzit/version.rb +1 -1
- data/spec/run_report_spec.rb +4 -5
- 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: 9539bebf0157985ac2d5a035923c1e7f78e942961f79a0729d20920d78c38f3a
|
|
4
|
+
data.tar.gz: 0f16b31308c0e78f7d13e140363d2f62cd8da38658c5d1a9e29721ea0e6dda5f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bb8ddc83529c66ddbcc1a71be7bdcdbf118427f08a206d7bc5a02e0b5b1a363d01f321e8865eab8f44a8b871dd8a8134e20e4d1bbd3a880cbbdc7c87f688062c
|
|
7
|
+
data.tar.gz: 3a8501d2c2c7b7a35ac82701353b8b3162eb6b6b5890c98c5b171eb8be56bdaf9fc8cd841ef8610ca95482c2fe820964aae98c0945be8eaae6e2a1eb0b3432de
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
### 2.1.24
|
|
2
|
+
|
|
3
|
+
2025-12-13 07:11
|
|
4
|
+
|
|
5
|
+
#### CHANGED
|
|
6
|
+
|
|
7
|
+
- Run summary now displays as simple list with emoji status indicators
|
|
8
|
+
|
|
9
|
+
#### IMPROVED
|
|
10
|
+
|
|
11
|
+
- Use horizontal rule (***) as separator instead of box borders
|
|
12
|
+
|
|
1
13
|
### 2.1.23
|
|
2
14
|
|
|
3
15
|
2025-12-13 06:38
|
data/lib/howzit/run_report.rb
CHANGED
|
@@ -21,16 +21,37 @@ module Howzit
|
|
|
21
21
|
def format
|
|
22
22
|
return '' if entries.empty?
|
|
23
23
|
|
|
24
|
+
lines = entries.map { |entry| format_line(entry, Howzit.multi_topic_run) }
|
|
25
|
+
output_lines = ["\n\n***\n"] + lines
|
|
26
|
+
output_lines.join("\n")
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def format_line(entry, prefix_topic)
|
|
30
|
+
symbol = entry[:success] ? '✅' : '❌'
|
|
31
|
+
parts = ["#{symbol} "]
|
|
32
|
+
parts << "{bw}#{entry[:topic]}{x}: " if prefix_topic && entry[:topic] && !entry[:topic].empty?
|
|
33
|
+
parts << "{by}#{entry[:task]}{x}"
|
|
34
|
+
unless entry[:success]
|
|
35
|
+
reason = entry[:exit_status] ? "exit code #{entry[:exit_status]}" : 'failed'
|
|
36
|
+
parts << " {br}(#{reason}){x}"
|
|
37
|
+
end
|
|
38
|
+
parts.join.c
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Table formatting methods kept for possible future use
|
|
42
|
+
def format_as_table
|
|
43
|
+
return '' if entries.empty?
|
|
44
|
+
|
|
24
45
|
rows = entries.map { |entry| format_row(entry, Howzit.multi_topic_run) }
|
|
25
46
|
|
|
26
|
-
# Status column:
|
|
27
|
-
#
|
|
28
|
-
status_width =
|
|
47
|
+
# Status column width: " :--: " = 6 chars (4 for :--: plus 1 space each side)
|
|
48
|
+
# Emoji is 2-width in terminal, so we need 2 spaces on each side to center it
|
|
49
|
+
status_width = 6
|
|
29
50
|
task_width = [4, rows.map { |r| r[:task_plain].length }.max].max
|
|
30
51
|
|
|
31
|
-
# Build the table with emoji header
|
|
32
|
-
header = "|
|
|
33
|
-
separator = "|
|
|
52
|
+
# Build the table with emoji header - center emoji in 6-char column
|
|
53
|
+
header = "| 🚥 | #{'Task'.ljust(task_width)} |"
|
|
54
|
+
separator = "| :--: | #{':' + '-' * (task_width - 1)} |"
|
|
34
55
|
|
|
35
56
|
table_lines = [header, separator]
|
|
36
57
|
rows.each do |row|
|
|
@@ -43,12 +64,13 @@ module Howzit
|
|
|
43
64
|
def table_row_colored(status, task, task_plain, status_width, task_width)
|
|
44
65
|
task_padding = task_width - task_plain.length
|
|
45
66
|
|
|
46
|
-
"|
|
|
67
|
+
"| #{status} | #{task}#{' ' * task_padding} |"
|
|
47
68
|
end
|
|
48
69
|
|
|
49
70
|
def format_row(entry, prefix_topic)
|
|
71
|
+
# Use plain emoji without color codes - the emoji itself provides visual meaning
|
|
72
|
+
# and complex ANSI codes interfere with mdless table rendering
|
|
50
73
|
symbol = entry[:success] ? '✅' : '❌'
|
|
51
|
-
symbol_colored = entry[:success] ? '{bg}✅{x}'.c : '{br}❌{x}'.c
|
|
52
74
|
|
|
53
75
|
task_parts = []
|
|
54
76
|
task_parts_plain = []
|
|
@@ -68,7 +90,7 @@ module Howzit
|
|
|
68
90
|
end
|
|
69
91
|
|
|
70
92
|
{
|
|
71
|
-
status:
|
|
93
|
+
status: symbol,
|
|
72
94
|
status_plain: symbol,
|
|
73
95
|
task: task_parts.join.c,
|
|
74
96
|
task_plain: task_parts_plain.join
|
data/lib/howzit/version.rb
CHANGED
data/spec/run_report_spec.rb
CHANGED
|
@@ -13,11 +13,10 @@ describe Howzit::RunReport do
|
|
|
13
13
|
Howzit.multi_topic_run = false
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
it 'renders a
|
|
16
|
+
it 'renders a simple list for single topic runs' do
|
|
17
17
|
Howzit::RunReport.log({ topic: 'Git: Config', task: 'Run Git Origin', success: true, exit_status: 0 })
|
|
18
18
|
plain = Howzit::RunReport.format.uncolor
|
|
19
|
-
expect(plain).to include('
|
|
20
|
-
expect(plain).to include('| Task')
|
|
19
|
+
expect(plain).to include('***')
|
|
21
20
|
expect(plain).to include('✅')
|
|
22
21
|
expect(plain).to include('Run Git Origin')
|
|
23
22
|
expect(plain).not_to include('Git: Config:')
|
|
@@ -35,10 +34,10 @@ describe Howzit::RunReport do
|
|
|
35
34
|
expect(plain).to include('exit code 12')
|
|
36
35
|
end
|
|
37
36
|
|
|
38
|
-
it 'formats as a proper markdown table with aligned columns' do
|
|
37
|
+
it 'formats as a proper markdown table with aligned columns using format_as_table' do
|
|
39
38
|
Howzit::RunReport.log({ topic: 'Test', task: 'Short', success: true, exit_status: 0 })
|
|
40
39
|
Howzit::RunReport.log({ topic: 'Test', task: 'A much longer task name', success: true, exit_status: 0 })
|
|
41
|
-
plain = Howzit::RunReport.
|
|
40
|
+
plain = Howzit::RunReport.format_as_table.uncolor
|
|
42
41
|
lines = plain.split("\n")
|
|
43
42
|
# All lines should start and end with pipe
|
|
44
43
|
lines.each do |line|
|