rich-ruby 1.0.1 → 1.0.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 +4 -4
- data/CHANGELOG.md +80 -0
- data/LICENSE +21 -21
- data/README.md +547 -547
- data/docs/architecture.md +43 -0
- data/docs/cheat-sheet.md +52 -0
- data/docs/customization.md +53 -0
- data/docs/how-to-use.md +96 -0
- data/docs/test-report.md +112 -0
- data/docs/troubleshooting.md +36 -0
- data/docs/windows-notes.md +30 -0
- data/examples/demo.rb +106 -106
- data/examples/showcase.rb +420 -420
- data/examples/smoke_test.rb +41 -41
- data/examples/stress_test.rb +604 -604
- data/examples/syntax_markdown_demo.rb +166 -166
- data/examples/verify.rb +216 -215
- data/examples/visual_demo.rb +145 -145
- data/lib/rich/_palettes.rb +148 -148
- data/lib/rich/box.rb +342 -342
- data/lib/rich/cells.rb +524 -512
- data/lib/rich/color.rb +631 -628
- data/lib/rich/color_triplet.rb +227 -220
- data/lib/rich/console.rb +604 -549
- data/lib/rich/control.rb +332 -332
- data/lib/rich/json.rb +260 -254
- data/lib/rich/layout.rb +314 -314
- data/lib/rich/markdown.rb +531 -509
- data/lib/rich/markup.rb +186 -175
- data/lib/rich/panel.rb +318 -311
- data/lib/rich/progress.rb +430 -430
- data/lib/rich/segment.rb +387 -387
- data/lib/rich/style.rb +464 -433
- data/lib/rich/syntax.rb +1220 -1145
- data/lib/rich/table.rb +547 -525
- data/lib/rich/terminal_theme.rb +126 -126
- data/lib/rich/text.rb +460 -433
- data/lib/rich/tree.rb +220 -220
- data/lib/rich/version.rb +5 -5
- data/lib/rich/win32_console.rb +620 -582
- data/lib/rich.rb +108 -108
- metadata +15 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 67554241409ee2d8daa5d282f7ba7f3e351048c13ad0df7dd227669c8bdc954f
|
|
4
|
+
data.tar.gz: a1fc82ff0ff281608bc4d88e5058ee7ec3342856e441695f1de554ea0cffefb1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 24fc5b534d2240325d25a1ad43ba250099639f4495d6d7c5f487cf7cef4eaef0ce3a46d6c2dc3861e332412598938da10ae763a96c84d25249bdb1bd9d2e5c55
|
|
7
|
+
data.tar.gz: e384ea15873b6f39afacabbc0c28105fb4d624a7cf4d1fcc03c225787e1a042b0a958e44af271e7d35b080a30a15a471bb28a87d8b85b249a567653a3b651c07
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.0.2] - 2026-05-29
|
|
9
|
+
|
|
10
|
+
Hardening release. Fixes a number of correctness and packaging issues found in
|
|
11
|
+
an audit of the 1.0.1 code.
|
|
12
|
+
|
|
13
|
+
### Fixed — rendering pipeline (the public API now actually works)
|
|
14
|
+
- `Console#print` / `Rich.print` now render markup and Rich renderables. Strings
|
|
15
|
+
with markup (`"[bold red]Hi[/]"`) are parsed and styled instead of having tags
|
|
16
|
+
stripped, and renderable objects (Table, Panel, Tree, Syntax, Markdown, …) are
|
|
17
|
+
rendered via their `to_segments`/`render` protocol instead of printing
|
|
18
|
+
`#<Rich::Class:0x…>`.
|
|
19
|
+
- `Console#print_json(data:)` no longer raises `NoMethodError`: stdlib JSON is
|
|
20
|
+
now referenced as `::JSON` (it was shadowed by `Rich::JSON`).
|
|
21
|
+
- `Cells.cell_len` now measures display width by character on all platforms.
|
|
22
|
+
Previously it returned UTF-8 **byte** length on legacy Windows consoles, which
|
|
23
|
+
corrupted alignment for any non-ASCII text and box-drawing characters.
|
|
24
|
+
|
|
25
|
+
### Fixed — crashes (`String#* negative`)
|
|
26
|
+
- `Table#render` no longer crashes when the title/caption is wider than the
|
|
27
|
+
table; titles are centered correctly (accounting for surrounding spaces) and
|
|
28
|
+
fills are clamped non-negative.
|
|
29
|
+
- `Panel#render` no longer crashes at very small widths or with near-full-width
|
|
30
|
+
left/right-aligned titles; the title/subtitle edge always spans the full body
|
|
31
|
+
width.
|
|
32
|
+
- Table cells with `overflow: :fold` (or any non-ellipsis mode) and per-column
|
|
33
|
+
`overflow` are now honored per column and truncated so padding cannot go
|
|
34
|
+
negative.
|
|
35
|
+
|
|
36
|
+
### Fixed — text & styling
|
|
37
|
+
- `Text#wrap` no longer drops style spans when hard-breaking a long word or
|
|
38
|
+
wrapping to a new line.
|
|
39
|
+
- `Text#dup` now preserves `justify`, `overflow`, `no_wrap`, and `end_str`.
|
|
40
|
+
- `Style#+` no longer discards meta-only styles (`blank?` now considers `meta`).
|
|
41
|
+
- Markup closing tags now match by name (`[/red]`), consistent with `validate`.
|
|
42
|
+
|
|
43
|
+
### Fixed — markdown / syntax / json
|
|
44
|
+
- Markdown italics no longer fire inside `snake_case` identifiers; inline code
|
|
45
|
+
spans are protected so emphasis markers inside backticks stay literal.
|
|
46
|
+
- Ordered lists track a per-indent counter (nested lists restart) and honor an
|
|
47
|
+
author-specified starting number.
|
|
48
|
+
- Syntax highlighters: `/` is only treated as a regex literal when a real
|
|
49
|
+
closing `/` exists, so ordinary division is no longer swallowed.
|
|
50
|
+
- String tokenizers (`json.rb`, `syntax.rb`) handle an escaped backslash before
|
|
51
|
+
the closing quote correctly.
|
|
52
|
+
|
|
53
|
+
### Fixed — Windows / cross-platform
|
|
54
|
+
- `WriteConsoleW` is passed the UTF-16 code-unit count (not the code-point
|
|
55
|
+
count), so non-BMP characters (emoji) are no longer truncated.
|
|
56
|
+
- ANSI is no longer emitted to non-TTY output; `NO_COLOR` and `FORCE_COLOR` are
|
|
57
|
+
honored, as is `TERM=dumb`.
|
|
58
|
+
- Legacy-Windows color now down-maps 8-bit/truecolor to a visible 0–15 index
|
|
59
|
+
instead of black-on-black.
|
|
60
|
+
- `GetStdHandle` results are validated (NULL/INVALID_HANDLE_VALUE → nil),
|
|
61
|
+
`GetLastError` is bound, and ANSI is enabled lazily by the Console rather than
|
|
62
|
+
as an import-time side effect.
|
|
63
|
+
- Terminal-size detection decouples `COLUMNS`/`LINES` and adds an `stty` fallback.
|
|
64
|
+
|
|
65
|
+
### Fixed — misc correctness
|
|
66
|
+
- `ProgressStyle::ARROW` is now an 8-frame array (it was a single element and
|
|
67
|
+
never animated).
|
|
68
|
+
- `Cells.set_cell_size` overrides are now honored by `char_width`.
|
|
69
|
+
|
|
70
|
+
### Performance
|
|
71
|
+
- `Cells.char_width` has an ASCII fast path; `Style#render` memoizes per
|
|
72
|
+
color-system; hot width-measurement paths use the cached `cell_len`.
|
|
73
|
+
|
|
74
|
+
### Packaging / docs
|
|
75
|
+
- Added a `Rakefile` (`rake test` / `rake build`).
|
|
76
|
+
- Removed the unused `rbs` development dependency.
|
|
77
|
+
- Shipped `docs/` and `CHANGELOG.md` in the gem; added changelog/bug-tracker/
|
|
78
|
+
documentation metadata URIs.
|
|
79
|
+
- README/docs corrected (Ruby version, source-install commands, JSON example,
|
|
80
|
+
`[u]` shorthand now works).
|
data/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Rich Ruby Contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Rich Ruby Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|