ratatui_ruby 1.0.0 → 1.0.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.
Files changed (236) hide show
  1. checksums.yaml +4 -4
  2. data/ext/ratatui_ruby/Cargo.lock +1 -1
  3. data/ext/ratatui_ruby/Cargo.toml +1 -1
  4. data/lib/ratatui_ruby/version.rb +1 -1
  5. metadata +1 -232
  6. data/.builds/ruby-3.2.yml +0 -54
  7. data/.builds/ruby-3.3.yml +0 -54
  8. data/.builds/ruby-3.4.yml +0 -54
  9. data/.builds/ruby-4.0.0.yml +0 -54
  10. data/.pre-commit-config.yaml +0 -16
  11. data/.rubocop.yml +0 -10
  12. data/AGENTS.md +0 -146
  13. data/CHANGELOG.md +0 -710
  14. data/README.md +0 -187
  15. data/README.rdoc +0 -302
  16. data/Rakefile +0 -11
  17. data/Steepfile +0 -49
  18. data/doc/concepts/application_architecture.md +0 -321
  19. data/doc/concepts/application_testing.md +0 -193
  20. data/doc/concepts/async.md +0 -190
  21. data/doc/concepts/custom_widgets.md +0 -247
  22. data/doc/concepts/debugging.md +0 -401
  23. data/doc/concepts/event_handling.md +0 -162
  24. data/doc/concepts/interactive_design.md +0 -146
  25. data/doc/contributors/auditing/parity.md +0 -239
  26. data/doc/contributors/design/ruby_frontend.md +0 -420
  27. data/doc/contributors/design/rust_backend.md +0 -422
  28. data/doc/contributors/design.md +0 -11
  29. data/doc/contributors/developing_examples.md +0 -400
  30. data/doc/contributors/documentation_style.md +0 -121
  31. data/doc/contributors/index.md +0 -21
  32. data/doc/contributors/todo/align/api_completeness_audit-finished.md +0 -375
  33. data/doc/contributors/todo/align/api_completeness_audit-unfinished.md +0 -206
  34. data/doc/contributors/todo/align/terminal.md +0 -647
  35. data/doc/contributors/todo/future_work.md +0 -169
  36. data/doc/contributors/upstream_requests/tab_rects.md +0 -173
  37. data/doc/contributors/upstream_requests/title_rects.md +0 -132
  38. data/doc/custom.css +0 -22
  39. data/doc/getting_started/quickstart.md +0 -291
  40. data/doc/getting_started/why.md +0 -93
  41. data/doc/images/app_all_events.png +0 -0
  42. data/doc/images/app_cli_rich_moments.gif +0 -0
  43. data/doc/images/app_color_picker.png +0 -0
  44. data/doc/images/app_debugging_showcase.gif +0 -0
  45. data/doc/images/app_debugging_showcase.png +0 -0
  46. data/doc/images/app_login_form.png +0 -0
  47. data/doc/images/app_stateful_interaction.png +0 -0
  48. data/doc/images/verify_quickstart_dsl.png +0 -0
  49. data/doc/images/verify_quickstart_layout.png +0 -0
  50. data/doc/images/verify_quickstart_lifecycle.png +0 -0
  51. data/doc/images/verify_readme_usage.png +0 -0
  52. data/doc/images/widget_barchart.png +0 -0
  53. data/doc/images/widget_block.png +0 -0
  54. data/doc/images/widget_box.png +0 -0
  55. data/doc/images/widget_calendar.png +0 -0
  56. data/doc/images/widget_canvas.png +0 -0
  57. data/doc/images/widget_cell.png +0 -0
  58. data/doc/images/widget_center.png +0 -0
  59. data/doc/images/widget_chart.png +0 -0
  60. data/doc/images/widget_gauge.png +0 -0
  61. data/doc/images/widget_layout_split.png +0 -0
  62. data/doc/images/widget_line_gauge.png +0 -0
  63. data/doc/images/widget_list.png +0 -0
  64. data/doc/images/widget_map.png +0 -0
  65. data/doc/images/widget_overlay.png +0 -0
  66. data/doc/images/widget_popup.png +0 -0
  67. data/doc/images/widget_ratatui_logo.png +0 -0
  68. data/doc/images/widget_ratatui_mascot.png +0 -0
  69. data/doc/images/widget_rect.png +0 -0
  70. data/doc/images/widget_render.png +0 -0
  71. data/doc/images/widget_rich_text.png +0 -0
  72. data/doc/images/widget_scroll_text.png +0 -0
  73. data/doc/images/widget_scrollbar.png +0 -0
  74. data/doc/images/widget_sparkline.png +0 -0
  75. data/doc/images/widget_style_colors.png +0 -0
  76. data/doc/images/widget_table.png +0 -0
  77. data/doc/images/widget_tabs.png +0 -0
  78. data/doc/images/widget_text_width.png +0 -0
  79. data/doc/index.md +0 -39
  80. data/doc/troubleshooting/async.md +0 -4
  81. data/doc/troubleshooting/terminal_limitations.md +0 -131
  82. data/doc/troubleshooting/tui_output.md +0 -197
  83. data/examples/app_all_events/README.md +0 -114
  84. data/examples/app_all_events/app.rb +0 -98
  85. data/examples/app_all_events/model/app_model.rb +0 -159
  86. data/examples/app_all_events/model/event_color_cycle.rb +0 -43
  87. data/examples/app_all_events/model/event_entry.rb +0 -94
  88. data/examples/app_all_events/model/msg.rb +0 -39
  89. data/examples/app_all_events/model/timestamp.rb +0 -56
  90. data/examples/app_all_events/update.rb +0 -75
  91. data/examples/app_all_events/view/app_view.rb +0 -80
  92. data/examples/app_all_events/view/controls_view.rb +0 -54
  93. data/examples/app_all_events/view/counts_view.rb +0 -61
  94. data/examples/app_all_events/view/live_view.rb +0 -72
  95. data/examples/app_all_events/view/log_view.rb +0 -57
  96. data/examples/app_all_events/view.rb +0 -9
  97. data/examples/app_cli_rich_moments/README.md +0 -81
  98. data/examples/app_cli_rich_moments/app.rb +0 -189
  99. data/examples/app_color_picker/README.md +0 -156
  100. data/examples/app_color_picker/app.rb +0 -76
  101. data/examples/app_color_picker/clipboard.rb +0 -86
  102. data/examples/app_color_picker/color.rb +0 -193
  103. data/examples/app_color_picker/controls.rb +0 -92
  104. data/examples/app_color_picker/copy_dialog.rb +0 -168
  105. data/examples/app_color_picker/export_pane.rb +0 -128
  106. data/examples/app_color_picker/harmony.rb +0 -58
  107. data/examples/app_color_picker/input.rb +0 -176
  108. data/examples/app_color_picker/main_container.rb +0 -180
  109. data/examples/app_color_picker/palette.rb +0 -111
  110. data/examples/app_debugging_showcase/README.md +0 -119
  111. data/examples/app_debugging_showcase/app.rb +0 -318
  112. data/examples/app_login_form/README.md +0 -58
  113. data/examples/app_login_form/app.rb +0 -109
  114. data/examples/app_stateful_interaction/README.md +0 -35
  115. data/examples/app_stateful_interaction/app.rb +0 -328
  116. data/examples/timeout_demo.rb +0 -45
  117. data/examples/verify_quickstart_dsl/README.md +0 -55
  118. data/examples/verify_quickstart_dsl/app.rb +0 -49
  119. data/examples/verify_quickstart_layout/README.md +0 -77
  120. data/examples/verify_quickstart_layout/app.rb +0 -73
  121. data/examples/verify_quickstart_lifecycle/README.md +0 -68
  122. data/examples/verify_quickstart_lifecycle/app.rb +0 -62
  123. data/examples/verify_readme_usage/README.md +0 -49
  124. data/examples/verify_readme_usage/app.rb +0 -42
  125. data/examples/verify_website_managed/README.md +0 -48
  126. data/examples/verify_website_managed/app.rb +0 -36
  127. data/examples/verify_website_menu/README.md +0 -60
  128. data/examples/verify_website_menu/app.rb +0 -84
  129. data/examples/verify_website_spinner/README.md +0 -44
  130. data/examples/verify_website_spinner/app.rb +0 -34
  131. data/examples/widget_barchart/README.md +0 -58
  132. data/examples/widget_barchart/app.rb +0 -240
  133. data/examples/widget_block/README.md +0 -44
  134. data/examples/widget_block/app.rb +0 -258
  135. data/examples/widget_box/README.md +0 -54
  136. data/examples/widget_box/app.rb +0 -255
  137. data/examples/widget_calendar/README.md +0 -48
  138. data/examples/widget_calendar/app.rb +0 -115
  139. data/examples/widget_canvas/README.md +0 -31
  140. data/examples/widget_canvas/app.rb +0 -130
  141. data/examples/widget_cell/README.md +0 -45
  142. data/examples/widget_cell/app.rb +0 -112
  143. data/examples/widget_center/README.md +0 -33
  144. data/examples/widget_center/app.rb +0 -118
  145. data/examples/widget_chart/README.md +0 -50
  146. data/examples/widget_chart/app.rb +0 -220
  147. data/examples/widget_gauge/README.md +0 -50
  148. data/examples/widget_gauge/app.rb +0 -229
  149. data/examples/widget_layout_split/README.md +0 -53
  150. data/examples/widget_layout_split/app.rb +0 -260
  151. data/examples/widget_line_gauge/README.md +0 -50
  152. data/examples/widget_line_gauge/app.rb +0 -219
  153. data/examples/widget_list/README.md +0 -58
  154. data/examples/widget_list/app.rb +0 -384
  155. data/examples/widget_map/README.md +0 -48
  156. data/examples/widget_map/app.rb +0 -95
  157. data/examples/widget_overlay/README.md +0 -45
  158. data/examples/widget_overlay/app.rb +0 -250
  159. data/examples/widget_popup/README.md +0 -45
  160. data/examples/widget_popup/app.rb +0 -106
  161. data/examples/widget_ratatui_logo/README.md +0 -43
  162. data/examples/widget_ratatui_logo/app.rb +0 -104
  163. data/examples/widget_ratatui_mascot/README.md +0 -43
  164. data/examples/widget_ratatui_mascot/app.rb +0 -95
  165. data/examples/widget_rect/README.md +0 -53
  166. data/examples/widget_rect/app.rb +0 -222
  167. data/examples/widget_render/README.md +0 -46
  168. data/examples/widget_render/app.rb +0 -186
  169. data/examples/widget_render/app.rbs +0 -41
  170. data/examples/widget_rich_text/README.md +0 -44
  171. data/examples/widget_rich_text/app.rb +0 -193
  172. data/examples/widget_scroll_text/README.md +0 -46
  173. data/examples/widget_scroll_text/app.rb +0 -109
  174. data/examples/widget_scrollbar/README.md +0 -46
  175. data/examples/widget_scrollbar/app.rb +0 -155
  176. data/examples/widget_sparkline/README.md +0 -51
  177. data/examples/widget_sparkline/app.rb +0 -277
  178. data/examples/widget_style_colors/README.md +0 -43
  179. data/examples/widget_style_colors/app.rb +0 -83
  180. data/examples/widget_table/README.md +0 -57
  181. data/examples/widget_table/app.rb +0 -279
  182. data/examples/widget_tabs/README.md +0 -50
  183. data/examples/widget_tabs/app.rb +0 -183
  184. data/examples/widget_text_width/README.md +0 -44
  185. data/examples/widget_text_width/app.rb +0 -117
  186. data/migrate_to_buffer.rb +0 -145
  187. data/mise.toml +0 -8
  188. data/tasks/autodoc/examples.rb +0 -87
  189. data/tasks/autodoc/member.rb +0 -58
  190. data/tasks/autodoc/name.rb +0 -21
  191. data/tasks/autodoc.rake +0 -21
  192. data/tasks/bump/cargo_lockfile.rb +0 -21
  193. data/tasks/bump/changelog.rb +0 -47
  194. data/tasks/bump/header.rb +0 -32
  195. data/tasks/bump/history.rb +0 -32
  196. data/tasks/bump/links.rb +0 -69
  197. data/tasks/bump/manifest.rb +0 -33
  198. data/tasks/bump/ruby_gem.rb +0 -49
  199. data/tasks/bump/sem_ver.rb +0 -40
  200. data/tasks/bump/unreleased_section.rb +0 -56
  201. data/tasks/bump.rake +0 -51
  202. data/tasks/doc.rake +0 -887
  203. data/tasks/example_viewer.html.erb +0 -172
  204. data/tasks/extension.rake +0 -14
  205. data/tasks/license/headers_md.rb +0 -223
  206. data/tasks/license/headers_rb.rb +0 -210
  207. data/tasks/license/license_utils.rb +0 -130
  208. data/tasks/license/snippets_md.rb +0 -315
  209. data/tasks/license/snippets_rdoc.rb +0 -150
  210. data/tasks/license.rake +0 -91
  211. data/tasks/lint.rake +0 -170
  212. data/tasks/rdoc_config.rb +0 -29
  213. data/tasks/resources/build.yml.erb +0 -60
  214. data/tasks/resources/index.html.erb +0 -141
  215. data/tasks/resources/rubies.yml +0 -7
  216. data/tasks/sourcehut.rake +0 -110
  217. data/tasks/steep.rake +0 -11
  218. data/tasks/terminal_preview/app_screenshot.rb +0 -45
  219. data/tasks/terminal_preview/crash_report.rb +0 -54
  220. data/tasks/terminal_preview/example_app.rb +0 -27
  221. data/tasks/terminal_preview/launcher_script.rb +0 -48
  222. data/tasks/terminal_preview/preview_collection.rb +0 -60
  223. data/tasks/terminal_preview/preview_timing.rb +0 -24
  224. data/tasks/terminal_preview/safety_confirmation.rb +0 -58
  225. data/tasks/terminal_preview/saved_screenshot.rb +0 -56
  226. data/tasks/terminal_preview/system_appearance.rb +0 -13
  227. data/tasks/terminal_preview/terminal_window.rb +0 -138
  228. data/tasks/terminal_preview/window_id.rb +0 -16
  229. data/tasks/terminal_preview.rake +0 -30
  230. data/tasks/test.rake +0 -33
  231. data/tasks/website/index_page.rb +0 -30
  232. data/tasks/website/version.rb +0 -127
  233. data/tasks/website/version_menu.rb +0 -68
  234. data/tasks/website/versioned_documentation.rb +0 -83
  235. data/tasks/website/website.rb +0 -53
  236. data/tasks/website.rake +0 -28
data/README.md DELETED
@@ -1,187 +0,0 @@
1
- <!--
2
- SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
3
- SPDX-License-Identifier: CC-BY-SA-4.0
4
- -->
5
- # ratatui_ruby
6
-
7
- [![
8
- builds.sr.ht status](https://builds.sr.ht/~kerrick/ratatui_ruby.svg)](https://builds.sr.ht/~kerrick/ratatui_ruby?) [![
9
- License](https://img.shields.io/badge/dynamic/regex?url=https%3A%2F%2Fgit.sr.ht%2F~kerrick%2Fratatui_ruby%2Fblob%2Fstable%2Fratatui_ruby.gemspec&search=spec%5C.license%20%3D%20%22(.*)%22&replace=%241&label=License&color=a2c93e)](https://spdx.org/licenses/AGPL-3.0-or-later.html) [![
10
- Gem Total Downloads](https://img.shields.io/gem/dt/ratatui_ruby)](https://rubygems.org/gems/ratatui_ruby) [![
11
- Gem Version](https://img.shields.io/gem/v/ratatui_ruby)](https://rubygems.org/gems/ratatui_ruby) [![
12
- Ratatui Version](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fgit.sr.ht%2F~kerrick%2Fratatui_ruby%2Fblob%2Fstable%2Fext%2Fratatui_ruby%2FCargo.toml&query=%24.dependencies.ratatui.version&prefix=v&logo=ratatui&label=Ratatui)](https://crates.io/crates/ratatui/0.30) [![
13
- Mailing List: Discussion](https://img.shields.io/badge/mailing_list-discussion-5865F2.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iaWNvbiBpY29uLXRhYmxlciBpY29ucy10YWJsZXItb3V0bGluZSBpY29uLXRhYmxlci1tYWlsIj48cGF0aCBzdHJva2U9Im5vbmUiIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz48cGF0aCBkPSJNMyA3YTIgMiAwIDAgMSAyIC0yaDE0YTIgMiAwIDAgMSAyIDJ2MTBhMiAyIDAgMCAxIC0yIDJoLTE0YTIgMiAwIDAgMSAtMiAtMnYtMTB6IiAvPjxwYXRoIGQ9Ik0zIDdsOSA2bDkgLTYiIC8+PC9zdmc+Cg==)](https://lists.sr.ht/~kerrick/ratatui_ruby-discuss) [![
14
- Mailing List: Development](https://img.shields.io/badge/mailing_list-development-4954d5.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iaWNvbiBpY29uLXRhYmxlciBpY29ucy10YWJsZXItb3V0bGluZSBpY29uLXRhYmxlci1tYWlsIj48cGF0aCBzdHJva2U9Im5vbmUiIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz48cGF0aCBkPSJNMyA3YTIgMiAwIDAgMSAyIC0yaDE0YTIgMiAwIDAgMSAyIDJ2MTBhMiAyIDAgMCAxIC0yIDJoLTE0YTIgMiAwIDAgMSAtMiAtMnYtMTB6IiAvPjxwYXRoIGQ9Ik0zIDdsOSA2bDkgLTYiIC8+PC9zdmc+Cg==)](https://lists.sr.ht/~kerrick/ratatui_ruby-devel) [![
15
- Mailing List: Announcements](https://img.shields.io/badge/mailing_list-announcements-3b44ac.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iaWNvbiBpY29uLXRhYmxlciBpY29ucy10YWJsZXItb3V0bGluZSBpY29uLXRhYmxlci1tYWlsIj48cGF0aCBzdHJva2U9Im5vbmUiIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz48cGF0aCBkPSJNMyA3YTIgMiAwIDAgMSAyIC0yaDE0YTIgMiAwIDAgMSAyIDJ2MTBhMiAyIDAgMCAxIC0yIDJoLTE0YTIgMiAwIDAgMSAtMiAtMnYtMTB6IiAvPjxwYXRoIGQ9Ik0zIDdsOSA2bDkgLTYiIC8+PC9zdmc+Cg==)](https://lists.sr.ht/~kerrick/ratatui_ruby-announce)
16
-
17
-
18
- ## Introduction
19
-
20
- **ratatui_ruby** is a Ruby wrapper for [Ratatui](https://ratatui.rs). It allows you to cook up Terminal User Interfaces in Ruby.
21
- **ratatui_ruby** is a community wrapper that is not affiliated with [the Ratatui team](https://github.com/orgs/ratatui/people).
22
-
23
- **[Why RatatuiRuby?](./doc/getting_started/why.md)** — Native Rust performance, zero runtime overhead, and Ruby's expressiveness. [See how we compare](./doc/getting_started/why.md) to CharmRuby, raw Rust, and Go.
24
-
25
- Please join the **announce** mailing list at https://lists.sr.ht/~kerrick/ratatui_ruby-announce to stay up-to-date on new releases and announcements. See the [`trunk` branch](https://git.sr.ht/~kerrick/ratatui_ruby/tree/trunk) for pre-release updates.
26
-
27
- ---
28
-
29
- ## Quick Links
30
-
31
- ### The Ecosystem
32
-
33
- **RatatuiRuby:** [Core engine](https://git.sr.ht/~kerrick/ratatui_ruby) • **Tea:** [MVU architecture](https://git.sr.ht/~kerrick/ratatui_ruby-tea) • **Kit:** [Component architecture](https://git.sr.ht/~kerrick/ratatui_ruby-kit) (Planned) • **DSL:** [Glimmer syntax](https://sr.ht/~kerrick/ratatui_ruby/#chapter-4-the-syntax) (Planned) • **Framework:** [Omakase framework](https://git.sr.ht/~kerrick/ratatui_ruby-framework) (Planned) • **UI:** [Polished widgets](https://git.sr.ht/~kerrick/ratatui_ruby-ui) (Planned) • **UI Pro:** [More polished widgets](https://sr.ht/~kerrick/ratatui_ruby#chapter-6-licensing) (Planned)
34
-
35
- ### For App Developers
36
-
37
- **Get Started:** [Quickstart](https://git.sr.ht/~kerrick/ratatui_ruby/tree/stable/item/doc/getting_started/quickstart.md) • [Examples](https://git.sr.ht/~kerrick/ratatui_ruby/tree/stable/item/examples) ⸺ **Stay Informed:** [Announce List](https://lists.sr.ht/~kerrick/ratatui_ruby-announce) • [FAQ](https://man.sr.ht/~kerrick/ratatui_ruby/troubleshooting.md) ⸺ **Reach Out:** [Discuss List](https://lists.sr.ht/~kerrick/ratatui_ruby-discuss) • [Bug Tracker](https://todo.sr.ht/~kerrick/ratatui_ruby)
38
-
39
- ### For Contributors
40
-
41
- **Get Started:** [Contributing Guide](https://man.sr.ht/~kerrick/ratatui_ruby/contributing.md) • [Code of Conduct](https://man.sr.ht/~kerrick/ratatui_ruby/code_of_conduct.md) ⸺ **Stay Informed:** [Announce List](https://lists.sr.ht/~kerrick/ratatui_ruby-announce) • [Project History](https://man.sr.ht/~kerrick/ratatui_ruby/history/index.md) ⸺ **Reach Out:** [Development List](https://lists.sr.ht/~kerrick/ratatui_ruby-devel) • [Bug Tracker](https://todo.sr.ht/~kerrick/ratatui_ruby)
42
-
43
- ---
44
-
45
- ## Compatibility
46
-
47
- **ratatui_ruby** is designed to run on [everything Ruby does](https://www.ruby-lang.org/en/documentation/installation/), including:
48
-
49
- - GNU/Linux, macOS, Windows, OpenBSD, and FreeBSD; and
50
- - x86_64 (AMD, Intel) and ARM (Apple Silicon, Raspberry Pi).
51
-
52
- We support the latest minor version of every
53
- [non-eol Ruby version](https://www.ruby-lang.org/en/downloads/branches/),
54
- including Ruby 4.
55
-
56
-
57
- ## Installation
58
-
59
- Add this line to your application's Gemfile:
60
-
61
- <!-- SPDX-SnippetBegin -->
62
- <!--
63
- SPDX-FileCopyrightText: 2025 Kerrick Long
64
- SPDX-License-Identifier: MIT-0
65
- -->
66
- ```ruby
67
- gem "ratatui_ruby"
68
- ```
69
- <!-- SPDX-SnippetEnd -->
70
-
71
- And then execute:
72
-
73
- <!-- SPDX-SnippetBegin -->
74
- <!--
75
- SPDX-FileCopyrightText: 2025 Kerrick Long
76
- SPDX-License-Identifier: MIT-0
77
- -->
78
- ```bash
79
- bundle install
80
- ```
81
- <!-- SPDX-SnippetEnd -->
82
-
83
- Or install it yourself with:
84
-
85
- <!-- SPDX-SnippetBegin -->
86
- <!--
87
- SPDX-FileCopyrightText: 2025 Kerrick Long
88
- SPDX-License-Identifier: MIT-0
89
- -->
90
- ```bash
91
- gem install ratatui_ruby
92
- ```
93
- <!-- SPDX-SnippetEnd -->
94
-
95
-
96
- ## Usage
97
-
98
- **ratatui_ruby** uses an immediate-mode API. You describe your UI using Ruby objects and call `draw` in a loop.
99
-
100
- <!-- SPDX-SnippetBegin -->
101
- <!--
102
- SPDX-FileCopyrightText: 2026 Kerrick Long
103
- SPDX-License-Identifier: MIT-0
104
- -->
105
- <!-- SYNC:START:examples/verify_readme_usage/app.rb:main -->
106
- ```ruby
107
- RatatuiRuby.run do |tui|
108
- loop do
109
- tui.draw do |frame|
110
- frame.render_widget(
111
- tui.paragraph(
112
- text: "Hello, Ratatui! Press 'q' to quit.",
113
- alignment: :center,
114
- block: tui.block(
115
- title: "My Ruby TUI App",
116
- borders: [:all],
117
- border_style: { fg: "cyan" }
118
- )
119
- ),
120
- frame.area
121
- )
122
- end
123
- case tui.poll_event
124
- in { type: :key, code: "q" } | { type: :key, code: "c", modifiers: ["ctrl"] }
125
- break
126
- else
127
- nil
128
- end
129
- end
130
- end
131
- ```
132
- <!-- SYNC:END -->
133
- <!-- SPDX-SnippetEnd -->
134
-
135
- ![Hello Ratatui](./doc/images/verify_readme_usage.png)
136
-
137
- For a full tutorial, see [the Quickstart](./doc/getting_started/quickstart.md). For an explanation of the application architecture, see [Application Architecture](./doc/concepts/application_architecture.md).
138
-
139
-
140
- ## Features
141
-
142
- **ratatui_ruby** gives you 20+ widgets out of the box:
143
-
144
- | Category | Widgets |
145
- |----------|---------|
146
- | **Data Display** | Table, List, Chart, Bar Chart, Sparkline, Calendar |
147
- | **Layout** | Block, Tabs, Scrollbar, Center, Overlay, Clear |
148
- | **Input** | Gauge, Line Gauge |
149
- | **Text** | Paragraph, Rich Text (Spans + Lines), Cursor |
150
- | **Canvas** | Shapes (Line, Circle, Rectangle, Map), Custom Drawing |
151
-
152
- Plus: flexible layouts with constraints, full keyboard/mouse/paste/resize events, snapshot testing, and hex/RGB/256-color support.
153
-
154
-
155
- ## Documentation
156
-
157
- | Resource | Description |
158
- |----------|-------------|
159
- | [Quickstart](./doc/getting_started/quickstart.md) | Get running in 5 minutes |
160
- | [Widget Gallery](./doc/getting_started/quickstart.md#widget-demos) | Every widget with examples |
161
- | [Application Architecture](./doc/concepts/application_architecture.md) | Patterns for scaling your app |
162
- | [API Reference](./doc/index.md) | Full RDoc documentation |
163
- | [Wiki](https://man.sr.ht/~kerrick/ratatui_ruby) | Guides and community resources |
164
-
165
-
166
- ## Contributing
167
-
168
- Bug reports and pull requests are welcome on [sourcehut](https://sourcehut.org) at https://sr.ht/~kerrick/ratatui_ruby/. This project is intended to be a safe, productive collaboration, and contributors are expected to adhere to the [Code of Conduct](https://man.sr.ht/~kerrick/ratatui_ruby/code_of_conduct.md).
169
-
170
- Issues for the underlying Rust library should be filed at [ratatui/ratatui](https://github.com/ratatui/ratatui).
171
-
172
- Want to help develop **ratatui_ruby**? Check out the [contribution guide on the wiki](https://man.sr.ht/~kerrick/ratatui_ruby/contributing.md).
173
-
174
- **Note**: Active development happens on the `trunk` branch. Use `trunk` if you are a contributor or want the latest cutting-edge features. `stable` is for stable releases only.
175
-
176
-
177
- ## Copyright & License
178
-
179
- **ratatui_ruby** is copyright 2025, Kerrick Long.
180
-
181
- The library is [LGPL-3.0-or-later](./LICENSES/LGPL-3.0-or-later.txt): you can use it in proprietary applications, but you must share changes you make to **ratatui_ruby** itself. Documentation snippets and widget examples are [MIT-0](./LICENSES/MIT-0.txt): copy and use them without attribution.
182
-
183
- Documentation is [CC-BY-SA-4.0](./LICENSES/CC-BY-SA-4.0.txt). Build tooling and full app examples are [AGPL-3.0-or-later](./LICENSES/AGPL-3.0-or-later.txt). See each file's SPDX comment for specifics.
184
-
185
- Some parts of this program are copied from other sources under appropriate reuse licenses, and the copyright belongs to their respective owners. See the [REUSE Specification – Version 3.3](https://reuse.software/spec-3.3/) for details.
186
-
187
- This program was created with significant assistance from multiple LLMs. The process was human-controlled through creative prompts, with human contributions to each commit. See commit footers for model attribution. [declare-ai.org](https://declare-ai.org/1.0.0/creative.html)
data/README.rdoc DELETED
@@ -1,302 +0,0 @@
1
-
2
- == Terminal UIs, the Ruby Way
3
-
4
- RatatuiRuby[https://rubygems.org/gems/ratatui_ruby] is a RubyGem built on
5
- Ratatui[https://ratatui.rs], a leading TUI library written in
6
- Rust[https://rust-lang.org]. You get native performance with the joy of Ruby.
7
-
8
- gem install ratatui_ruby
9
-
10
- {rdoc-image:https://ratatui-ruby.dev/hero.gif}[https://www.ratatui-ruby.dev/docs/v0.10/examples/app_cli_rich_moments/README_md.html]
11
-
12
- === Rich Moments
13
-
14
- Add a spinner, a progress bar, or an inline menu to your CLI script. No
15
- full-screen takeover. Your terminal history stays intact.
16
-
17
- ==== Inline Viewports
18
-
19
- Standard TUIs erase themselves on exit. Your carefully formatted CLI output
20
- disappears. Users lose their scrollback.
21
-
22
- <b>Inline viewports</b> solve this. They occupy a fixed number of lines, render
23
- rich UI, then leave the output in place when done.
24
-
25
- Perfect for spinners, menus, progress indicators—any brief moment of richness.
26
-
27
- require "ratatui_ruby"
28
-
29
- RatatuiRuby.run(viewport: :inline, height: 1) do |tui|
30
- until connected?
31
- status = tui.paragraph(text: "\#{spin} Connecting...")
32
- tui.draw { |frame| frame.render_widget(status, frame.area) }
33
- end
34
- end
35
-
36
- === Build Something Real
37
-
38
- Full-screen applications with {keyboard and mouse input}[https://www.ratatui-ruby.dev/docs/v0.10/examples/app_all_events/README_md.html]. The managed loop
39
- sets up the terminal and restores it on exit, even after crashes.
40
-
41
- RatatuiRuby.run do |tui|
42
- loop do
43
- tui.draw do |frame|
44
- frame.render_widget(
45
- tui.paragraph(text: "Hello, RatatuiRuby!", alignment: :center),
46
- frame.area
47
- )
48
- end
49
-
50
- case tui.poll_event
51
- in { type: :key, code: "q" } then break
52
- else nil
53
- end
54
- end
55
- end
56
-
57
- ==== Widgets included:
58
-
59
- [Layout]
60
- {Block}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_block/README_md.html],
61
- {Center}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_center/README_md.html],
62
- {Clear (Popup, Modal)}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_popup/README_md.html],
63
- {Layout (Split, Grid)}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_layout_split/README_md.html],
64
- {Overlay}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_overlay/README_md.html]
65
- [Data]
66
- {Bar Chart}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_barchart/README_md.html],
67
- {Chart}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_chart/README_md.html],
68
- {Gauge}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_gauge/README_md.html],
69
- {Line Gauge}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_line_gauge/README_md.html],
70
- {Sparkline}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_sparkline/README_md.html],
71
- {Table}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_table/README_md.html]
72
- [Text]
73
- {Cell}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_cell/README_md.html],
74
- {List}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_list/README_md.html],
75
- {Rich Text (Line, Span)}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_rich_text/README_md.html],
76
- {Scrollbar (Scroll)}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_scrollbar/README_md.html],
77
- {Tabs}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_tabs/README_md.html]
78
- [Graphics]
79
- {Calendar}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_calendar/README_md.html],
80
- {Canvas}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_canvas/README_md.html],
81
- {Map (World Map)}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_map/README_md.html]
82
-
83
- Need something else? {Build custom widgets}[https://www.ratatui-ruby.dev/docs/v0.10/doc/concepts/custom_widgets_md.html] in Ruby!
84
-
85
-
86
- ---
87
-
88
- === Testing Built In
89
-
90
- TUI testing is tedious. You need a headless terminal, event injection,
91
- snapshot comparisons, and style assertions. RatatuiRuby bundles all of it.
92
-
93
- require "ratatui_ruby/test_helper"
94
-
95
- class TestColorPicker < Minitest::Test
96
- include RatatuiRuby::TestHelper
97
-
98
- def test_swatch_widget
99
- with_test_terminal(10, 3) do
100
- RatatuiRuby.draw do |frame|
101
- frame.render_widget(Swatch.new(:red), frame.area)
102
- end
103
- assert_cell_style 2, 1, char: "█", bg: :red
104
- end
105
- end
106
- end
107
-
108
- ==== What's inside:
109
-
110
- - <b>Headless terminal</b> — No real TTY needed
111
- - <b>Snapshots</b> — Plain text and rich (ANSI colors)
112
- - <b>Event injection</b> — Keys, mouse, paste, resize
113
- - <b>Style assertions</b> — Color, bold, underline at any cell
114
- - <b>Test doubles</b> — Mock frames and stub rects
115
- - <b>UPDATE_SNAPSHOTS=1</b> — Regenerate baselines in one command
116
-
117
-
118
- ---
119
-
120
- ==== Inline Menu Example
121
-
122
- require "ratatui_ruby"
123
-
124
- # This example renders an inline menu. Arrow keys select, enter confirms.
125
- # The menu appears in-place, preserving scrollback. When the user chooses,
126
- # the TUI closes and the script continues with the selected value.
127
- class RadioMenu
128
- CHOICES = ["Production", "Staging", "Development"] # ASCII strings are universally supported.
129
- PREFIXES = { active: "●", inactive: "○" } # Some terminals may not support Unicode.
130
- CONTROLS = "↑/↓: Select | Enter: Choose | Ctrl+C: Cancel" # Let users know what keys you handle.
131
- TITLES = ["Select Environment", # The default title position is top left.
132
- { content: CONTROLS, # Multiple titles can save space.
133
- position: :bottom, # Titles go on the top or bottom,
134
- alignment: :right }] # aligned left, right, or center
135
-
136
- def call # This method blocks until a choice is made.
137
- RatatuiRuby.run(viewport: :inline, height: 5) do |tui| # RatauiRuby.run manages the terminal.
138
- @tui = tui # The TUI instance is safe to store.
139
- show_menu until chosen? # You can use any loop keyword you like.
140
- end # `run` won't return until your block does,
141
- RadioMenu::CHOICES[@choice] # so you can use it synchronously.
142
- end
143
- # Classes like RadioMenu are convenient for
144
- private # CLI authors to offer "rich moments."
145
-
146
- def show_menu = @tui.draw do |frame| # RatatuiRuby gives you low-level access.
147
- widget = @tui.paragraph( # But the TUI facade makes it easy to use.
148
- text: menu_items, # Text can be spans, lines, or paragraphs.
149
- block: @tui.block(borders: :all, titles: TITLES) # Blocks give you boxes and titles, and hold
150
- ) # one or more widgets. We only use one here,
151
- frame.render_widget(widget, frame.area) # but "area" lets you compose sub-views.
152
- end
153
-
154
- def chosen? # You are responsible for handling input.
155
- interaction = @tui.poll_event # Every frame, you receive an event object:
156
- return choose if interaction.enter? # Key, Mouse, Resize, Paste, FocusGained,
157
- # FocusLost, or None objects. They come with
158
- move_by(-1) if interaction.up? # predicates, support pattern matching, and
159
- move_by(1) if interaction.down? # can be inspected for properties directly.
160
- quit! if interaction.ctrl_c? # Your application must handle every input,
161
- false # even interrupts and other exit patterns.
162
- end
163
-
164
- def choose # Here, the loop is about to exit, and the
165
- prepare_next_line # block will return. The inline viewport
166
- @choice # will be torn down and the terminal will
167
- end # be restored, but you are responsible for
168
- # positioning the cursor.
169
- def prepare_next_line # To ensure the next output is on a new
170
- area = @tui.viewport_area # line, query the viewport area and move
171
- RatatuiRuby.cursor_position = [0, area.y + area.height] # the cursor to the start of the last line.
172
- puts # Then print a newline.
173
- end
174
-
175
- def quit! # All of your familiar Ruby control flow
176
- prepare_next_line # keywords work as expected, so we can
177
- exit 0 # use them to leave the TUI.
178
- end
179
-
180
- def move_by(line_count) # You are in full control of your UX, so
181
- @choice = (@choice + line_count) % CHOICES.size # you can implement any logic you need:
182
- end # Would you "wrap around" here, or not?
183
- #
184
- def menu_items = CHOICES.map.with_index do |choice, i| # Notably, RatatuiRuby has no concept of
185
- "\#{prefix_for(i)} \#{choice}" # "menus" or "radio buttons". You are in
186
- end # full control, but it also means you must
187
- def prefix_for(choice_index) # implement the logic yourself. For larger
188
- return PREFIXES[:active] if choice_index == @choice # applications, consider using Rooibos,
189
- PREFIXES[:inactive] # an MVU framework built with RatatuiRuby.
190
- end # Or, use the upcoming ratatui-ruby-kit,
191
- # our object-oriented component library.
192
- def initialize = @choice = 0 # However, those are both optional, and
193
- end # designed for full-screen Terminal UIs.
194
- # RatatuiRuby will always give you the most
195
- choice = RadioMenu.new.call # control, and is enough for "rich CLI
196
- puts "You chose \#{choice}!" # moments" like this one.
197
-
198
- ---
199
-
200
- === Full App Solutions
201
-
202
- RatatuiRuby renders. For complex applications, add a framework that manages
203
- state and composition.
204
-
205
- ==== Rooibos[https://git.sr.ht/~kerrick/rooibos] (Framework)
206
-
207
- Model-View-Update architecture. Inspired by Elm, Bubble Tea, and React +
208
- Redux. Your UI is a pure function of state.
209
-
210
- - Functional programming with MVU
211
- - Commands work off the main thread
212
- - Messages, not callbacks, drive updates
213
-
214
- ==== {Kit}[https://sr.ht/~kerrick/ratatui_ruby/#chapter-3-the-object-path--kit] (Coming Soon)
215
-
216
- Component-based architecture. Encapsulate state, input handling, and
217
- rendering in reusable pieces.
218
-
219
- - OOP with stateful components
220
- - Separate UI state from domain logic
221
- - Built-in focus management & click handling
222
-
223
- Both use the same widget library and rendering engine. Pick the paradigm
224
- that fits your brain.
225
-
226
-
227
- ---
228
-
229
- === Why RatatuiRuby?
230
-
231
- Ruby deserves world-class terminal user interfaces. TUI developers deserve
232
- a world-class language.
233
-
234
- RatatuiRuby wraps Rust's Ratatui via native extension. The Rust library
235
- handles rendering. Your Ruby code handles design.
236
-
237
- >>>
238
- "Text UIs are seeing a renaissance with many new TUI libraries popping up.
239
- The Ratatui bindings have proven to be full featured and stable."
240
-
241
- — {Mike Perham}[https://www.mikeperham.com/], creator of
242
- Sidekiq[https://sidekiq.org/] and Faktory[https://contribsys.com/faktory/]
243
-
244
- ==== Why Rust? Why Ruby?
245
-
246
- Rust excels at low-level rendering. Ruby excels at expressing domain logic
247
- and UI. RatatuiRuby puts each language where it performs best.
248
-
249
- ==== Versus CharmRuby
250
-
251
- CharmRuby[https://charm-ruby.dev/] wraps Charm's Go libraries. Both projects
252
- give Ruby developers TUI options.
253
-
254
- [Integration]
255
- CharmRuby: Two runtimes, one process.
256
- RatatuiRuby: Native extension in Rust.
257
- [Runtime]
258
- CharmRuby: Go + Ruby (competing).
259
- RatatuiRuby: Ruby (Rust has no runtime).
260
- [Memory]
261
- CharmRuby: Two uncoordinated GCs.
262
- RatatuiRuby: One Garbage Collector.
263
- [Style]
264
- CharmRuby: The Elm Architecture (TEA).
265
- RatatuiRuby: TEA, OOP, or Imperative.
266
-
267
-
268
- ---
269
-
270
- === Links
271
-
272
- [Get Started]
273
- {Quickstart}[https://www.ratatui-ruby.dev/docs/v0.10/doc/getting_started/quickstart_md.html],
274
- {Examples}[https://www.ratatui-ruby.dev/docs/v0.10/examples/app_cli_rich_moments/README_md.html],
275
- {API Reference}[https://www.ratatui-ruby.dev/docs/v0.10/],
276
- {Guides}[https://www.ratatui-ruby.dev/docs/v0.10/doc/index_md.html]
277
- [Ecosystem]
278
- Rooibos[https://git.sr.ht/~kerrick/rooibos],
279
- {Kit}[https://sr.ht/~kerrick/ratatui_ruby/#chapter-3-the-object-path--kit] (Planned),
280
- {Framework}[https://sr.ht/~kerrick/ratatui_ruby/#chapter-5-the-framework] (Planned),
281
- {UI Widgets}[https://sr.ht/~kerrick/ratatui_ruby/#chapter-6-licensing] (Planned)
282
- [Community]
283
- {Discuss and Chat}[https://lists.sr.ht/~kerrick/ratatui_ruby-discuss],
284
- {Announcements}[https://lists.sr.ht/~kerrick/ratatui_ruby-announce],
285
- {Development}[https://lists.sr.ht/~kerrick/ratatui_ruby-devel],
286
- {Bug Tracker}[https://todo.sr.ht/~kerrick/ratatui_ruby]
287
- [Contribute]
288
- {Contributing Guide}[https://man.sr.ht/~kerrick/ratatui_ruby/contributing.md],
289
- {Code of Conduct}[https://man.sr.ht/~kerrick/ratatui_ruby/code_of_conduct.md],
290
- {Project History}[https://man.sr.ht/~kerrick/ratatui_ruby/history/index.md],
291
- {Pull Requests}[https://lists.sr.ht/~kerrick/ratatui_ruby-devel/patches]
292
-
293
-
294
- ---
295
-
296
- [Website] https://www.ratatui-ruby.dev
297
- [Source] https://git.sr.ht/~kerrick/ratatui_ruby
298
- [RubyGems] https://rubygems.org/gems/ratatui_ruby
299
- [Upstream] https://ratatui.rs
300
- [Build Status] https://builds.sr.ht/~kerrick/ratatui_ruby
301
-
302
- © 2026 Kerrick Long · Library: LGPL-3.0-or-later · Website: CC-BY-NC-ND-4.0 · Snippets: MIT-0
data/Rakefile DELETED
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
4
- # SPDX-License-Identifier: AGPL-3.0-or-later
5
-
6
- require "bundler/gem_tasks"
7
-
8
- # Import all tasks from the tasks/ directory
9
- Dir.glob("tasks/*.rake").each { |r| import r }
10
-
11
- task default: %w[lint:fix sourcehut test lint license:new steep]
data/Steepfile DELETED
@@ -1,49 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
4
- # SPDX-License-Identifier: AGPL-3.0-or-later
5
-
6
- target :lib do
7
- signature "sig"
8
- check "lib"
9
-
10
- # Legacy schema/ files pending migration - exclude from checking
11
- # Only schema/text.rb and schema/draw.rb are loaded by the main gem
12
- # See doc/contributors/v1.0.0_blockers.md
13
- ignore "lib/ratatui_ruby/schema/bar_chart.rb"
14
- ignore "lib/ratatui_ruby/schema/bar_chart/"
15
- ignore "lib/ratatui_ruby/schema/block.rb"
16
- ignore "lib/ratatui_ruby/schema/calendar.rb"
17
- ignore "lib/ratatui_ruby/schema/canvas.rb"
18
- ignore "lib/ratatui_ruby/schema/center.rb"
19
- ignore "lib/ratatui_ruby/schema/chart.rb"
20
- ignore "lib/ratatui_ruby/schema/clear.rb"
21
- ignore "lib/ratatui_ruby/schema/constraint.rb"
22
- ignore "lib/ratatui_ruby/schema/cursor.rb"
23
- ignore "lib/ratatui_ruby/schema/gauge.rb"
24
- ignore "lib/ratatui_ruby/schema/layout.rb"
25
- ignore "lib/ratatui_ruby/schema/line_gauge.rb"
26
- ignore "lib/ratatui_ruby/schema/list.rb"
27
- ignore "lib/ratatui_ruby/schema/list_item.rb"
28
- ignore "lib/ratatui_ruby/schema/overlay.rb"
29
- ignore "lib/ratatui_ruby/schema/paragraph.rb"
30
- ignore "lib/ratatui_ruby/schema/ratatui_logo.rb"
31
- ignore "lib/ratatui_ruby/schema/ratatui_mascot.rb"
32
- ignore "lib/ratatui_ruby/schema/rect.rb"
33
- ignore "lib/ratatui_ruby/schema/row.rb"
34
- ignore "lib/ratatui_ruby/schema/scrollbar.rb"
35
- ignore "lib/ratatui_ruby/schema/shape/"
36
- ignore "lib/ratatui_ruby/schema/sparkline.rb"
37
- ignore "lib/ratatui_ruby/schema/style.rb"
38
- ignore "lib/ratatui_ruby/schema/table.rb"
39
- ignore "lib/ratatui_ruby/schema/tabs.rb"
40
-
41
- # ClassMethods mixin pattern cannot be typed in RBS
42
- # (self in ClassMethods refers to the including Class)
43
- ignore "lib/ratatui_ruby/widgets/coerceable_widget.rb"
44
-
45
- library "pathname"
46
- library "fileutils"
47
- library "minitest"
48
- library "date"
49
- end