howzit 2.1.22 → 2.1.23
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 +17 -0
- data/lib/howzit/run_report.rb +47 -20
- data/lib/howzit/version.rb +1 -1
- data/spec/run_report_spec.rb +24 -7
- 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: 6fc52d90b2a71d349a14e77f6e313baed51003a43ce2ca615a31f0b070f0681e
|
|
4
|
+
data.tar.gz: fa0fa63742822ef396b45abc56b6ae7dfbc7acb72a4c896a9e6570cc9e13b1c3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d7e01306310519e4454960b5246740572a7731aa4946fa3d4d455ee3f9a3c30b1415eabdf91a58dca48d0123a0b78332754d7e4d86bd112692574b517a328072
|
|
7
|
+
data.tar.gz: 99ab41b0612da8c5a0e456c5a5006e9dc6cf5e679726b461cba170622d3aa615fe6a259c50dec67b2b4c7151afff200af8d8cf2c3dfe1d775b0dea83e3975fba
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
### 2.1.23
|
|
2
|
+
|
|
3
|
+
2025-12-13 06:38
|
|
4
|
+
|
|
5
|
+
#### CHANGED
|
|
6
|
+
|
|
7
|
+
- Output format changed from bordered text to markdown table
|
|
8
|
+
|
|
9
|
+
#### NEW
|
|
10
|
+
|
|
11
|
+
- Added emoji header () to run report table
|
|
12
|
+
|
|
13
|
+
#### IMPROVED
|
|
14
|
+
|
|
15
|
+
- Status indicators now use emoji (/) instead of text symbols
|
|
16
|
+
- Failure messages now show "(exit code X)" instead of "Failed: exit code X"
|
|
17
|
+
|
|
1
18
|
### 2.1.22
|
|
2
19
|
|
|
3
20
|
2025-12-13 06:14
|
data/lib/howzit/run_report.rb
CHANGED
|
@@ -21,31 +21,58 @@ module Howzit
|
|
|
21
21
|
def format
|
|
22
22
|
return '' if entries.empty?
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
width
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
rows = entries.map { |entry| format_row(entry, Howzit.multi_topic_run) }
|
|
25
|
+
|
|
26
|
+
# Status column: emoji + 1 space on each side = 3 chars wide visually
|
|
27
|
+
# But emojis are 2-width in terminal, so we need width of 4 for " ✅ "
|
|
28
|
+
status_width = 4
|
|
29
|
+
task_width = [4, rows.map { |r| r[:task_plain].length }.max].max
|
|
30
|
+
|
|
31
|
+
# Build the table with emoji header
|
|
32
|
+
header = "| 🚥 | #{'Task'.ljust(task_width)} |"
|
|
33
|
+
separator = "| #{':' + '-' * 2 + ':'} | #{':' + '-' * (task_width - 2)} |"
|
|
34
|
+
|
|
35
|
+
table_lines = [header, separator]
|
|
36
|
+
rows.each do |row|
|
|
37
|
+
table_lines << table_row_colored(row[:status], row[:task], row[:task_plain], status_width, task_width)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
table_lines.join("\n")
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def table_row_colored(status, task, task_plain, status_width, task_width)
|
|
44
|
+
task_padding = task_width - task_plain.length
|
|
45
|
+
|
|
46
|
+
"| #{status} | #{task}#{' ' * task_padding} |"
|
|
34
47
|
end
|
|
35
48
|
|
|
36
|
-
def
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
def format_row(entry, prefix_topic)
|
|
50
|
+
symbol = entry[:success] ? '✅' : '❌'
|
|
51
|
+
symbol_colored = entry[:success] ? '{bg}✅{x}'.c : '{br}❌{x}'.c
|
|
52
|
+
|
|
53
|
+
task_parts = []
|
|
54
|
+
task_parts_plain = []
|
|
55
|
+
|
|
56
|
+
if prefix_topic && entry[:topic] && !entry[:topic].empty?
|
|
57
|
+
task_parts << "{bw}#{entry[:topic]}{x}: "
|
|
58
|
+
task_parts_plain << "#{entry[:topic]}: "
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
task_parts << "{by}#{entry[:task]}{x}"
|
|
62
|
+
task_parts_plain << entry[:task]
|
|
63
|
+
|
|
44
64
|
unless entry[:success]
|
|
45
65
|
reason = entry[:exit_status] ? "exit code #{entry[:exit_status]}" : 'failed'
|
|
46
|
-
|
|
66
|
+
task_parts << " {br}(#{reason}){x}"
|
|
67
|
+
task_parts_plain << " (#{reason})"
|
|
47
68
|
end
|
|
48
|
-
|
|
69
|
+
|
|
70
|
+
{
|
|
71
|
+
status: symbol_colored,
|
|
72
|
+
status_plain: symbol,
|
|
73
|
+
task: task_parts.join.c,
|
|
74
|
+
task_plain: task_parts_plain.join
|
|
75
|
+
}
|
|
49
76
|
end
|
|
50
77
|
end
|
|
51
78
|
end
|
data/lib/howzit/version.rb
CHANGED
data/spec/run_report_spec.rb
CHANGED
|
@@ -13,14 +13,14 @@ describe Howzit::RunReport do
|
|
|
13
13
|
Howzit.multi_topic_run = false
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
it 'renders a
|
|
16
|
+
it 'renders a markdown table 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('
|
|
19
|
+
expect(plain).to include('| 🚥 |')
|
|
20
|
+
expect(plain).to include('| Task')
|
|
21
|
+
expect(plain).to include('✅')
|
|
22
|
+
expect(plain).to include('Run Git Origin')
|
|
20
23
|
expect(plain).not_to include('Git: Config:')
|
|
21
|
-
top, line, bottom = plain.split("\n")
|
|
22
|
-
expect(top).to eq('=' * line.length)
|
|
23
|
-
expect(bottom).to eq('-' * line.length)
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
it 'prefixes topic titles and shows failures when multiple topics run' do
|
|
@@ -28,8 +28,25 @@ describe Howzit::RunReport do
|
|
|
28
28
|
Howzit::RunReport.log({ topic: 'Git: Config', task: 'Run Git Origin', success: true, exit_status: 0 })
|
|
29
29
|
Howzit::RunReport.log({ topic: 'Git: Clean Repo', task: 'Clean Git Repo', success: false, exit_status: 12 })
|
|
30
30
|
plain = Howzit::RunReport.format.uncolor
|
|
31
|
-
expect(plain).to include('
|
|
32
|
-
expect(plain).to include('
|
|
31
|
+
expect(plain).to include('✅')
|
|
32
|
+
expect(plain).to include('Git: Config: Run Git Origin')
|
|
33
|
+
expect(plain).to include('❌')
|
|
34
|
+
expect(plain).to include('Git: Clean Repo: Clean Git Repo')
|
|
35
|
+
expect(plain).to include('exit code 12')
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
it 'formats as a proper markdown table with aligned columns' do
|
|
39
|
+
Howzit::RunReport.log({ topic: 'Test', task: 'Short', success: true, exit_status: 0 })
|
|
40
|
+
Howzit::RunReport.log({ topic: 'Test', task: 'A much longer task name', success: true, exit_status: 0 })
|
|
41
|
+
plain = Howzit::RunReport.format.uncolor
|
|
42
|
+
lines = plain.split("\n")
|
|
43
|
+
# All lines should start and end with pipe
|
|
44
|
+
lines.each do |line|
|
|
45
|
+
expect(line).to start_with('|')
|
|
46
|
+
expect(line).to end_with('|')
|
|
47
|
+
end
|
|
48
|
+
# Second line should be separator
|
|
49
|
+
expect(lines[1]).to match(/^\|[\s:-]+\|[\s:-]+\|$/)
|
|
33
50
|
end
|
|
34
51
|
end
|
|
35
52
|
|