railbow 0.6.0 โ†’ 0.6.2

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: 61c0c3ed9ad2e0c2218e9f2b5e69f6eecec3253a82722408649e91b2822873be
4
- data.tar.gz: 2179f41a4dfd77f4630940ce0280130a612d75202faede974611c27b0729058d
3
+ metadata.gz: de5537d849ecc612b80236db0a17543d6fad2ea18aeb0c3872dd48ced2dfdf5f
4
+ data.tar.gz: a6833af7828722eee5153a48bcf96f7008760948324337c46af90ecee3a86520
5
5
  SHA512:
6
- metadata.gz: c777b8cf30ac567ba71c6cc16f16e7f6bbfdc604d8fa1b161cafc17879cea825b446e02f72e43fa9f383d03752c2506a6653c951928302b6d290b689f5a4fa39
7
- data.tar.gz: 87b8b0d21c779637d0f6c9c20271bec519677feda8d790cadd9644a33413d352550b6a883a96da0774bb7009f9f2667b55d9e23a670800684bbf824b58607b78
6
+ metadata.gz: e9d7ae02de3f895c3300dbcd547ad52ddb0309a53a999b2ad52694bc3d46430d90a0518451721df72868fed730f9b60e1c66ffa0e616d01207d2908b560950d0
7
+ data.tar.gz: 9fd9c71099808af2b42b186f13ff31112e9195e39af6b94f9650f649e6c7e1b7346d06133992229f9d354a24b955dd2c98ed9b4c77c85a1d727c31c7800bbdb6
data/CHANGELOG.md CHANGED
@@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.6.2] - 2026-09-21
9
+
10
+ ### Changed
11
+
12
+ - Demo fixtures, README examples and spec data now use the PawShop sample
13
+ project throughout.
14
+
15
+ ## [0.6.1] - 2026-08-10
16
+
17
+ ### Fixed
18
+
19
+ - On a narrow terminal, a migration's branch and landing badges no longer
20
+ vanish from the `db:migrate:status` name column, leaving a stray `...`
21
+ hanging in the padding where they used to sit. The badges are padded flush
22
+ against the right edge of the column, which is exactly where the width
23
+ budget was cutting; the name now gives up the space instead and the badges
24
+ stay put. When a badge is so wide that keeping it would leave under 12
25
+ columns for the name, it is dropped outright rather than squeezing the name
26
+ down to nothing.
27
+
8
28
  ## [0.6.0] - 2026-08-03
9
29
 
10
30
  ### Fixed
data/README.md CHANGED
@@ -158,13 +158,13 @@ By default you read one table: the first database in `database.yml` is rendered
158
158
  in full and every other one is summarized in a line each (`db: focus`).
159
159
 
160
160
  ```
161
- ๐Ÿ“Š 2 databases ยท primary, raw
161
+ ๐Ÿ“Š 2 databases ยท primary, log
162
162
 
163
- โ”€โ”€โ”€โ”€ primary ยท myapp_development โ”€โ”€โ”€โ”€ 122 of 1500 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
164
- โ†‘โ†‘ โ”‚ 20260721130000 โ”‚ 2026-07-21 13:00:00 โ”‚ Partition sms notifications โ— sms_notifications
165
- โ†“โ†“ โ”‚ 20260727170000 โ”‚ 2026-07-27 17:00:00 โ”‚ Add cr push columns to lines โ— lines
163
+ โ”€โ”€โ”€โ”€ primary ยท myapp_development โ”€โ”€โ”€โ”€ 12 of 240 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
164
+ โ†‘โ†‘ โ”‚ 20260721130000 โ”‚ 2026-07-21 13:00:00 โ”‚ Partition visit reminders โ— visit_reminders
165
+ โ†“โ†“ โ”‚ 20260727170000 โ”‚ 2026-07-27 17:00:00 โ”‚ Add microchip ids to animals โ— animals
166
166
 
167
- โ‹ฏ raw ยท 5 migrations, all applied ยท latest Jul 22 2026
167
+ โ‹ฏ log ยท 5 migrations, all applied ยท latest Jul 22 2026
168
168
  ```
169
169
 
170
170
  **A database with migrations pending is always expanded**, however focused the
@@ -179,14 +179,14 @@ db: "" # or RBW_DB= on the command line
179
179
  ```
180
180
 
181
181
  ```
182
- โ”€โ”€โ”€โ”€ primary ยท myapp_development โ”€โ”€โ”€โ”€ 122 of 1500 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
183
- โ†‘โ†‘ โ”‚ 20260721130000 โ”‚ 2026-07-21 13:00:00 โ”‚ Partition sms notifications โ— sms_notifications
182
+ โ”€โ”€โ”€โ”€ primary ยท myapp_development โ”€โ”€โ”€โ”€ 12 of 240 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
183
+ โ†‘โ†‘ โ”‚ 20260721130000 โ”‚ 2026-07-21 13:00:00 โ”‚ Partition visit reminders โ— visit_reminders
184
184
 
185
- โ”€โ”€โ”€โ”€ raw ยท raw_development โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
186
- โ†‘โ†‘ โ”‚ 20260722120000 โ”‚ 2026-07-22 12:00:00 โ”‚ Drop archived activity logs โ— archived_activity_logs
185
+ โ”€โ”€โ”€โ”€ log ยท log_development โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
186
+ โ†‘โ†‘ โ”‚ 20260722120000 โ”‚ 2026-07-22 12:00:00 โ”‚ Drop archived visit logs โ— archived_visit_logs
187
187
  ```
188
188
 
189
- A section header counts what it is showing: `122 of 1500` means 122 fell inside
189
+ A section header counts what it is showing: `12 of 240` means 12 fell inside
190
190
  the time window. When the window found too few and the `since_min` floor topped
191
191
  the section back up, it reads `last 10 of 50` instead, because the rows are
192
192
  then the newest ten rather than a window's worth.
@@ -5,15 +5,15 @@ require "date"
5
5
  module Railbow
6
6
  module Demo
7
7
  module Fixtures
8
- # Fictional veterinary SaaS โ€” "PawClinic"
8
+ # Fictional pet shop SaaS โ€” "PawShop"
9
9
  # 4 authors: Alice Chen, Bob Wilson, Carol Davis, Me (current user)
10
10
  DEMO_USER_NAME = "Me"
11
11
  DEMO_USER_EMAIL = "me@example.com"
12
12
 
13
13
  AUTHORS = {
14
- alice: {name: "Alice Chen", email: "alice@pawclinic.dev"},
15
- bob: {name: "Bob Wilson", email: "bob@pawclinic.dev"},
16
- carol: {name: "Carol Davis", email: "carol@pawclinic.dev"},
14
+ alice: {name: "Alice Chen", email: "alice@pawshop.dev"},
15
+ bob: {name: "Bob Wilson", email: "bob@pawshop.dev"},
16
+ carol: {name: "Carol Davis", email: "carol@pawshop.dev"},
17
17
  me: {name: DEMO_USER_NAME, email: DEMO_USER_EMAIL}
18
18
  }.freeze
19
19
 
@@ -52,6 +52,7 @@ module Railbow
52
52
  Railbow::Table::Column.new(label: "Migration Name",
53
53
  max_width: name_col_width,
54
54
  truncate: needs_name_truncation,
55
+ truncate_fn: ->(cell_raw, max_w) { formatter.name_with_tags_fitted(cell_raw, max_w) },
55
56
  shrinkable: true, shrink_floor: 24)
56
57
  ]
57
58
  # No Author column in default config (author:me only highlights)
@@ -34,6 +34,9 @@ module Railbow
34
34
 
35
35
  BRIGHT_WHITE = "\e[1;97m"
36
36
 
37
+ # Narrowest name a tagged cell will accept before the tags are dropped.
38
+ NAME_TAGS_FLOOR = 12
39
+
37
40
  def dim(str) = "#{DIM}#{str}#{RESET}"
38
41
  def green(str) = "#{GREEN}#{str}#{RESET}"
39
42
  def yellow(str) = "#{YELLOW}#{str}#{RESET}"
@@ -115,6 +118,32 @@ module Railbow
115
118
  "+#{total}"
116
119
  end
117
120
 
121
+ # Re-fits a Migration Name cell whose tags (branch, landed) were padded
122
+ # flush against the right edge of a wider column. Truncating such a cell
123
+ # from the right eats the tags whole and leaves a bare ellipsis floating
124
+ # after the padding, so the name gives up the space instead and the tags
125
+ # stay put. Below NAME_TAGS_FLOOR there is no room for both and the tags
126
+ # are dropped outright - the name is what the row is about.
127
+ def name_with_tags_fitted(cell, max_width)
128
+ str = cell.to_s
129
+ return truncate_ansi(str, max_width) if display_width(strip_ansi(str)) <= max_width
130
+
131
+ split = str.rindex(/\s{2,}\e\[/)
132
+ return truncate_ansi(str, max_width) unless split
133
+
134
+ # rindex stops at the last two spaces of the padding run, so the rest of
135
+ # it still hangs off the name and would be truncated in place of it.
136
+ name = str[0...split].rstrip
137
+ tags = str[split..].lstrip
138
+ tags_width = display_width(strip_ansi(tags))
139
+ name_room = max_width - tags_width - 2
140
+ return truncate_ansi(name, max_width) if name_room < NAME_TAGS_FLOOR
141
+
142
+ name = truncate_ansi(name, name_room)
143
+ padding = max_width - display_width(strip_ansi(name)) - tags_width
144
+ "#{name}#{" " * [padding, 2].max}#{tags}"
145
+ end
146
+
118
147
  def format_timing(seconds)
119
148
  milliseconds = (seconds * 1000).round(1)
120
149
 
data/lib/railbow/init.rb CHANGED
@@ -37,7 +37,7 @@ module Railbow
37
37
  # diff - tag migrations by git origin branch
38
38
  # base:<branch> - base branch for diff (default: auto-detected)
39
39
  # mask:auto - auto-extract ticket id from branch name
40
- # mask:<re> - custom regex to extract branch label, e.g. mask:(WS-[^/]+)/
40
+ # mask:<re> - custom regex to extract branch label, e.g. mask:(PS-[^/]+)/
41
41
  git: "author:all,diff,mask:auto"
42
42
 
43
43
  # Author display format - preset or custom pattern (FF L, FFF LL, etc.):
@@ -189,7 +189,7 @@ module Railbow
189
189
  end
190
190
 
191
191
  # Built-in regex for extracting ticket/task identifiers from branch names.
192
- # Matches patterns like: ws-123, 123, abc123, ab-123-456, feat/ws-1234, feat/123-some-feature
192
+ # Matches patterns like: ps-123, 123, abc123, ab-123-456, feat/ps-1234, feat/123-some-feature
193
193
  TICKET_RE = /(?:^|\/)([a-z]{1,5}-?\d+(?:-\d+)*|\d+(?:-\d+)*)/i
194
194
 
195
195
  # Extract a ticket identifier from a branch name.
@@ -86,7 +86,7 @@ module Railbow
86
86
  diff - tag migrations by git origin
87
87
  base:<branch> - base branch for diff (default: auto-detected)
88
88
  mask:<re> - regex to extract branch label
89
- e.g. mask:(WS-[^/]+)/
89
+ e.g. mask:(PS-[^/]+)/
90
90
  mask:auto - auto-extract ticket id from branch name
91
91
 
92
92
  RBW_PLAIN=1 Disable Railbow formatting (plain Rails output)
@@ -109,7 +109,7 @@ module Railbow
109
109
  RBW_DATE='custom(%b %d, %Y)' rake db:migrate:status
110
110
  RBW_GIT=diff rake db:migrate:status
111
111
  RBW_GIT=diff,base:develop rake db:migrate:status
112
- RBW_GIT=diff,mask:(WS-[^/]+)/ rake db:migrate:status
112
+ RBW_GIT=diff,mask:(PS-[^/]+)/ rake db:migrate:status
113
113
  RBW_DB= rake db:migrate:status
114
114
  RBW_DB=only:primary rake db:migrate:status
115
115
  RBW_DB=inline rake db:migrate:status
@@ -254,7 +254,7 @@ module Railbow
254
254
  end
255
255
  end
256
256
 
257
- # "โ”€โ”€โ”€โ”€ primary ยท westside-dev โ”€โ”€โ”€โ”€ 111 of 1489 โ”€โ”€โ”€โ”€", ruled out to where
257
+ # "โ”€โ”€โ”€โ”€ primary ยท pawshop-dev โ”€โ”€โ”€โ”€ 12 of 240 โ”€โ”€โ”€โ”€", ruled out to where
258
258
  # the last column starts so it frames the table rather than floating.
259
259
  def section_header(section, rule_width)
260
260
  label = section.db_names.join(" + ")
@@ -332,6 +332,7 @@ module Railbow
332
332
  Table::Column.new(label: "Migration Name",
333
333
  max_width: @name_col_width,
334
334
  truncate: !@name_col_width.nil?,
335
+ truncate_fn: ->(cell_raw, max_w) { formatter.name_with_tags_fitted(cell_raw, max_w) },
335
336
  shrinkable: true, shrink_floor: NAME_COL_MIN_WIDTH)
336
337
  ]
337
338
  cols << Table::Column.new(label: "Who", droppable: 3) if author_mode == "all"
@@ -388,7 +388,11 @@ module Railbow
388
388
 
389
389
  widths[i] -= cut
390
390
  overflow -= cut
391
- rows.each { |row| row[i] = truncate_ansi(row[i].to_s, widths[i]) }
391
+ # A column that knows how to re-fit its own cells does it here: a
392
+ # blind cut from the right would drop whatever the cell parked at its
393
+ # far edge (right-aligned tags) instead of shortening the content.
394
+ fit = col.truncate_fn || method(:truncate_ansi)
395
+ rows.each { |row| row[i] = fit.call(row[i].to_s, widths[i]) }
392
396
  end
393
397
  end
394
398
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Railbow
4
- VERSION = "0.6.0"
4
+ VERSION = "0.6.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railbow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eugene M