ratatui_ruby 0.8.0 → 0.9.1
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/.builds/ruby-3.2.yml +2 -2
- data/.builds/ruby-3.3.yml +2 -2
- data/.builds/ruby-3.4.yml +2 -2
- data/.builds/ruby-4.0.0.yml +2 -2
- data/.pre-commit-config.yaml +1 -1
- data/AGENTS.md +3 -3
- data/CHANGELOG.md +77 -1
- data/LICENSES/LGPL-3.0-or-later.txt +304 -0
- data/LICENSES/MIT-0.txt +16 -0
- data/README.md +33 -5
- data/Rakefile +1 -1
- data/doc/concepts/application_architecture.md +44 -3
- data/doc/concepts/application_testing.md +43 -1
- data/doc/concepts/async.md +32 -2
- data/doc/concepts/custom_widgets.md +247 -0
- data/doc/concepts/event_handling.md +32 -3
- data/doc/concepts/interactive_design.md +32 -2
- data/doc/contributors/auditing/parity.md +7 -1
- data/doc/contributors/design/ruby_frontend.md +85 -1
- data/doc/contributors/design/rust_backend.md +67 -1
- data/doc/contributors/developing_examples.md +56 -2
- data/doc/contributors/documentation_style.md +20 -3
- data/doc/contributors/future_work.md +169 -0
- data/doc/contributors/index.md +1 -1
- data/doc/contributors/v1.0.0_blockers.md +19 -185
- data/doc/getting_started/quickstart.md +22 -4
- data/doc/getting_started/why.md +1 -1
- data/doc/index.md +2 -1
- data/doc/troubleshooting/debugging.md +32 -2
- data/doc/troubleshooting/terminal_limitations.md +8 -2
- data/doc/troubleshooting/tui_output.md +42 -0
- data/examples/app_all_events/README.md +14 -2
- data/examples/app_all_events/app.rb +1 -1
- data/examples/app_all_events/model/app_model.rb +1 -1
- data/examples/app_all_events/model/event_color_cycle.rb +1 -1
- data/examples/app_all_events/model/event_entry.rb +1 -1
- data/examples/app_all_events/model/msg.rb +1 -1
- data/examples/app_all_events/model/timestamp.rb +1 -1
- data/examples/app_all_events/update.rb +1 -1
- data/examples/app_all_events/view/app_view.rb +1 -1
- data/examples/app_all_events/view/controls_view.rb +1 -1
- data/examples/app_all_events/view/counts_view.rb +1 -1
- data/examples/app_all_events/view/live_view.rb +1 -1
- data/examples/app_all_events/view/log_view.rb +1 -1
- data/examples/app_all_events/view.rb +1 -1
- data/examples/app_color_picker/README.md +20 -2
- data/examples/app_color_picker/app.rb +1 -1
- data/examples/app_color_picker/clipboard.rb +1 -1
- data/examples/app_color_picker/color.rb +1 -1
- data/examples/app_color_picker/controls.rb +1 -1
- data/examples/app_color_picker/copy_dialog.rb +1 -1
- data/examples/app_color_picker/export_pane.rb +1 -1
- data/examples/app_color_picker/harmony.rb +1 -1
- data/examples/app_color_picker/input.rb +1 -1
- data/examples/app_color_picker/main_container.rb +1 -1
- data/examples/app_color_picker/palette.rb +1 -1
- data/examples/app_login_form/README.md +8 -2
- data/examples/app_login_form/app.rb +1 -1
- data/examples/app_stateful_interaction/README.md +2 -2
- data/examples/app_stateful_interaction/app.rb +71 -17
- data/examples/timeout_demo.rb +1 -1
- data/examples/verify_quickstart_dsl/README.md +6 -0
- data/examples/verify_quickstart_dsl/app.rb +3 -3
- data/examples/verify_quickstart_layout/README.md +6 -0
- data/examples/verify_quickstart_layout/app.rb +3 -3
- data/examples/verify_quickstart_lifecycle/README.md +6 -0
- data/examples/verify_quickstart_lifecycle/app.rb +3 -3
- data/examples/verify_readme_usage/README.md +6 -0
- data/examples/verify_readme_usage/app.rb +3 -3
- data/examples/widget_barchart/README.md +6 -0
- data/examples/widget_barchart/app.rb +2 -2
- data/examples/widget_block/README.md +7 -1
- data/examples/widget_block/app.rb +2 -2
- data/examples/widget_box/README.md +6 -0
- data/examples/widget_box/app.rb +9 -6
- data/examples/widget_calendar/README.md +6 -0
- data/examples/widget_calendar/app.rb +2 -2
- data/examples/widget_canvas/README.md +4 -0
- data/examples/widget_canvas/app.rb +2 -2
- data/examples/widget_cell/README.md +6 -0
- data/examples/widget_cell/app.rb +2 -3
- data/examples/widget_center/README.md +4 -0
- data/examples/widget_center/app.rb +2 -2
- data/examples/widget_chart/README.md +6 -0
- data/examples/widget_chart/app.rb +2 -2
- data/examples/widget_gauge/README.md +6 -0
- data/examples/widget_gauge/app.rb +2 -2
- data/examples/widget_layout_split/README.md +6 -0
- data/examples/widget_layout_split/app.rb +9 -3
- data/examples/widget_line_gauge/README.md +6 -0
- data/examples/widget_line_gauge/app.rb +2 -2
- data/examples/widget_list/README.md +6 -0
- data/examples/widget_list/app.rb +2 -2
- data/examples/widget_map/README.md +8 -2
- data/examples/widget_map/app.rb +2 -2
- data/examples/widget_overlay/README.md +7 -1
- data/examples/widget_overlay/app.rb +2 -2
- data/examples/widget_popup/README.md +6 -0
- data/examples/widget_popup/app.rb +2 -2
- data/examples/widget_ratatui_logo/README.md +6 -0
- data/examples/widget_ratatui_logo/app.rb +2 -3
- data/examples/widget_ratatui_mascot/README.md +6 -0
- data/examples/widget_ratatui_mascot/app.rb +2 -2
- data/examples/widget_rect/README.md +12 -0
- data/examples/widget_rect/app.rb +40 -26
- data/examples/widget_render/README.md +6 -0
- data/examples/widget_render/app.rb +2 -2
- data/examples/widget_render/app.rbs +41 -0
- data/examples/widget_rich_text/README.md +6 -0
- data/examples/widget_rich_text/app.rb +2 -2
- data/examples/widget_scroll_text/README.md +6 -0
- data/examples/widget_scroll_text/app.rb +2 -2
- data/examples/widget_scrollbar/README.md +6 -0
- data/examples/widget_scrollbar/app.rb +2 -2
- data/examples/widget_sparkline/README.md +6 -0
- data/examples/widget_sparkline/app.rb +2 -2
- data/examples/widget_style_colors/README.md +6 -0
- data/examples/widget_style_colors/app.rb +2 -2
- data/examples/widget_table/README.md +8 -2
- data/examples/widget_table/app.rb +2 -2
- data/examples/widget_tabs/README.md +6 -0
- data/examples/widget_tabs/app.rb +2 -2
- data/examples/widget_text_width/README.md +6 -0
- data/examples/widget_text_width/app.rb +4 -4
- data/ext/ratatui_ruby/Cargo.lock +1 -1
- data/ext/ratatui_ruby/Cargo.toml +1 -1
- data/ext/ratatui_ruby/extconf.rb +2 -2
- data/ext/ratatui_ruby/src/events.rs +1 -0
- data/ext/ratatui_ruby/src/rendering.rs +1 -1
- data/ext/ratatui_ruby/src/style.rs +0 -8
- data/ext/ratatui_ruby/src/widgets/chart.rs +0 -118
- data/ext/ratatui_ruby/src/widgets/list_state.rs +36 -0
- data/lib/ratatui_ruby/buffer/cell.rb +34 -2
- data/lib/ratatui_ruby/buffer.rb +2 -2
- data/lib/ratatui_ruby/cell.rb +34 -2
- data/lib/ratatui_ruby/event/focus_gained.rb +26 -2
- data/lib/ratatui_ruby/event/focus_lost.rb +26 -2
- data/lib/ratatui_ruby/event/key/character.rb +18 -2
- data/lib/ratatui_ruby/event/key/media.rb +2 -2
- data/lib/ratatui_ruby/event/key/modifier.rb +10 -2
- data/lib/ratatui_ruby/event/key/navigation.rb +2 -2
- data/lib/ratatui_ruby/event/key/system.rb +2 -2
- data/lib/ratatui_ruby/event/key.rb +114 -2
- data/lib/ratatui_ruby/event/mouse.rb +42 -2
- data/lib/ratatui_ruby/event/none.rb +10 -2
- data/lib/ratatui_ruby/event/paste.rb +34 -2
- data/lib/ratatui_ruby/event/resize.rb +34 -2
- data/lib/ratatui_ruby/event/sync.rb +52 -0
- data/lib/ratatui_ruby/event.rb +32 -2
- data/lib/ratatui_ruby/frame.rb +74 -2
- data/lib/ratatui_ruby/layout/constraint.rb +193 -2
- data/lib/ratatui_ruby/layout/layout.rb +47 -2
- data/lib/ratatui_ruby/layout/rect.rb +403 -2
- data/lib/ratatui_ruby/layout.rb +2 -2
- data/lib/ratatui_ruby/list_state.rb +113 -2
- data/lib/ratatui_ruby/output_guard.rb +26 -3
- data/lib/ratatui_ruby/schema/bar_chart/bar.rb +2 -2
- data/lib/ratatui_ruby/schema/bar_chart/bar_group.rb +2 -2
- data/lib/ratatui_ruby/schema/bar_chart.rb +50 -2
- data/lib/ratatui_ruby/schema/block.rb +21 -15
- data/lib/ratatui_ruby/schema/calendar.rb +2 -2
- data/lib/ratatui_ruby/schema/canvas.rb +10 -2
- data/lib/ratatui_ruby/schema/center.rb +10 -2
- data/lib/ratatui_ruby/schema/chart.rb +2 -28
- data/lib/ratatui_ruby/schema/clear.rb +10 -2
- data/lib/ratatui_ruby/schema/constraint.rb +58 -2
- data/lib/ratatui_ruby/schema/cursor.rb +10 -2
- data/lib/ratatui_ruby/schema/draw.rb +10 -2
- data/lib/ratatui_ruby/schema/gauge.rb +2 -2
- data/lib/ratatui_ruby/schema/layout.rb +18 -2
- data/lib/ratatui_ruby/schema/line_gauge.rb +2 -2
- data/lib/ratatui_ruby/schema/list.rb +10 -2
- data/lib/ratatui_ruby/schema/list_item.rb +10 -2
- data/lib/ratatui_ruby/schema/overlay.rb +10 -2
- data/lib/ratatui_ruby/schema/paragraph.rb +10 -2
- data/lib/ratatui_ruby/schema/ratatui_logo.rb +2 -2
- data/lib/ratatui_ruby/schema/ratatui_mascot.rb +2 -2
- data/lib/ratatui_ruby/schema/rect.rb +58 -2
- data/lib/ratatui_ruby/schema/row.rb +10 -2
- data/lib/ratatui_ruby/schema/scrollbar.rb +2 -2
- data/lib/ratatui_ruby/schema/shape/label.rb +10 -2
- data/lib/ratatui_ruby/schema/sparkline.rb +10 -2
- data/lib/ratatui_ruby/schema/style.rb +18 -2
- data/lib/ratatui_ruby/schema/table.rb +2 -2
- data/lib/ratatui_ruby/schema/tabs.rb +2 -2
- data/lib/ratatui_ruby/schema/text.rb +34 -2
- data/lib/ratatui_ruby/scrollbar_state.rb +10 -2
- data/lib/ratatui_ruby/style/style.rb +18 -2
- data/lib/ratatui_ruby/style.rb +2 -2
- data/lib/ratatui_ruby/synthetic_events.rb +86 -0
- data/lib/ratatui_ruby/table_state.rb +10 -2
- data/lib/ratatui_ruby/terminal_lifecycle.rb +18 -3
- data/lib/ratatui_ruby/test_helper/event_injection.rb +62 -2
- data/lib/ratatui_ruby/test_helper/snapshot.rb +74 -9
- data/lib/ratatui_ruby/test_helper/style_assertions.rb +98 -2
- data/lib/ratatui_ruby/test_helper/terminal.rb +50 -2
- data/lib/ratatui_ruby/test_helper/test_doubles.rb +18 -2
- data/lib/ratatui_ruby/test_helper.rb +10 -2
- data/lib/ratatui_ruby/tui/buffer_factories.rb +2 -2
- data/lib/ratatui_ruby/tui/canvas_factories.rb +2 -2
- data/lib/ratatui_ruby/tui/core.rb +2 -2
- data/lib/ratatui_ruby/tui/layout_factories.rb +32 -2
- data/lib/ratatui_ruby/tui/state_factories.rb +2 -2
- data/lib/ratatui_ruby/tui/style_factories.rb +2 -2
- data/lib/ratatui_ruby/tui/text_factories.rb +2 -2
- data/lib/ratatui_ruby/tui/widget_factories.rb +2 -2
- data/lib/ratatui_ruby/tui.rb +11 -3
- data/lib/ratatui_ruby/version.rb +3 -3
- data/lib/ratatui_ruby/widgets/bar_chart/bar.rb +2 -2
- data/lib/ratatui_ruby/widgets/bar_chart/bar_group.rb +2 -2
- data/lib/ratatui_ruby/widgets/bar_chart.rb +58 -2
- data/lib/ratatui_ruby/widgets/block.rb +37 -15
- data/lib/ratatui_ruby/widgets/calendar.rb +2 -2
- data/lib/ratatui_ruby/widgets/canvas.rb +10 -2
- data/lib/ratatui_ruby/widgets/cell.rb +10 -2
- data/lib/ratatui_ruby/widgets/center.rb +10 -2
- data/lib/ratatui_ruby/widgets/chart.rb +2 -28
- data/lib/ratatui_ruby/widgets/clear.rb +10 -2
- data/lib/ratatui_ruby/widgets/cursor.rb +10 -2
- data/lib/ratatui_ruby/widgets/gauge.rb +16 -2
- data/lib/ratatui_ruby/widgets/line_gauge.rb +16 -2
- data/lib/ratatui_ruby/widgets/list.rb +41 -2
- data/lib/ratatui_ruby/widgets/list_item.rb +10 -2
- data/lib/ratatui_ruby/widgets/overlay.rb +10 -2
- data/lib/ratatui_ruby/widgets/paragraph.rb +10 -2
- data/lib/ratatui_ruby/widgets/ratatui_logo.rb +2 -2
- data/lib/ratatui_ruby/widgets/ratatui_mascot.rb +2 -2
- data/lib/ratatui_ruby/widgets/row.rb +10 -2
- data/lib/ratatui_ruby/widgets/scrollbar.rb +2 -2
- data/lib/ratatui_ruby/widgets/shape/label.rb +10 -2
- data/lib/ratatui_ruby/widgets/sparkline.rb +10 -2
- data/lib/ratatui_ruby/widgets/table.rb +62 -2
- data/lib/ratatui_ruby/widgets/tabs.rb +2 -2
- data/lib/ratatui_ruby/widgets.rb +2 -2
- data/lib/ratatui_ruby.rb +101 -9
- data/sig/examples/app_all_events/view.rbs +7 -1
- data/sig/examples/app_all_events/view_state.rbs +7 -1
- data/sig/examples/app_color_picker/app.rbs +5 -0
- data/sig/examples/app_stateful_interaction/app.rbs +7 -1
- data/sig/examples/verify_quickstart_dsl/app.rbs +7 -1
- data/sig/examples/verify_quickstart_lifecycle/app.rbs +7 -1
- data/sig/examples/verify_readme_usage/app.rbs +7 -1
- data/sig/examples/widget_block_demo/app.rbs +6 -0
- data/sig/examples/widget_box_demo/app.rbs +7 -1
- data/sig/examples/widget_calendar_demo/app.rbs +7 -1
- data/sig/examples/widget_cell_demo/app.rbs +7 -1
- data/sig/examples/widget_chart_demo/app.rbs +7 -1
- data/sig/examples/widget_gauge_demo/app.rbs +7 -1
- data/sig/examples/widget_layout_split/app.rbs +7 -1
- data/sig/examples/widget_line_gauge_demo/app.rbs +7 -1
- data/sig/examples/widget_list_demo/app.rbs +5 -0
- data/sig/examples/widget_map_demo/app.rbs +7 -1
- data/sig/examples/widget_popup_demo/app.rbs +7 -1
- data/sig/examples/widget_ratatui_logo_demo/app.rbs +7 -1
- data/sig/examples/widget_ratatui_mascot_demo/app.rbs +7 -1
- data/sig/examples/widget_rect/app.rbs +7 -1
- data/sig/examples/widget_render/app.rbs +7 -1
- data/sig/examples/widget_rich_text/app.rbs +7 -1
- data/sig/examples/widget_scroll_text/app.rbs +7 -1
- data/sig/examples/widget_scrollbar_demo/app.rbs +7 -1
- data/sig/examples/widget_sparkline_demo/app.rbs +7 -1
- data/sig/examples/widget_style_colors/app.rbs +7 -1
- data/sig/examples/widget_table_demo/app.rbs +7 -1
- data/sig/examples/widget_text_width/app.rbs +7 -1
- data/sig/ratatui_ruby/event.rbs +7 -1
- data/sig/ratatui_ruby/frame.rbs +15 -3
- data/sig/ratatui_ruby/list_state.rbs +11 -1
- data/sig/ratatui_ruby/ratatui_ruby.rbs +8 -2
- data/sig/ratatui_ruby/schema/bar_chart/bar.rbs +7 -1
- data/sig/ratatui_ruby/schema/bar_chart/bar_group.rbs +6 -0
- data/sig/ratatui_ruby/schema/bar_chart.rbs +6 -0
- data/sig/ratatui_ruby/schema/block.rbs +7 -1
- data/sig/ratatui_ruby/schema/calendar.rbs +6 -0
- data/sig/ratatui_ruby/schema/canvas.rbs +6 -0
- data/sig/ratatui_ruby/schema/center.rbs +6 -0
- data/sig/ratatui_ruby/schema/chart.rbs +6 -9
- data/sig/ratatui_ruby/schema/constraint.rbs +14 -0
- data/sig/ratatui_ruby/schema/cursor.rbs +6 -0
- data/sig/ratatui_ruby/schema/draw.rbs +6 -0
- data/sig/ratatui_ruby/schema/gauge.rbs +9 -1
- data/sig/ratatui_ruby/schema/layout.rbs +6 -0
- data/sig/ratatui_ruby/schema/line_gauge.rbs +9 -1
- data/sig/ratatui_ruby/schema/list.rbs +9 -1
- data/sig/ratatui_ruby/schema/list_item.rbs +7 -1
- data/sig/ratatui_ruby/schema/overlay.rbs +6 -0
- data/sig/ratatui_ruby/schema/paragraph.rbs +6 -0
- data/sig/ratatui_ruby/schema/ratatui_logo.rbs +6 -0
- data/sig/ratatui_ruby/schema/ratatui_mascot.rbs +5 -0
- data/sig/ratatui_ruby/schema/rect.rbs +30 -0
- data/sig/ratatui_ruby/schema/row.rbs +7 -1
- data/sig/ratatui_ruby/schema/scrollbar.rbs +6 -0
- data/sig/ratatui_ruby/schema/sparkline.rbs +6 -0
- data/sig/ratatui_ruby/schema/style.rbs +7 -1
- data/sig/ratatui_ruby/schema/table.rbs +11 -1
- data/sig/ratatui_ruby/schema/tabs.rbs +6 -0
- data/sig/ratatui_ruby/schema/text.rbs +7 -1
- data/sig/ratatui_ruby/scrollbar_state.rbs +7 -1
- data/sig/ratatui_ruby/session.rbs +7 -1
- data/sig/ratatui_ruby/table_state.rbs +7 -1
- data/sig/ratatui_ruby/test_helper/event_injection.rbs +7 -1
- data/sig/ratatui_ruby/test_helper/snapshot.rbs +7 -1
- data/sig/ratatui_ruby/test_helper/style_assertions.rbs +7 -1
- data/sig/ratatui_ruby/test_helper/terminal.rbs +7 -1
- data/sig/ratatui_ruby/test_helper/test_doubles.rbs +7 -1
- data/sig/ratatui_ruby/test_helper.rbs +7 -1
- data/sig/ratatui_ruby/tui/buffer_factories.rbs +7 -1
- data/sig/ratatui_ruby/tui/canvas_factories.rbs +7 -1
- data/sig/ratatui_ruby/tui/core.rbs +7 -1
- data/sig/ratatui_ruby/tui/layout_factories.rbs +7 -1
- data/sig/ratatui_ruby/tui/state_factories.rbs +7 -1
- data/sig/ratatui_ruby/tui/style_factories.rbs +7 -1
- data/sig/ratatui_ruby/tui/text_factories.rbs +7 -1
- data/sig/ratatui_ruby/tui/widget_factories.rbs +7 -1
- data/sig/ratatui_ruby/tui.rbs +7 -1
- data/sig/ratatui_ruby/version.rbs +6 -0
- data/tasks/autodoc/examples.rb +1 -1
- data/tasks/autodoc/member.rb +1 -1
- data/tasks/autodoc/name.rb +1 -1
- data/tasks/bump/cargo_lockfile.rb +1 -1
- data/tasks/bump/changelog.rb +1 -1
- data/tasks/bump/header.rb +1 -1
- data/tasks/bump/history.rb +1 -1
- data/tasks/bump/links.rb +1 -1
- data/tasks/bump/manifest.rb +1 -1
- data/tasks/bump/ruby_gem.rb +1 -1
- data/tasks/bump/sem_ver.rb +1 -1
- data/tasks/bump/unreleased_section.rb +1 -1
- data/tasks/license/headers_md.rb +223 -0
- data/tasks/license/headers_rb.rb +210 -0
- data/tasks/license/license_utils.rb +130 -0
- data/tasks/license/snippets_md.rb +315 -0
- data/tasks/license/snippets_rdoc.rb +150 -0
- data/tasks/license.rake +91 -0
- data/tasks/rdoc_config.rb +1 -1
- data/tasks/resources/build.yml.erb +13 -7
- data/tasks/sourcehut.rake +3 -1
- data/tasks/terminal_preview/app_screenshot.rb +1 -1
- data/tasks/terminal_preview/crash_report.rb +1 -1
- data/tasks/terminal_preview/example_app.rb +1 -1
- data/tasks/terminal_preview/launcher_script.rb +1 -1
- data/tasks/terminal_preview/preview_collection.rb +1 -1
- data/tasks/terminal_preview/preview_timing.rb +1 -1
- data/tasks/terminal_preview/safety_confirmation.rb +1 -1
- data/tasks/terminal_preview/saved_screenshot.rb +1 -1
- data/tasks/terminal_preview/system_appearance.rb +1 -1
- data/tasks/terminal_preview/terminal_window.rb +1 -1
- data/tasks/terminal_preview/window_id.rb +1 -1
- data/tasks/website/index_page.rb +1 -1
- data/tasks/website/version.rb +1 -1
- data/tasks/website/version_menu.rb +1 -1
- data/tasks/website/versioned_documentation.rb +1 -1
- data/tasks/website/website.rb +1 -1
- metadata +15 -3
- data/doc/migration/v0_7_0.md +0 -236
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText:
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
|
|
2
2
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
3
3
|
|
|
4
4
|
image: archlinux
|
|
@@ -13,12 +13,14 @@ packages:
|
|
|
13
13
|
- gdbm
|
|
14
14
|
- ncurses
|
|
15
15
|
- libffi
|
|
16
|
+
<%- if has_rust -%>
|
|
16
17
|
- clang
|
|
18
|
+
<%- end -%>
|
|
17
19
|
- git
|
|
18
20
|
artifacts:
|
|
19
|
-
-
|
|
21
|
+
- <%= gem_name %>/pkg/<%= gem_filename %>
|
|
20
22
|
sources:
|
|
21
|
-
- https://git.sr.ht/~kerrick
|
|
23
|
+
- https://git.sr.ht/~kerrick/<%= gem_name %>
|
|
22
24
|
tasks:
|
|
23
25
|
- setup: |
|
|
24
26
|
curl https://mise.jdx.dev/install.sh | sh
|
|
@@ -26,10 +28,12 @@ tasks:
|
|
|
26
28
|
echo 'eval "$($HOME/.local/bin/mise activate bash)"' >> ~/.buildenv
|
|
27
29
|
echo 'export LANG="en_US.UTF-8"' >> ~/.buildenv
|
|
28
30
|
echo 'export LC_ALL="en_US.UTF-8"' >> ~/.buildenv
|
|
31
|
+
<%- if has_rust -%>
|
|
29
32
|
echo 'export BINDGEN_EXTRA_CLANG_ARGS="-include stdbool.h"' >> ~/.buildenv
|
|
33
|
+
<%- end -%>
|
|
30
34
|
. ~/.buildenv
|
|
31
35
|
export CI="true"
|
|
32
|
-
cd
|
|
36
|
+
cd <%= gem_name %>
|
|
33
37
|
sed -i 's/ruby = .*/ruby = "<%= ruby_version %>"/' mise.toml
|
|
34
38
|
mise install
|
|
35
39
|
mise x -- pip install reuse
|
|
@@ -37,18 +41,20 @@ tasks:
|
|
|
37
41
|
mise reshim
|
|
38
42
|
mise x -- bundle config set --local frozen 'true'
|
|
39
43
|
mise x -- bundle install
|
|
44
|
+
<%- if has_rust -%>
|
|
40
45
|
mise x -- bundle exec rake compile
|
|
46
|
+
<%- end -%>
|
|
41
47
|
- test: |
|
|
42
48
|
. ~/.buildenv
|
|
43
|
-
cd
|
|
49
|
+
cd <%= gem_name %>
|
|
44
50
|
echo "Testing Ruby <%= ruby_version %>"
|
|
45
51
|
mise x -- bundle exec rake test
|
|
46
52
|
- lint: |
|
|
47
53
|
. ~/.buildenv
|
|
48
|
-
cd
|
|
54
|
+
cd <%= gem_name %>
|
|
49
55
|
echo "Linting Ruby <%= ruby_version %>"
|
|
50
56
|
mise x -- bundle exec rake lint
|
|
51
57
|
- package: |
|
|
52
58
|
. ~/.buildenv
|
|
53
|
-
cd
|
|
59
|
+
cd <%= gem_name %>
|
|
54
60
|
mise x -- bundle exec rake build
|
data/tasks/sourcehut.rake
CHANGED
|
@@ -42,7 +42,9 @@ namespace :sourcehut do
|
|
|
42
42
|
rubies.each do |ruby_version|
|
|
43
43
|
filename = ".builds/ruby-#{ruby_version}.yml"
|
|
44
44
|
puts "Generating #{filename}..."
|
|
45
|
-
|
|
45
|
+
gem_name = spec.name
|
|
46
|
+
has_rust = File.exist?("ext/#{gem_name}/Cargo.toml")
|
|
47
|
+
content = erb.result_with_hash(ruby_version:, gem_name:, gem_filename:, bundler_version:, has_rust:)
|
|
46
48
|
File.write(filename, content)
|
|
47
49
|
end
|
|
48
50
|
end
|
data/tasks/website/index_page.rb
CHANGED
data/tasks/website/version.rb
CHANGED
data/tasks/website/website.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ratatui_ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.9.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kerrick Long
|
|
@@ -101,6 +101,8 @@ files:
|
|
|
101
101
|
- LICENSES/AGPL-3.0-or-later.txt
|
|
102
102
|
- LICENSES/CC-BY-SA-4.0.txt
|
|
103
103
|
- LICENSES/CC0-1.0.txt
|
|
104
|
+
- LICENSES/LGPL-3.0-or-later.txt
|
|
105
|
+
- LICENSES/MIT-0.txt
|
|
104
106
|
- LICENSES/MIT.txt
|
|
105
107
|
- README.md
|
|
106
108
|
- REUSE.toml
|
|
@@ -108,6 +110,7 @@ files:
|
|
|
108
110
|
- doc/concepts/application_architecture.md
|
|
109
111
|
- doc/concepts/application_testing.md
|
|
110
112
|
- doc/concepts/async.md
|
|
113
|
+
- doc/concepts/custom_widgets.md
|
|
111
114
|
- doc/concepts/event_handling.md
|
|
112
115
|
- doc/concepts/interactive_design.md
|
|
113
116
|
- doc/contributors/auditing/parity.md
|
|
@@ -116,6 +119,7 @@ files:
|
|
|
116
119
|
- doc/contributors/design/rust_backend.md
|
|
117
120
|
- doc/contributors/developing_examples.md
|
|
118
121
|
- doc/contributors/documentation_style.md
|
|
122
|
+
- doc/contributors/future_work.md
|
|
119
123
|
- doc/contributors/index.md
|
|
120
124
|
- doc/contributors/upstream_requests/tab_rects.md
|
|
121
125
|
- doc/contributors/upstream_requests/title_rects.md
|
|
@@ -159,7 +163,6 @@ files:
|
|
|
159
163
|
- doc/images/widget_tabs.png
|
|
160
164
|
- doc/images/widget_text_width.png
|
|
161
165
|
- doc/index.md
|
|
162
|
-
- doc/migration/v0_7_0.md
|
|
163
166
|
- doc/troubleshooting/debugging.md
|
|
164
167
|
- doc/troubleshooting/terminal_limitations.md
|
|
165
168
|
- doc/troubleshooting/tui_output.md
|
|
@@ -239,6 +242,7 @@ files:
|
|
|
239
242
|
- examples/widget_rect/app.rb
|
|
240
243
|
- examples/widget_render/README.md
|
|
241
244
|
- examples/widget_render/app.rb
|
|
245
|
+
- examples/widget_render/app.rbs
|
|
242
246
|
- examples/widget_rich_text/README.md
|
|
243
247
|
- examples/widget_rich_text/app.rb
|
|
244
248
|
- examples/widget_scroll_text/README.md
|
|
@@ -311,6 +315,7 @@ files:
|
|
|
311
315
|
- lib/ratatui_ruby/event/none.rb
|
|
312
316
|
- lib/ratatui_ruby/event/paste.rb
|
|
313
317
|
- lib/ratatui_ruby/event/resize.rb
|
|
318
|
+
- lib/ratatui_ruby/event/sync.rb
|
|
314
319
|
- lib/ratatui_ruby/frame.rb
|
|
315
320
|
- lib/ratatui_ruby/layout.rb
|
|
316
321
|
- lib/ratatui_ruby/layout/constraint.rb
|
|
@@ -351,6 +356,7 @@ files:
|
|
|
351
356
|
- lib/ratatui_ruby/scrollbar_state.rb
|
|
352
357
|
- lib/ratatui_ruby/style.rb
|
|
353
358
|
- lib/ratatui_ruby/style/style.rb
|
|
359
|
+
- lib/ratatui_ruby/synthetic_events.rb
|
|
354
360
|
- lib/ratatui_ruby/table_state.rb
|
|
355
361
|
- lib/ratatui_ruby/terminal_lifecycle.rb
|
|
356
362
|
- lib/ratatui_ruby/test_helper.rb
|
|
@@ -524,6 +530,12 @@ files:
|
|
|
524
530
|
- tasks/doc.rake
|
|
525
531
|
- tasks/example_viewer.html.erb
|
|
526
532
|
- tasks/extension.rake
|
|
533
|
+
- tasks/license.rake
|
|
534
|
+
- tasks/license/headers_md.rb
|
|
535
|
+
- tasks/license/headers_rb.rb
|
|
536
|
+
- tasks/license/license_utils.rb
|
|
537
|
+
- tasks/license/snippets_md.rb
|
|
538
|
+
- tasks/license/snippets_rdoc.rb
|
|
527
539
|
- tasks/lint.rake
|
|
528
540
|
- tasks/rdoc_config.rb
|
|
529
541
|
- tasks/resources/build.yml.erb
|
|
@@ -552,7 +564,7 @@ files:
|
|
|
552
564
|
- vendor/goodcop/base.yml
|
|
553
565
|
homepage: https://sr.ht/~kerrick/ratatui_ruby/
|
|
554
566
|
licenses:
|
|
555
|
-
-
|
|
567
|
+
- LGPL-3.0-or-later
|
|
556
568
|
metadata:
|
|
557
569
|
allowed_push_host: https://rubygems.org
|
|
558
570
|
homepage_uri: https://sr.ht/~kerrick/ratatui_ruby/
|
data/doc/migration/v0_7_0.md
DELETED
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
|
|
3
|
-
SPDX-License-Identifier: CC-BY-SA-4.0
|
|
4
|
-
-->
|
|
5
|
-
|
|
6
|
-
# Migrating to v0.7.0
|
|
7
|
-
|
|
8
|
-
v0.7.0 restructures the library to align with upstream Ratatui. For most users, this is a non-breaking change. For some, it is breaking.
|
|
9
|
-
|
|
10
|
-
## Are You Affected?
|
|
11
|
-
|
|
12
|
-
**If your code looks like this, you're fine:**
|
|
13
|
-
|
|
14
|
-
```ruby
|
|
15
|
-
RatatuiRuby.run do |tui|
|
|
16
|
-
tui.draw tui.paragraph(text: "Hello", block: tui.block(title: "Title"))
|
|
17
|
-
event = tui.poll_event
|
|
18
|
-
end
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
The TUI API method names are unchanged. Your application works without modification.
|
|
22
|
-
|
|
23
|
-
**If your code uses `highlight_style:` on Tables, rename it:**
|
|
24
|
-
|
|
25
|
-
```ruby
|
|
26
|
-
# Before (v0.6.0)
|
|
27
|
-
tui.table(rows: [...], highlight_style: tui.style(fg: :yellow))
|
|
28
|
-
|
|
29
|
-
# After (v0.7.0)
|
|
30
|
-
tui.table(rows: [...], row_highlight_style: tui.style(fg: :yellow))
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
This change aligns with Ratatui's API naming convention.
|
|
34
|
-
|
|
35
|
-
**If your code instantiates classes directly, you have work to do:**
|
|
36
|
-
|
|
37
|
-
```ruby
|
|
38
|
-
# These lines break in v0.7.0
|
|
39
|
-
paragraph = RatatuiRuby::Paragraph.new(text: "Hello")
|
|
40
|
-
style = RatatuiRuby::Style.new(fg: :red)
|
|
41
|
-
rect = RatatuiRuby::Rect.new(x: 0, y: 0, width: 10, height: 5)
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
The old flat namespace no longer exists. Classes moved into modules.
|
|
45
|
-
|
|
46
|
-
## Option 1: Use the TUI API (Recommended)
|
|
47
|
-
|
|
48
|
-
Switch to the TUI API. It hides namespace verbosity and provides IDE autocomplete.
|
|
49
|
-
|
|
50
|
-
```ruby
|
|
51
|
-
RatatuiRuby.run do |tui|
|
|
52
|
-
# All these work exactly as before
|
|
53
|
-
paragraph = tui.paragraph(text: "Hello")
|
|
54
|
-
style = tui.style(fg: :red)
|
|
55
|
-
rect = tui.rect(x: 0, y: 0, width: 10, height: 5)
|
|
56
|
-
constraint = tui.constraint_length(20)
|
|
57
|
-
|
|
58
|
-
# New in v0.7.0
|
|
59
|
-
cell = tui.table_cell(content: "Error", style: tui.style(bg: :red))
|
|
60
|
-
row = tui.table_row(cells: ["A", "B", "C"], style: tui.style(bg: :dark_gray))
|
|
61
|
-
end
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Option 2: Update to New Namespaces
|
|
65
|
-
|
|
66
|
-
If you prefer direct class instantiation, update to the new paths:
|
|
67
|
-
|
|
68
|
-
| Before | After |
|
|
69
|
-
|--------|-------|
|
|
70
|
-
| `RatatuiRuby::Rect` | `RatatuiRuby::Layout::Rect` |
|
|
71
|
-
| `RatatuiRuby::Constraint` | `RatatuiRuby::Layout::Constraint` |
|
|
72
|
-
| `RatatuiRuby::Layout` | `RatatuiRuby::Layout::Layout` |
|
|
73
|
-
| `RatatuiRuby::Style` | `RatatuiRuby::Style::Style` |
|
|
74
|
-
| `RatatuiRuby::Paragraph` | `RatatuiRuby::Widgets::Paragraph` |
|
|
75
|
-
| `RatatuiRuby::Block` | `RatatuiRuby::Widgets::Block` |
|
|
76
|
-
| `RatatuiRuby::Table` | `RatatuiRuby::Widgets::Table` |
|
|
77
|
-
| `RatatuiRuby::List` | `RatatuiRuby::Widgets::List` |
|
|
78
|
-
| `RatatuiRuby::Cell` | `RatatuiRuby::Buffer::Cell` |
|
|
79
|
-
| *(all other widgets)* | `RatatuiRuby::Widgets::*` |
|
|
80
|
-
|
|
81
|
-
### Bulk Migration
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
find . -name "*.rb" -exec sed -i '' \
|
|
85
|
-
's/RatatuiRuby::Rect/RatatuiRuby::Layout::Rect/g; \
|
|
86
|
-
s/RatatuiRuby::Constraint\./RatatuiRuby::Layout::Constraint./g; \
|
|
87
|
-
s/RatatuiRuby::Paragraph\.new/RatatuiRuby::Widgets::Paragraph.new/g; \
|
|
88
|
-
s/RatatuiRuby::Block\.new/RatatuiRuby::Widgets::Block.new/g; \
|
|
89
|
-
s/RatatuiRuby::List\.new/RatatuiRuby::Widgets::List.new/g; \
|
|
90
|
-
s/RatatuiRuby::Table\.new/RatatuiRuby::Widgets::Table.new/g; \
|
|
91
|
-
s/RatatuiRuby::Style\.new/RatatuiRuby::Style::Style.new/g; \
|
|
92
|
-
s/RatatuiRuby::Session/RatatuiRuby::TUI/g; \
|
|
93
|
-
s/highlight_style:/row_highlight_style:/g' {} \;
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Session → TUI Rename
|
|
97
|
-
|
|
98
|
-
The `Session` class is now `TUI`. If you reference it directly:
|
|
99
|
-
|
|
100
|
-
```ruby
|
|
101
|
-
# Before
|
|
102
|
-
tui = RatatuiRuby::Session.new
|
|
103
|
-
|
|
104
|
-
# After
|
|
105
|
-
tui = RatatuiRuby::TUI.new
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Most users never reference the class directly. The `|tui|` block parameter works unchanged.
|
|
109
|
-
|
|
110
|
-
## Table: highlight_style → row_highlight_style
|
|
111
|
-
|
|
112
|
-
The `highlight_style:` parameter on Table is now `row_highlight_style:`. This aligns with Ratatui's naming convention where `row_highlight_style`, `column_highlight_style`, and `cell_highlight_style` form a consistent trio.
|
|
113
|
-
|
|
114
|
-
```ruby
|
|
115
|
-
# Before (v0.6.0)
|
|
116
|
-
tui.table(
|
|
117
|
-
rows: data,
|
|
118
|
-
highlight_style: tui.style(fg: :yellow)
|
|
119
|
-
)
|
|
120
|
-
|
|
121
|
-
# After (v0.7.0)
|
|
122
|
-
tui.table(
|
|
123
|
-
rows: data,
|
|
124
|
-
row_highlight_style: tui.style(fg: :yellow)
|
|
125
|
-
)
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## Text::Line style Field
|
|
129
|
-
|
|
130
|
-
`Text::Line` now accepts a `style:` parameter for line-level styling. This matches Ratatui's `Line` struct.
|
|
131
|
-
|
|
132
|
-
```ruby
|
|
133
|
-
# New in v0.7.0: Line-level styling
|
|
134
|
-
line = tui.text_line(
|
|
135
|
-
spans: [tui.text_span(content: "Hello")],
|
|
136
|
-
style: tui.style(bg: :dark_gray) # Applied to entire line
|
|
137
|
-
)
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
Existing code without `style:` continues to work unchanged.
|
|
141
|
-
|
|
142
|
-
## New Table Cell and Row Classes
|
|
143
|
-
|
|
144
|
-
v0.7.0 adds `Widgets::Cell` and `Widgets::Row` for table construction with per-cell styling:
|
|
145
|
-
|
|
146
|
-
```ruby
|
|
147
|
-
table = tui.table(
|
|
148
|
-
rows: [
|
|
149
|
-
tui.table_row(
|
|
150
|
-
cells: [
|
|
151
|
-
tui.table_cell(content: "Name", style: tui.style(fg: :blue)),
|
|
152
|
-
"Value"
|
|
153
|
-
],
|
|
154
|
-
style: tui.style(bg: :dark_gray)
|
|
155
|
-
)
|
|
156
|
-
],
|
|
157
|
-
widths: [tui.constraint_length(20), tui.constraint_fill]
|
|
158
|
-
)
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
## Buffer::Cell vs Widgets::Cell
|
|
162
|
-
|
|
163
|
-
Two `Cell` classes now exist:
|
|
164
|
-
|
|
165
|
-
- **`Buffer::Cell`** — Terminal cell for inspection (returned by `get_cell_at`)
|
|
166
|
-
- **`Widgets::Cell`** — Table cell for construction (content + style wrapper)
|
|
167
|
-
|
|
168
|
-
```ruby
|
|
169
|
-
# Buffer inspection (unchanged)
|
|
170
|
-
cell = RatatuiRuby.get_cell_at(0, 0) # Returns Buffer::Cell
|
|
171
|
-
cell.char # => "X"
|
|
172
|
-
cell.fg # => :red
|
|
173
|
-
|
|
174
|
-
# Table cell construction (new)
|
|
175
|
-
cell = tui.table_cell(content: "Error", style: tui.style(bg: :red))
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
## Why This Change?
|
|
179
|
-
|
|
180
|
-
The old flat namespace caused name collisions (`Cell` for buffers vs. tables) and diverged from Ratatui's module structure. The new hierarchy:
|
|
181
|
-
|
|
182
|
-
- Maps 1:1 to Ratatui documentation
|
|
183
|
-
- Prevents future collisions
|
|
184
|
-
- Enables IDE autocomplete via explicit TUI methods
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
## For LLMs
|
|
189
|
-
|
|
190
|
-
Copy the following prompt to your AI assistant to help migrate your `ratatui_ruby` application from v0.6.0 to v0.7.0.
|
|
191
|
-
|
|
192
|
-
````markdown
|
|
193
|
-
I'm migrating a Ruby TUI application from `ratatui_ruby` v0.6.0 to v0.7.0. The library restructured its namespaces. Apply these transformations:
|
|
194
|
-
|
|
195
|
-
**Namespace Changes:**
|
|
196
|
-
- `RatatuiRuby::Rect` → `RatatuiRuby::Layout::Rect`
|
|
197
|
-
- `RatatuiRuby::Constraint` → `RatatuiRuby::Layout::Constraint`
|
|
198
|
-
- `RatatuiRuby::Layout` → `RatatuiRuby::Layout::Layout`
|
|
199
|
-
- `RatatuiRuby::Style` → `RatatuiRuby::Style::Style`
|
|
200
|
-
- `RatatuiRuby::Paragraph` → `RatatuiRuby::Widgets::Paragraph`
|
|
201
|
-
- `RatatuiRuby::Block` → `RatatuiRuby::Widgets::Block`
|
|
202
|
-
- `RatatuiRuby::Table` → `RatatuiRuby::Widgets::Table`
|
|
203
|
-
- `RatatuiRuby::List` → `RatatuiRuby::Widgets::List`
|
|
204
|
-
- `RatatuiRuby::Cell` → `RatatuiRuby::Buffer::Cell`
|
|
205
|
-
- All other widgets: `RatatuiRuby::X` → `RatatuiRuby::Widgets::X`
|
|
206
|
-
|
|
207
|
-
**Class Rename:**
|
|
208
|
-
- `RatatuiRuby::Session` → `RatatuiRuby::TUI`
|
|
209
|
-
|
|
210
|
-
**Parameter Rename:**
|
|
211
|
-
- `Table` `highlight_style:` → `row_highlight_style:`
|
|
212
|
-
|
|
213
|
-
**Preferred Approach:** Convert direct class instantiation to TUI API:
|
|
214
|
-
```ruby
|
|
215
|
-
# Instead of:
|
|
216
|
-
RatatuiRuby::Widgets::Paragraph.new(text: "Hello")
|
|
217
|
-
|
|
218
|
-
# Use:
|
|
219
|
-
tui.paragraph(text: "Hello")
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
**TUI API method names are unchanged.** Code using `tui.paragraph(...)`, `tui.block(...)`, `tui.style(...)` etc. works without modification.
|
|
223
|
-
|
|
224
|
-
**Cell Disambiguation:**
|
|
225
|
-
- `Buffer::Cell` — Terminal cell for inspection (returned by `get_cell_at`)
|
|
226
|
-
- `Widgets::Cell` — Table cell for construction (use `tui.table_cell`)
|
|
227
|
-
- The old `RatatuiRuby::Cell` is now `RatatuiRuby::Buffer::Cell`
|
|
228
|
-
|
|
229
|
-
**New in v0.7.0:**
|
|
230
|
-
- `tui.table_cell(content:, style:)` — styled table cells
|
|
231
|
-
- `tui.table_row(cells:, style:, height:)` — styled table rows
|
|
232
|
-
- `Text::Line` now accepts `style:` parameter
|
|
233
|
-
|
|
234
|
-
Please update my code following these rules.
|
|
235
|
-
````
|
|
236
|
-
|