howzit 2.1.22 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c45e148fc771ca280dbf21202a25f3b6192eb0534f88692103630749de801c9
4
- data.tar.gz: 2567392e9e6389845be4809aca60ccb347848b2c7575f0c6f4c9232f4a4fe4f0
3
+ metadata.gz: 9539bebf0157985ac2d5a035923c1e7f78e942961f79a0729d20920d78c38f3a
4
+ data.tar.gz: 0f16b31308c0e78f7d13e140363d2f62cd8da38658c5d1a9e29721ea0e6dda5f
5
5
  SHA512:
6
- metadata.gz: 9e22a71fee828ebfcd96e2f1ea5d4f27ad5e6a0401cc6a73f8344313006a160b10db160c6eb71b7f528df8b23233871a6c914c8ccdb48d57a88b60fb25d4e287
7
- data.tar.gz: 98411cc9c877f08309c26df629c713510514afeb740a85e741700bd8d9f96b373c5b40affe540e371dd93321aeec6c088fd65d6b953550e4b3161829aa7c0a58
6
+ metadata.gz: bb8ddc83529c66ddbcc1a71be7bdcdbf118427f08a206d7bc5a02e0b5b1a363d01f321e8865eab8f44a8b871dd8a8134e20e4d1bbd3a880cbbdc7c87f688062c
7
+ data.tar.gz: 3a8501d2c2c7b7a35ac82701353b8b3162eb6b6b5890c98c5b171eb8be56bdaf9fc8cd841ef8610ca95482c2fe820964aae98c0945be8eaae6e2a1eb0b3432de
data/CHANGELOG.md CHANGED
@@ -1,3 +1,32 @@
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
+
13
+ ### 2.1.23
14
+
15
+ 2025-12-13 06:38
16
+
17
+ #### CHANGED
18
+
19
+ - Output format changed from bordered text to markdown table
20
+
21
+ #### NEW
22
+
23
+ - Added emoji header () to run report table
24
+
25
+ #### IMPROVED
26
+
27
+ - Status indicators now use emoji (/) instead of text symbols
28
+ - Failure messages now show "(exit code X)" instead of "Failed: exit code X"
29
+
1
30
  ### 2.1.22
2
31
 
3
32
  2025-12-13 06:14
@@ -22,30 +22,79 @@ module Howzit
22
22
  return '' if entries.empty?
23
23
 
24
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")
25
+ output_lines = ["\n\n***\n"] + lines
26
+ output_lines.join("\n")
34
27
  end
35
28
 
36
29
  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?
30
+ symbol = entry[:success] ? '✅' : '❌'
31
+ parts = ["#{symbol} "]
32
+ parts << "{bw}#{entry[:topic]}{x}: " if prefix_topic && entry[:topic] && !entry[:topic].empty?
43
33
  parts << "{by}#{entry[:task]}{x}"
44
34
  unless entry[:success]
45
35
  reason = entry[:exit_status] ? "exit code #{entry[:exit_status]}" : 'failed'
46
- parts << " {br}(Failed: #{reason}){x}"
36
+ parts << " {br}(#{reason}){x}"
47
37
  end
48
38
  parts.join.c
49
39
  end
40
+
41
+ # Table formatting methods kept for possible future use
42
+ def format_as_table
43
+ return '' if entries.empty?
44
+
45
+ rows = entries.map { |entry| format_row(entry, Howzit.multi_topic_run) }
46
+
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
50
+ task_width = [4, rows.map { |r| r[:task_plain].length }.max].max
51
+
52
+ # Build the table with emoji header - center emoji in 6-char column
53
+ header = "| 🚥 | #{'Task'.ljust(task_width)} |"
54
+ separator = "| :--: | #{':' + '-' * (task_width - 1)} |"
55
+
56
+ table_lines = [header, separator]
57
+ rows.each do |row|
58
+ table_lines << table_row_colored(row[:status], row[:task], row[:task_plain], status_width, task_width)
59
+ end
60
+
61
+ table_lines.join("\n")
62
+ end
63
+
64
+ def table_row_colored(status, task, task_plain, status_width, task_width)
65
+ task_padding = task_width - task_plain.length
66
+
67
+ "| #{status} | #{task}#{' ' * task_padding} |"
68
+ end
69
+
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
73
+ symbol = entry[:success] ? '✅' : '❌'
74
+
75
+ task_parts = []
76
+ task_parts_plain = []
77
+
78
+ if prefix_topic && entry[:topic] && !entry[:topic].empty?
79
+ task_parts << "{bw}#{entry[:topic]}{x}: "
80
+ task_parts_plain << "#{entry[:topic]}: "
81
+ end
82
+
83
+ task_parts << "{by}#{entry[:task]}{x}"
84
+ task_parts_plain << entry[:task]
85
+
86
+ unless entry[:success]
87
+ reason = entry[:exit_status] ? "exit code #{entry[:exit_status]}" : 'failed'
88
+ task_parts << " {br}(#{reason}){x}"
89
+ task_parts_plain << " (#{reason})"
90
+ end
91
+
92
+ {
93
+ status: symbol,
94
+ status_plain: symbol,
95
+ task: task_parts.join.c,
96
+ task_plain: task_parts_plain.join
97
+ }
98
+ end
50
99
  end
51
100
  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.24'
7
7
  end
@@ -13,14 +13,13 @@ 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 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('- [✓] Run Git Origin')
19
+ expect(plain).to include('***')
20
+ expect(plain).to include('✅')
21
+ expect(plain).to include('Run Git Origin')
20
22
  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
23
  end
25
24
 
26
25
  it 'prefixes topic titles and shows failures when multiple topics run' do
@@ -28,8 +27,25 @@ describe Howzit::RunReport do
28
27
  Howzit::RunReport.log({ topic: 'Git: Config', task: 'Run Git Origin', success: true, exit_status: 0 })
29
28
  Howzit::RunReport.log({ topic: 'Git: Clean Repo', task: 'Clean Git Repo', success: false, exit_status: 12 })
30
29
  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)')
30
+ expect(plain).to include('')
31
+ expect(plain).to include('Git: Config: Run Git Origin')
32
+ expect(plain).to include('❌')
33
+ expect(plain).to include('Git: Clean Repo: Clean Git Repo')
34
+ expect(plain).to include('exit code 12')
35
+ end
36
+
37
+ it 'formats as a proper markdown table with aligned columns using format_as_table' do
38
+ Howzit::RunReport.log({ topic: 'Test', task: 'Short', success: true, exit_status: 0 })
39
+ Howzit::RunReport.log({ topic: 'Test', task: 'A much longer task name', success: true, exit_status: 0 })
40
+ plain = Howzit::RunReport.format_as_table.uncolor
41
+ lines = plain.split("\n")
42
+ # All lines should start and end with pipe
43
+ lines.each do |line|
44
+ expect(line).to start_with('|')
45
+ expect(line).to end_with('|')
46
+ end
47
+ # Second line should be separator
48
+ expect(lines[1]).to match(/^\|[\s:-]+\|[\s:-]+\|$/)
33
49
  end
34
50
  end
35
51
 
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.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra