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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a27c93cbf5c19306ecd042c6de0ea1d3f0fadccae1ffed2f9176027d4ba49090
4
- data.tar.gz: b99468117cc80a0223c34e55e7088dfa424b19e09ed04bd306f81f6b0a2da191
3
+ metadata.gz: 67554241409ee2d8daa5d282f7ba7f3e351048c13ad0df7dd227669c8bdc954f
4
+ data.tar.gz: a1fc82ff0ff281608bc4d88e5058ee7ec3342856e441695f1de554ea0cffefb1
5
5
  SHA512:
6
- metadata.gz: f3f33225f7c10bb17d60c18a4722292fb58d518cb0edaf2d3f4726ce21eb01c0d20f7a462e137975951cf84923c02c9519e1dc54a268ab2eb489df634d7b490f
7
- data.tar.gz: cc6a253b40439b4b580100f1e69755222504f9c1e5157d48a9bc9ebc5725c6f7faae5aae243e97bb707473930eec304a0e5e8c90310a8028627355432d2b7e2d
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.