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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c45e148fc771ca280dbf21202a25f3b6192eb0534f88692103630749de801c9
4
- data.tar.gz: 2567392e9e6389845be4809aca60ccb347848b2c7575f0c6f4c9232f4a4fe4f0
3
+ metadata.gz: 6fc52d90b2a71d349a14e77f6e313baed51003a43ce2ca615a31f0b070f0681e
4
+ data.tar.gz: fa0fa63742822ef396b45abc56b6ae7dfbc7acb72a4c896a9e6570cc9e13b1c3
5
5
  SHA512:
6
- metadata.gz: 9e22a71fee828ebfcd96e2f1ea5d4f27ad5e6a0401cc6a73f8344313006a160b10db160c6eb71b7f528df8b23233871a6c914c8ccdb48d57a88b60fb25d4e287
7
- data.tar.gz: 98411cc9c877f08309c26df629c713510514afeb740a85e741700bd8d9f96b373c5b40affe540e371dd93321aeec6c088fd65d6b953550e4b3161829aa7c0a58
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
@@ -21,31 +21,58 @@ 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
- lines.map! { |line| line.rstrip }
26
- widths = lines.map { |line| line.uncolor.length }
27
- width = widths.max
28
- top = '=' * width
29
- bottom = '-' * width
30
- output_lines = [top] + lines + [bottom]
31
- result = output_lines.join("\n")
32
- result = result.gsub(/\n[ \t]+\n/, "\n")
33
- result.gsub(/\n{2,}/, "\n")
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 format_line(entry, prefix_topic)
37
- bullet_start = '{mb}- [{x}'
38
- bullet_end = '{mb}] {x}'
39
- symbol = entry[:success] ? '{bg}✓{x}' : '{br}X{x}'
40
- parts = []
41
- parts << "#{bullet_start}#{symbol}#{bullet_end}"
42
- parts << "{bl}#{entry[:topic]}{x}: " if prefix_topic && entry[:topic] && !entry[:topic].empty?
43
- parts << "{by}#{entry[:task]}{x}"
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
- parts << " {br}(Failed: #{reason}){x}"
66
+ task_parts << " {br}(#{reason}){x}"
67
+ task_parts_plain << " (#{reason})"
47
68
  end
48
- parts.join.c
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
@@ -3,5 +3,5 @@
3
3
  # Primary module for this gem.
4
4
  module Howzit
5
5
  # Current Howzit version.
6
- VERSION = '2.1.22'
6
+ VERSION = '2.1.23'
7
7
  end
@@ -13,14 +13,14 @@ describe Howzit::RunReport do
13
13
  Howzit.multi_topic_run = false
14
14
  end
15
15
 
16
- it 'renders a bordered summary for single topic runs' do
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('- [✓] Run Git Origin')
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('- [✓] Git: Config: Run Git Origin')
32
- expect(plain).to include('- [X] Git: Clean Repo: Clean Git Repo (Failed: exit code 12)')
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: howzit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.22
4
+ version: 2.1.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra