ratatui_ruby 1.2.0 → 1.2.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.
Files changed (260) hide show
  1. checksums.yaml +4 -4
  2. data/ext/ratatui_ruby/Cargo.lock +2 -1
  3. data/ext/ratatui_ruby/Cargo.toml +2 -1
  4. data/ext/ratatui_ruby/src/events.rs +157 -18
  5. data/lib/ratatui_ruby/version.rb +1 -1
  6. metadata +1 -255
  7. data/.builds/ruby-3.2.yml +0 -54
  8. data/.builds/ruby-3.3.yml +0 -54
  9. data/.builds/ruby-3.4.yml +0 -54
  10. data/.builds/ruby-4.0.0.yml +0 -54
  11. data/.pre-commit-config.yaml +0 -16
  12. data/.rubocop.yml +0 -10
  13. data/AGENTS.md +0 -147
  14. data/CHANGELOG.md +0 -751
  15. data/README.md +0 -187
  16. data/README.rdoc +0 -302
  17. data/Rakefile +0 -11
  18. data/Steepfile +0 -50
  19. data/doc/concepts/application_architecture.md +0 -321
  20. data/doc/concepts/application_testing.md +0 -193
  21. data/doc/concepts/async.md +0 -190
  22. data/doc/concepts/custom_widgets.md +0 -247
  23. data/doc/concepts/debugging.md +0 -401
  24. data/doc/concepts/event_handling.md +0 -162
  25. data/doc/concepts/interactive_design.md +0 -146
  26. data/doc/contributors/auditing/parity.md +0 -239
  27. data/doc/contributors/design/ruby_frontend.md +0 -448
  28. data/doc/contributors/design/rust_backend.md +0 -434
  29. data/doc/contributors/design.md +0 -11
  30. data/doc/contributors/developing_examples.md +0 -400
  31. data/doc/contributors/documentation_style.md +0 -121
  32. data/doc/contributors/index.md +0 -21
  33. data/doc/contributors/releasing.md +0 -215
  34. data/doc/contributors/todo/align/api_completeness_audit-finished.md +0 -381
  35. data/doc/contributors/todo/align/api_completeness_audit-unfinished.md +0 -200
  36. data/doc/contributors/todo/align/term.md +0 -351
  37. data/doc/contributors/todo/align/terminal.md +0 -647
  38. data/doc/contributors/todo/future_work.md +0 -169
  39. data/doc/contributors/upstream_requests/paragraph_span_rects.md +0 -259
  40. data/doc/contributors/upstream_requests/tab_rects.md +0 -173
  41. data/doc/contributors/upstream_requests/title_rects.md +0 -132
  42. data/doc/custom.css +0 -22
  43. data/doc/getting_started/quickstart.md +0 -291
  44. data/doc/getting_started/why.md +0 -93
  45. data/doc/images/app_all_events.png +0 -0
  46. data/doc/images/app_cli_rich_moments.gif +0 -0
  47. data/doc/images/app_color_picker.png +0 -0
  48. data/doc/images/app_debugging_showcase.gif +0 -0
  49. data/doc/images/app_debugging_showcase.png +0 -0
  50. data/doc/images/app_external_editor.gif +0 -0
  51. data/doc/images/app_login_form.png +0 -0
  52. data/doc/images/app_stateful_interaction.png +0 -0
  53. data/doc/images/verify_quickstart_dsl.png +0 -0
  54. data/doc/images/verify_quickstart_layout.png +0 -0
  55. data/doc/images/verify_quickstart_lifecycle.png +0 -0
  56. data/doc/images/verify_readme_usage.png +0 -0
  57. data/doc/images/widget_barchart.png +0 -0
  58. data/doc/images/widget_block.png +0 -0
  59. data/doc/images/widget_box.png +0 -0
  60. data/doc/images/widget_calendar.png +0 -0
  61. data/doc/images/widget_canvas.png +0 -0
  62. data/doc/images/widget_cell.png +0 -0
  63. data/doc/images/widget_center.png +0 -0
  64. data/doc/images/widget_chart.png +0 -0
  65. data/doc/images/widget_gauge.png +0 -0
  66. data/doc/images/widget_layout_split.png +0 -0
  67. data/doc/images/widget_line_gauge.png +0 -0
  68. data/doc/images/widget_list.png +0 -0
  69. data/doc/images/widget_map.png +0 -0
  70. data/doc/images/widget_overlay.png +0 -0
  71. data/doc/images/widget_popup.png +0 -0
  72. data/doc/images/widget_ratatui_logo.png +0 -0
  73. data/doc/images/widget_ratatui_mascot.png +0 -0
  74. data/doc/images/widget_rect.png +0 -0
  75. data/doc/images/widget_render.png +0 -0
  76. data/doc/images/widget_rich_text.png +0 -0
  77. data/doc/images/widget_scroll_text.png +0 -0
  78. data/doc/images/widget_scrollbar.png +0 -0
  79. data/doc/images/widget_sparkline.png +0 -0
  80. data/doc/images/widget_style_colors.png +0 -0
  81. data/doc/images/widget_table.png +0 -0
  82. data/doc/images/widget_tabs.png +0 -0
  83. data/doc/images/widget_text_width.png +0 -0
  84. data/doc/index.md +0 -34
  85. data/doc/troubleshooting/async.md +0 -4
  86. data/doc/troubleshooting/terminal_limitations.md +0 -131
  87. data/doc/troubleshooting/tui_output.md +0 -197
  88. data/examples/app_all_events/README.md +0 -114
  89. data/examples/app_all_events/app.rb +0 -98
  90. data/examples/app_all_events/model/app_model.rb +0 -159
  91. data/examples/app_all_events/model/event_color_cycle.rb +0 -43
  92. data/examples/app_all_events/model/event_entry.rb +0 -94
  93. data/examples/app_all_events/model/msg.rb +0 -39
  94. data/examples/app_all_events/model/timestamp.rb +0 -56
  95. data/examples/app_all_events/update.rb +0 -75
  96. data/examples/app_all_events/view/app_view.rb +0 -80
  97. data/examples/app_all_events/view/controls_view.rb +0 -54
  98. data/examples/app_all_events/view/counts_view.rb +0 -61
  99. data/examples/app_all_events/view/live_view.rb +0 -72
  100. data/examples/app_all_events/view/log_view.rb +0 -57
  101. data/examples/app_all_events/view.rb +0 -9
  102. data/examples/app_cli_rich_moments/README.md +0 -81
  103. data/examples/app_cli_rich_moments/app.rb +0 -189
  104. data/examples/app_color_picker/README.md +0 -156
  105. data/examples/app_color_picker/app.rb +0 -76
  106. data/examples/app_color_picker/clipboard.rb +0 -86
  107. data/examples/app_color_picker/color.rb +0 -193
  108. data/examples/app_color_picker/controls.rb +0 -92
  109. data/examples/app_color_picker/copy_dialog.rb +0 -168
  110. data/examples/app_color_picker/export_pane.rb +0 -128
  111. data/examples/app_color_picker/harmony.rb +0 -58
  112. data/examples/app_color_picker/input.rb +0 -176
  113. data/examples/app_color_picker/main_container.rb +0 -180
  114. data/examples/app_color_picker/palette.rb +0 -111
  115. data/examples/app_debugging_showcase/README.md +0 -119
  116. data/examples/app_debugging_showcase/app.rb +0 -318
  117. data/examples/app_external_editor/README.md +0 -62
  118. data/examples/app_external_editor/app.rb +0 -344
  119. data/examples/app_login_form/README.md +0 -58
  120. data/examples/app_login_form/app.rb +0 -109
  121. data/examples/app_stateful_interaction/README.md +0 -35
  122. data/examples/app_stateful_interaction/app.rb +0 -328
  123. data/examples/timeout_demo.rb +0 -45
  124. data/examples/verify_quickstart_dsl/README.md +0 -55
  125. data/examples/verify_quickstart_dsl/app.rb +0 -49
  126. data/examples/verify_quickstart_layout/README.md +0 -77
  127. data/examples/verify_quickstart_layout/app.rb +0 -73
  128. data/examples/verify_quickstart_lifecycle/README.md +0 -68
  129. data/examples/verify_quickstart_lifecycle/app.rb +0 -62
  130. data/examples/verify_readme_usage/README.md +0 -49
  131. data/examples/verify_readme_usage/app.rb +0 -42
  132. data/examples/verify_website_managed/README.md +0 -48
  133. data/examples/verify_website_managed/app.rb +0 -36
  134. data/examples/verify_website_menu/README.md +0 -60
  135. data/examples/verify_website_menu/app.rb +0 -84
  136. data/examples/verify_website_spinner/README.md +0 -44
  137. data/examples/verify_website_spinner/app.rb +0 -34
  138. data/examples/widget_barchart/README.md +0 -58
  139. data/examples/widget_barchart/app.rb +0 -240
  140. data/examples/widget_block/README.md +0 -44
  141. data/examples/widget_block/app.rb +0 -258
  142. data/examples/widget_box/README.md +0 -54
  143. data/examples/widget_box/app.rb +0 -255
  144. data/examples/widget_calendar/README.md +0 -48
  145. data/examples/widget_calendar/app.rb +0 -115
  146. data/examples/widget_canvas/README.md +0 -31
  147. data/examples/widget_canvas/app.rb +0 -130
  148. data/examples/widget_cell/README.md +0 -45
  149. data/examples/widget_cell/app.rb +0 -112
  150. data/examples/widget_center/README.md +0 -33
  151. data/examples/widget_center/app.rb +0 -118
  152. data/examples/widget_chart/README.md +0 -50
  153. data/examples/widget_chart/app.rb +0 -220
  154. data/examples/widget_gauge/README.md +0 -50
  155. data/examples/widget_gauge/app.rb +0 -229
  156. data/examples/widget_layout_split/README.md +0 -53
  157. data/examples/widget_layout_split/app.rb +0 -260
  158. data/examples/widget_line_gauge/README.md +0 -50
  159. data/examples/widget_line_gauge/app.rb +0 -219
  160. data/examples/widget_list/README.md +0 -58
  161. data/examples/widget_list/app.rb +0 -382
  162. data/examples/widget_map/README.md +0 -48
  163. data/examples/widget_map/app.rb +0 -95
  164. data/examples/widget_overlay/README.md +0 -45
  165. data/examples/widget_overlay/app.rb +0 -250
  166. data/examples/widget_popup/README.md +0 -45
  167. data/examples/widget_popup/app.rb +0 -106
  168. data/examples/widget_ratatui_logo/README.md +0 -43
  169. data/examples/widget_ratatui_logo/app.rb +0 -104
  170. data/examples/widget_ratatui_mascot/README.md +0 -43
  171. data/examples/widget_ratatui_mascot/app.rb +0 -95
  172. data/examples/widget_rect/README.md +0 -53
  173. data/examples/widget_rect/app.rb +0 -222
  174. data/examples/widget_render/README.md +0 -46
  175. data/examples/widget_render/app.rb +0 -186
  176. data/examples/widget_render/app.rbs +0 -41
  177. data/examples/widget_rich_text/README.md +0 -44
  178. data/examples/widget_rich_text/app.rb +0 -193
  179. data/examples/widget_scroll_text/README.md +0 -46
  180. data/examples/widget_scroll_text/app.rb +0 -109
  181. data/examples/widget_scrollbar/README.md +0 -46
  182. data/examples/widget_scrollbar/app.rb +0 -155
  183. data/examples/widget_sparkline/README.md +0 -51
  184. data/examples/widget_sparkline/app.rb +0 -277
  185. data/examples/widget_style_colors/README.md +0 -43
  186. data/examples/widget_style_colors/app.rb +0 -83
  187. data/examples/widget_table/README.md +0 -57
  188. data/examples/widget_table/app.rb +0 -285
  189. data/examples/widget_tabs/README.md +0 -50
  190. data/examples/widget_tabs/app.rb +0 -183
  191. data/examples/widget_text_width/README.md +0 -44
  192. data/examples/widget_text_width/app.rb +0 -117
  193. data/migrate_to_buffer.rb +0 -145
  194. data/mise.toml +0 -8
  195. data/tasks/autodoc/examples.rb +0 -87
  196. data/tasks/autodoc/member.rb +0 -58
  197. data/tasks/autodoc/name.rb +0 -21
  198. data/tasks/autodoc.rake +0 -21
  199. data/tasks/bump/bump_workflow.rb +0 -49
  200. data/tasks/bump/cargo_lockfile.rb +0 -21
  201. data/tasks/bump/changelog.rb +0 -104
  202. data/tasks/bump/header.rb +0 -32
  203. data/tasks/bump/history.rb +0 -32
  204. data/tasks/bump/links.rb +0 -69
  205. data/tasks/bump/manifest.rb +0 -33
  206. data/tasks/bump/patch_release.rb +0 -19
  207. data/tasks/bump/release_branch.rb +0 -17
  208. data/tasks/bump/release_from_trunk.rb +0 -49
  209. data/tasks/bump/repository.rb +0 -54
  210. data/tasks/bump/ruby_gem.rb +0 -29
  211. data/tasks/bump/sem_ver.rb +0 -44
  212. data/tasks/bump/unreleased_section.rb +0 -73
  213. data/tasks/bump.rake +0 -61
  214. data/tasks/doc/documentation.rb +0 -59
  215. data/tasks/doc/link/file_url.rb +0 -30
  216. data/tasks/doc/link/relative_path.rb +0 -61
  217. data/tasks/doc/link/web_url.rb +0 -55
  218. data/tasks/doc/link.rb +0 -52
  219. data/tasks/doc/link_audit.rb +0 -116
  220. data/tasks/doc/problem.rb +0 -40
  221. data/tasks/doc/source_file.rb +0 -93
  222. data/tasks/doc.rake +0 -905
  223. data/tasks/example_viewer.html.erb +0 -172
  224. data/tasks/extension.rake +0 -14
  225. data/tasks/license/headers_md.rb +0 -223
  226. data/tasks/license/headers_rb.rb +0 -210
  227. data/tasks/license/license_utils.rb +0 -130
  228. data/tasks/license/snippets_md.rb +0 -315
  229. data/tasks/license/snippets_rdoc.rb +0 -150
  230. data/tasks/license.rake +0 -91
  231. data/tasks/lint.rake +0 -170
  232. data/tasks/rbs_predicates/predicate_catalog.rb +0 -52
  233. data/tasks/rbs_predicates/predicate_tests.rb +0 -124
  234. data/tasks/rbs_predicates/rbs_signature.rb +0 -63
  235. data/tasks/rbs_predicates.rake +0 -31
  236. data/tasks/rdoc_config.rb +0 -29
  237. data/tasks/resources/build.yml.erb +0 -60
  238. data/tasks/resources/index.html.erb +0 -141
  239. data/tasks/resources/rubies.yml +0 -7
  240. data/tasks/sourcehut.rake +0 -122
  241. data/tasks/steep.rake +0 -11
  242. data/tasks/terminal_preview/app_screenshot.rb +0 -45
  243. data/tasks/terminal_preview/crash_report.rb +0 -54
  244. data/tasks/terminal_preview/example_app.rb +0 -27
  245. data/tasks/terminal_preview/launcher_script.rb +0 -48
  246. data/tasks/terminal_preview/preview_collection.rb +0 -60
  247. data/tasks/terminal_preview/preview_timing.rb +0 -24
  248. data/tasks/terminal_preview/safety_confirmation.rb +0 -58
  249. data/tasks/terminal_preview/saved_screenshot.rb +0 -56
  250. data/tasks/terminal_preview/system_appearance.rb +0 -13
  251. data/tasks/terminal_preview/terminal_window.rb +0 -138
  252. data/tasks/terminal_preview/window_id.rb +0 -16
  253. data/tasks/terminal_preview.rake +0 -30
  254. data/tasks/test.rake +0 -36
  255. data/tasks/website/index_page.rb +0 -30
  256. data/tasks/website/version.rb +0 -122
  257. data/tasks/website/version_menu.rb +0 -68
  258. data/tasks/website/versioned_documentation.rb +0 -83
  259. data/tasks/website/website.rb +0 -53
  260. data/tasks/website.rake +0 -28
@@ -1,116 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- #--
4
- # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
6
- #++
7
-
8
- require_relative "documentation"
9
-
10
- # Results of auditing documentation for broken links.
11
- #
12
- # Documentation breaks silently. Links rot. Files move. Paths change. Manual
13
- # checking is tedious and error-prone. Automated checking catches problems
14
- # before users do.
15
- #
16
- # LinkAudit scans all documentation, checks each link, and collects problems.
17
- # It separates web URLs (slow to verify) from local paths (fast to check).
18
- # The results render as a human-readable report via <tt>to_s</tt>.
19
- #
20
- # === Example
21
- #
22
- # audit = LinkAudit.new("/project/root", verify_web: false)
23
- # puts audit # prints the full report
24
- # exit 1 unless audit.success?
25
- #
26
- class LinkAudit
27
- # Problems found during the audit.
28
- attr_reader :problems
29
-
30
- # Web URLs that were not verified (when <tt>verify_web: false</tt>).
31
- attr_reader :unverified
32
-
33
- # Creates a new LinkAudit and runs the scan immediately.
34
- #
35
- # [root] Project root directory to scan.
36
- # [verify_web] Whether to make HTTP requests to verify web URLs.
37
- def initialize(root, verify_web: false)
38
- @root = root
39
- @docs = Documentation.new(root)
40
- @verify_web = verify_web
41
- @problems = []
42
- @unverified = []
43
- @checked = 0
44
- @web_checked = 0
45
- scan
46
- end
47
-
48
- # Whether the audit passed with no problems.
49
- def success?
50
- @problems.empty?
51
- end
52
-
53
- # Returns the audit report as a String.
54
- def to_s
55
- lines = []
56
- lines << ""
57
- lines << "Scanning for broken links in #{@root}..."
58
- lines << ""
59
-
60
- if @verify_web
61
- lines << "Checked #{@checked} links in #{@docs.count} files (#{@web_checked} web URLs probed)."
62
- else
63
- lines << "Checked #{@checked} links in #{@docs.count} files (URL verification skipped)."
64
- end
65
- lines << ""
66
-
67
- unless @unverified.empty?
68
- lines << "📋 Unverified HTTP/HTTPS URLs (#{@unverified.size}):"
69
- lines << ""
70
- @unverified.uniq(&:raw).each { |link| lines << " #{link.raw}" }
71
- lines << ""
72
- end
73
-
74
- if @problems.empty?
75
- lines << "✅ No broken links found!"
76
- else
77
- lines << "❌ Found #{@problems.size} broken link(s):"
78
- lines << ""
79
-
80
- @problems.group_by(&:file).each do |path, problems|
81
- lines << "#{path}:"
82
- problems.each do |problem|
83
- lines << " L#{problem.line || '?'}: #{problem.raw}"
84
- lines << " → #{problem.reason}"
85
- end
86
- lines << ""
87
- end
88
- end
89
-
90
- lines.join("\n")
91
- end
92
-
93
- private def scan # :nodoc:
94
- @docs.each do |file|
95
- file.links.each do |link|
96
- @checked += 1
97
- check(link)
98
- end
99
- end
100
- end
101
-
102
- private def check(link) # :nodoc:
103
- if link.web?
104
- if @verify_web
105
- @web_checked += 1
106
- problem = link.problem(@root)
107
- @problems << problem if problem
108
- else
109
- @unverified << link
110
- end
111
- else
112
- problem = link.problem(@root)
113
- @problems << problem if problem
114
- end
115
- end
116
- end
data/tasks/doc/problem.rb DELETED
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- #--
4
- # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
6
- #++
7
-
8
- # Represents a broken link.
9
- #
10
- # Link checking produces results. Some links are fine. Some are broken. You
11
- # need to report the broken ones with context: where they were found and why
12
- # they failed.
13
- #
14
- # Problem holds the link and the reason it failed. It delegates to the link
15
- # for file, line, and raw text. Use it to build human-readable error reports.
16
- #
17
- # === Example
18
- #
19
- # problem = Problem.new(link, "File not found: missing.md")
20
- # problem.file # => "doc/guide.md"
21
- # problem.line # => 42
22
- # problem.raw # => "missing.md"
23
- # problem.reason # => "File not found: missing.md"
24
- #
25
- class Problem < Data.define(:link, :reason)
26
- # Relative path to the file containing the broken link.
27
- def file
28
- link.source_file.relative_path
29
- end
30
-
31
- # Line number where the broken link appears.
32
- def line
33
- link.line
34
- end
35
-
36
- # The raw link text that failed validation.
37
- def raw
38
- link.raw
39
- end
40
- end
@@ -1,93 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- #--
4
- # SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
5
- # SPDX-License-Identifier: AGPL-3.0-or-later
6
- #++
7
-
8
- require "pathname"
9
- require_relative "link"
10
-
11
- # A file that may contain links.
12
- #
13
- # Documentation lives in many files: Ruby source with RDoc comments, Markdown
14
- # guides, RDoc text files. Each file may reference images, other docs, or
15
- # external URLs. Extracting these links by hand is tedious.
16
- #
17
- # SourceFile scans its content with regex patterns. It creates the appropriate
18
- # Link subclass for each match. It tracks line numbers for error reporting.
19
- #
20
- # === Example
21
- #
22
- # file = SourceFile.new("/path/to/guide.md", "/project/root")
23
- # file.links.each do |link|
24
- # puts "#{link.raw} at line #{link.line}"
25
- # end
26
- #
27
- class SourceFile
28
- # Regex patterns for extracting links from documentation.
29
- PATTERNS = {
30
- rdoc_image_link: /\{rdoc-image:([^}]+)\}\[link:([^\]]+)\]/,
31
- rdoc_link: /\{[^}]*\}\[link:([^\]]+)\]/,
32
- rdoc_image: /\{rdoc-image:([^}]+)\}/,
33
- markdown_link: /\[(?:[^\]]*)\]\((?!mailto:|#)([^)\s]+)\)/,
34
- markdown_image: /!\[[^\]]*\]\(([^)\s]+)\)/,
35
- html_src: /src=["']([^"']+)["']/,
36
- html_href: /href=["'](?!mailto:|#)([^"']+)["']/,
37
- }.freeze
38
-
39
- # The Pathname to this file.
40
- attr_reader :path
41
-
42
- # Creates a new SourceFile.
43
- #
44
- # [path] Path to the file (String or Pathname).
45
- # [root] Project root directory for computing relative paths.
46
- def initialize(path, root)
47
- @path = Pathname.new(path)
48
- @root = Pathname.new(root)
49
- end
50
-
51
- # Extracts all links from the file content. Returns an Array of Link objects.
52
- def links
53
- found = []
54
-
55
- PATTERNS.each_value do |pattern|
56
- content.scan(pattern) do |matches|
57
- matches = [matches] unless matches.is_a?(Array)
58
- matches.each do |match|
59
- next if match.nil? || match.empty?
60
- next unless looks_like_link?(match)
61
- found << Link.build(match, line_for(match), self)
62
- end
63
- end
64
- end
65
-
66
- found
67
- end
68
-
69
- # The file path relative to the project root.
70
- def relative_path
71
- @path.relative_path_from(@root).to_s
72
- end
73
-
74
- private def content # :nodoc:
75
- @content ||= @path.read(mode: "rb").force_encoding("UTF-8").scrub("")
76
- end
77
-
78
- private def line_for(link_text) # :nodoc:
79
- line_num = 1
80
- content.each_line do |line|
81
- return line_num if line.include?(link_text)
82
- line_num += 1
83
- end
84
- nil
85
- end
86
-
87
- private def looks_like_link?(text) # :nodoc:
88
- # Skip regex patterns and other false positives
89
- return false if text.match?(/[\[\]^*+?]/) # Contains regex special chars
90
- return false if text.length < 4
91
- true
92
- end
93
- end