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.
- checksums.yaml +4 -4
- data/ext/ratatui_ruby/Cargo.lock +1 -1
- data/ext/ratatui_ruby/Cargo.toml +1 -1
- data/lib/ratatui_ruby/version.rb +1 -1
- metadata +1 -232
- data/.builds/ruby-3.2.yml +0 -54
- data/.builds/ruby-3.3.yml +0 -54
- data/.builds/ruby-3.4.yml +0 -54
- data/.builds/ruby-4.0.0.yml +0 -54
- data/.pre-commit-config.yaml +0 -16
- data/.rubocop.yml +0 -10
- data/AGENTS.md +0 -146
- data/CHANGELOG.md +0 -710
- data/README.md +0 -187
- data/README.rdoc +0 -302
- data/Rakefile +0 -11
- data/Steepfile +0 -49
- data/doc/concepts/application_architecture.md +0 -321
- data/doc/concepts/application_testing.md +0 -193
- data/doc/concepts/async.md +0 -190
- data/doc/concepts/custom_widgets.md +0 -247
- data/doc/concepts/debugging.md +0 -401
- data/doc/concepts/event_handling.md +0 -162
- data/doc/concepts/interactive_design.md +0 -146
- data/doc/contributors/auditing/parity.md +0 -239
- data/doc/contributors/design/ruby_frontend.md +0 -420
- data/doc/contributors/design/rust_backend.md +0 -422
- data/doc/contributors/design.md +0 -11
- data/doc/contributors/developing_examples.md +0 -400
- data/doc/contributors/documentation_style.md +0 -121
- data/doc/contributors/index.md +0 -21
- data/doc/contributors/todo/align/api_completeness_audit-finished.md +0 -375
- data/doc/contributors/todo/align/api_completeness_audit-unfinished.md +0 -206
- data/doc/contributors/todo/align/terminal.md +0 -647
- data/doc/contributors/todo/future_work.md +0 -169
- data/doc/contributors/upstream_requests/tab_rects.md +0 -173
- data/doc/contributors/upstream_requests/title_rects.md +0 -132
- data/doc/custom.css +0 -22
- data/doc/getting_started/quickstart.md +0 -291
- data/doc/getting_started/why.md +0 -93
- data/doc/images/app_all_events.png +0 -0
- data/doc/images/app_cli_rich_moments.gif +0 -0
- data/doc/images/app_color_picker.png +0 -0
- data/doc/images/app_debugging_showcase.gif +0 -0
- data/doc/images/app_debugging_showcase.png +0 -0
- data/doc/images/app_login_form.png +0 -0
- data/doc/images/app_stateful_interaction.png +0 -0
- data/doc/images/verify_quickstart_dsl.png +0 -0
- data/doc/images/verify_quickstart_layout.png +0 -0
- data/doc/images/verify_quickstart_lifecycle.png +0 -0
- data/doc/images/verify_readme_usage.png +0 -0
- data/doc/images/widget_barchart.png +0 -0
- data/doc/images/widget_block.png +0 -0
- data/doc/images/widget_box.png +0 -0
- data/doc/images/widget_calendar.png +0 -0
- data/doc/images/widget_canvas.png +0 -0
- data/doc/images/widget_cell.png +0 -0
- data/doc/images/widget_center.png +0 -0
- data/doc/images/widget_chart.png +0 -0
- data/doc/images/widget_gauge.png +0 -0
- data/doc/images/widget_layout_split.png +0 -0
- data/doc/images/widget_line_gauge.png +0 -0
- data/doc/images/widget_list.png +0 -0
- data/doc/images/widget_map.png +0 -0
- data/doc/images/widget_overlay.png +0 -0
- data/doc/images/widget_popup.png +0 -0
- data/doc/images/widget_ratatui_logo.png +0 -0
- data/doc/images/widget_ratatui_mascot.png +0 -0
- data/doc/images/widget_rect.png +0 -0
- data/doc/images/widget_render.png +0 -0
- data/doc/images/widget_rich_text.png +0 -0
- data/doc/images/widget_scroll_text.png +0 -0
- data/doc/images/widget_scrollbar.png +0 -0
- data/doc/images/widget_sparkline.png +0 -0
- data/doc/images/widget_style_colors.png +0 -0
- data/doc/images/widget_table.png +0 -0
- data/doc/images/widget_tabs.png +0 -0
- data/doc/images/widget_text_width.png +0 -0
- data/doc/index.md +0 -39
- data/doc/troubleshooting/async.md +0 -4
- data/doc/troubleshooting/terminal_limitations.md +0 -131
- data/doc/troubleshooting/tui_output.md +0 -197
- data/examples/app_all_events/README.md +0 -114
- data/examples/app_all_events/app.rb +0 -98
- data/examples/app_all_events/model/app_model.rb +0 -159
- data/examples/app_all_events/model/event_color_cycle.rb +0 -43
- data/examples/app_all_events/model/event_entry.rb +0 -94
- data/examples/app_all_events/model/msg.rb +0 -39
- data/examples/app_all_events/model/timestamp.rb +0 -56
- data/examples/app_all_events/update.rb +0 -75
- data/examples/app_all_events/view/app_view.rb +0 -80
- data/examples/app_all_events/view/controls_view.rb +0 -54
- data/examples/app_all_events/view/counts_view.rb +0 -61
- data/examples/app_all_events/view/live_view.rb +0 -72
- data/examples/app_all_events/view/log_view.rb +0 -57
- data/examples/app_all_events/view.rb +0 -9
- data/examples/app_cli_rich_moments/README.md +0 -81
- data/examples/app_cli_rich_moments/app.rb +0 -189
- data/examples/app_color_picker/README.md +0 -156
- data/examples/app_color_picker/app.rb +0 -76
- data/examples/app_color_picker/clipboard.rb +0 -86
- data/examples/app_color_picker/color.rb +0 -193
- data/examples/app_color_picker/controls.rb +0 -92
- data/examples/app_color_picker/copy_dialog.rb +0 -168
- data/examples/app_color_picker/export_pane.rb +0 -128
- data/examples/app_color_picker/harmony.rb +0 -58
- data/examples/app_color_picker/input.rb +0 -176
- data/examples/app_color_picker/main_container.rb +0 -180
- data/examples/app_color_picker/palette.rb +0 -111
- data/examples/app_debugging_showcase/README.md +0 -119
- data/examples/app_debugging_showcase/app.rb +0 -318
- data/examples/app_login_form/README.md +0 -58
- data/examples/app_login_form/app.rb +0 -109
- data/examples/app_stateful_interaction/README.md +0 -35
- data/examples/app_stateful_interaction/app.rb +0 -328
- data/examples/timeout_demo.rb +0 -45
- data/examples/verify_quickstart_dsl/README.md +0 -55
- data/examples/verify_quickstart_dsl/app.rb +0 -49
- data/examples/verify_quickstart_layout/README.md +0 -77
- data/examples/verify_quickstart_layout/app.rb +0 -73
- data/examples/verify_quickstart_lifecycle/README.md +0 -68
- data/examples/verify_quickstart_lifecycle/app.rb +0 -62
- data/examples/verify_readme_usage/README.md +0 -49
- data/examples/verify_readme_usage/app.rb +0 -42
- data/examples/verify_website_managed/README.md +0 -48
- data/examples/verify_website_managed/app.rb +0 -36
- data/examples/verify_website_menu/README.md +0 -60
- data/examples/verify_website_menu/app.rb +0 -84
- data/examples/verify_website_spinner/README.md +0 -44
- data/examples/verify_website_spinner/app.rb +0 -34
- data/examples/widget_barchart/README.md +0 -58
- data/examples/widget_barchart/app.rb +0 -240
- data/examples/widget_block/README.md +0 -44
- data/examples/widget_block/app.rb +0 -258
- data/examples/widget_box/README.md +0 -54
- data/examples/widget_box/app.rb +0 -255
- data/examples/widget_calendar/README.md +0 -48
- data/examples/widget_calendar/app.rb +0 -115
- data/examples/widget_canvas/README.md +0 -31
- data/examples/widget_canvas/app.rb +0 -130
- data/examples/widget_cell/README.md +0 -45
- data/examples/widget_cell/app.rb +0 -112
- data/examples/widget_center/README.md +0 -33
- data/examples/widget_center/app.rb +0 -118
- data/examples/widget_chart/README.md +0 -50
- data/examples/widget_chart/app.rb +0 -220
- data/examples/widget_gauge/README.md +0 -50
- data/examples/widget_gauge/app.rb +0 -229
- data/examples/widget_layout_split/README.md +0 -53
- data/examples/widget_layout_split/app.rb +0 -260
- data/examples/widget_line_gauge/README.md +0 -50
- data/examples/widget_line_gauge/app.rb +0 -219
- data/examples/widget_list/README.md +0 -58
- data/examples/widget_list/app.rb +0 -384
- data/examples/widget_map/README.md +0 -48
- data/examples/widget_map/app.rb +0 -95
- data/examples/widget_overlay/README.md +0 -45
- data/examples/widget_overlay/app.rb +0 -250
- data/examples/widget_popup/README.md +0 -45
- data/examples/widget_popup/app.rb +0 -106
- data/examples/widget_ratatui_logo/README.md +0 -43
- data/examples/widget_ratatui_logo/app.rb +0 -104
- data/examples/widget_ratatui_mascot/README.md +0 -43
- data/examples/widget_ratatui_mascot/app.rb +0 -95
- data/examples/widget_rect/README.md +0 -53
- data/examples/widget_rect/app.rb +0 -222
- data/examples/widget_render/README.md +0 -46
- data/examples/widget_render/app.rb +0 -186
- data/examples/widget_render/app.rbs +0 -41
- data/examples/widget_rich_text/README.md +0 -44
- data/examples/widget_rich_text/app.rb +0 -193
- data/examples/widget_scroll_text/README.md +0 -46
- data/examples/widget_scroll_text/app.rb +0 -109
- data/examples/widget_scrollbar/README.md +0 -46
- data/examples/widget_scrollbar/app.rb +0 -155
- data/examples/widget_sparkline/README.md +0 -51
- data/examples/widget_sparkline/app.rb +0 -277
- data/examples/widget_style_colors/README.md +0 -43
- data/examples/widget_style_colors/app.rb +0 -83
- data/examples/widget_table/README.md +0 -57
- data/examples/widget_table/app.rb +0 -279
- data/examples/widget_tabs/README.md +0 -50
- data/examples/widget_tabs/app.rb +0 -183
- data/examples/widget_text_width/README.md +0 -44
- data/examples/widget_text_width/app.rb +0 -117
- data/migrate_to_buffer.rb +0 -145
- data/mise.toml +0 -8
- data/tasks/autodoc/examples.rb +0 -87
- data/tasks/autodoc/member.rb +0 -58
- data/tasks/autodoc/name.rb +0 -21
- data/tasks/autodoc.rake +0 -21
- data/tasks/bump/cargo_lockfile.rb +0 -21
- data/tasks/bump/changelog.rb +0 -47
- data/tasks/bump/header.rb +0 -32
- data/tasks/bump/history.rb +0 -32
- data/tasks/bump/links.rb +0 -69
- data/tasks/bump/manifest.rb +0 -33
- data/tasks/bump/ruby_gem.rb +0 -49
- data/tasks/bump/sem_ver.rb +0 -40
- data/tasks/bump/unreleased_section.rb +0 -56
- data/tasks/bump.rake +0 -51
- data/tasks/doc.rake +0 -887
- data/tasks/example_viewer.html.erb +0 -172
- data/tasks/extension.rake +0 -14
- data/tasks/license/headers_md.rb +0 -223
- data/tasks/license/headers_rb.rb +0 -210
- data/tasks/license/license_utils.rb +0 -130
- data/tasks/license/snippets_md.rb +0 -315
- data/tasks/license/snippets_rdoc.rb +0 -150
- data/tasks/license.rake +0 -91
- data/tasks/lint.rake +0 -170
- data/tasks/rdoc_config.rb +0 -29
- data/tasks/resources/build.yml.erb +0 -60
- data/tasks/resources/index.html.erb +0 -141
- data/tasks/resources/rubies.yml +0 -7
- data/tasks/sourcehut.rake +0 -110
- data/tasks/steep.rake +0 -11
- data/tasks/terminal_preview/app_screenshot.rb +0 -45
- data/tasks/terminal_preview/crash_report.rb +0 -54
- data/tasks/terminal_preview/example_app.rb +0 -27
- data/tasks/terminal_preview/launcher_script.rb +0 -48
- data/tasks/terminal_preview/preview_collection.rb +0 -60
- data/tasks/terminal_preview/preview_timing.rb +0 -24
- data/tasks/terminal_preview/safety_confirmation.rb +0 -58
- data/tasks/terminal_preview/saved_screenshot.rb +0 -56
- data/tasks/terminal_preview/system_appearance.rb +0 -13
- data/tasks/terminal_preview/terminal_window.rb +0 -138
- data/tasks/terminal_preview/window_id.rb +0 -16
- data/tasks/terminal_preview.rake +0 -30
- data/tasks/test.rake +0 -33
- data/tasks/website/index_page.rb +0 -30
- data/tasks/website/version.rb +0 -127
- data/tasks/website/version_menu.rb +0 -68
- data/tasks/website/versioned_documentation.rb +0 -83
- data/tasks/website/website.rb +0 -53
- data/tasks/website.rake +0 -28
data/tasks/lint.rake
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
#--
|
|
4
|
-
# SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
|
|
5
|
-
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
6
|
-
#++
|
|
7
|
-
|
|
8
|
-
require "rubocop/rake_task"
|
|
9
|
-
require "rubycritic/rake_task"
|
|
10
|
-
require "inch/rake"
|
|
11
|
-
|
|
12
|
-
RuboCop::RakeTask.new
|
|
13
|
-
|
|
14
|
-
# Run rubycritic in a shell to prevent it from exiting the rake process
|
|
15
|
-
task :rubycritic do
|
|
16
|
-
sh "bundle exec rubycritic --no-browser exe lib sig"
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
Inch::Rake::Suggest.new("doc:suggest", "exe/**/*.rb", "lib/**/*.rb", "sig/**/*.rbs") do |suggest|
|
|
20
|
-
suggest.args << ""
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
namespace :cargo do
|
|
24
|
-
desc "Run cargo fmt"
|
|
25
|
-
task :fmt do
|
|
26
|
-
sh "cd ext/ratatui_ruby && cargo fmt --all -- --check"
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
desc "Run cargo clippy"
|
|
30
|
-
task :clippy do
|
|
31
|
-
sh "cd ext/ratatui_ruby && cargo clippy -- -D warnings"
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
namespace :reuse do
|
|
36
|
-
desc "Run the REUSE Tool to confirm REUSE compliance"
|
|
37
|
-
task :lint do
|
|
38
|
-
sh "reuse lint"
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
desc "Add SPDX headers to files missing them (per AGENTS.md standards)"
|
|
42
|
-
task :fix do
|
|
43
|
-
copyright = "Kerrick Long <me@kerricklong.com>"
|
|
44
|
-
|
|
45
|
-
# Code files: AGPL-3.0-or-later
|
|
46
|
-
code_extensions = %w[rb rs rake gemspec rbs toml yml yaml json lock].freeze
|
|
47
|
-
code_license = "AGPL-3.0-or-later"
|
|
48
|
-
|
|
49
|
-
# Documentation files: CC-BY-SA-4.0
|
|
50
|
-
doc_extensions = %w[md txt].freeze
|
|
51
|
-
doc_license = "CC-BY-SA-4.0"
|
|
52
|
-
|
|
53
|
-
# Find files missing headers (listed after "no copyright and licensing" message)
|
|
54
|
-
puts "Checking for files missing REUSE headers..."
|
|
55
|
-
output = `reuse lint 2>&1`
|
|
56
|
-
in_missing_section = false
|
|
57
|
-
missing_files = output.lines.filter_map do |line|
|
|
58
|
-
in_missing_section = true if line.include?("no copyright and licensing")
|
|
59
|
-
in_missing_section = false if line.start_with?("# ") && !line.include?("copyright")
|
|
60
|
-
next unless in_missing_section
|
|
61
|
-
|
|
62
|
-
line.match(/^\* (.+)/)&.[](1)
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
if missing_files.empty?
|
|
66
|
-
puts "All files have REUSE headers!"
|
|
67
|
-
else
|
|
68
|
-
missing_files.each do |file|
|
|
69
|
-
ext = File.extname(file).delete(".")
|
|
70
|
-
license = if code_extensions.include?(ext)
|
|
71
|
-
code_license
|
|
72
|
-
elsif doc_extensions.include?(ext)
|
|
73
|
-
doc_license
|
|
74
|
-
else
|
|
75
|
-
puts " Skipping #{file} (unknown extension: .#{ext})"
|
|
76
|
-
next
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
puts " Annotating #{file} with #{license}"
|
|
80
|
-
sh "reuse annotate --license #{license} --copyright '#{copyright}' --skip-existing '#{file}'", verbose: false
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
desc "Normalize Ruby files: frozen_string_literal at top, SPDX in #--/#++ block"
|
|
86
|
-
task :normalize_ruby do
|
|
87
|
-
ruby_extensions = %w[rb rake gemspec].freeze
|
|
88
|
-
# Exclude intentionally-formatted files
|
|
89
|
-
excluded_files = %w[examples/verify_website_menu/app.rb].freeze
|
|
90
|
-
ruby_files = Dir.glob("**/*.{#{ruby_extensions.join(',')}}")
|
|
91
|
-
.reject { |f| f.start_with?("vendor/", "tmp/", ".") || excluded_files.include?(f) }
|
|
92
|
-
|
|
93
|
-
fixed_count = 0
|
|
94
|
-
ruby_files.each do |file|
|
|
95
|
-
content = File.read(file)
|
|
96
|
-
original = content.dup
|
|
97
|
-
|
|
98
|
-
# Skip if no SPDX header
|
|
99
|
-
next unless content.match?(/# SPDX-/)
|
|
100
|
-
|
|
101
|
-
# Extract components
|
|
102
|
-
frozen = content.match?(/^# frozen_string_literal: true/)
|
|
103
|
-
spdx_match = content.match(/(# SPDX-FileCopyrightText:[^\n]+\n(?:#[^\n]*\n)*# SPDX-License-Identifier:[^\n]+\n)/m)
|
|
104
|
-
next unless spdx_match
|
|
105
|
-
|
|
106
|
-
spdx_block = spdx_match[1]
|
|
107
|
-
|
|
108
|
-
# Remove existing frozen_string_literal and SPDX block (and any #--/#+++)
|
|
109
|
-
cleaned = content
|
|
110
|
-
.sub(/^# frozen_string_literal: true\n+/, "")
|
|
111
|
-
.sub(/^#--\s*\n/, "")
|
|
112
|
-
.sub(spdx_block, "")
|
|
113
|
-
.sub(/^#\+\+\s*\n/, "")
|
|
114
|
-
.sub(/\A\n+/, "") # Remove leading blank lines
|
|
115
|
-
|
|
116
|
-
# Rebuild file in correct order: frozen, blank, #--, SPDX, #++, rest
|
|
117
|
-
new_content = ""
|
|
118
|
-
new_content += "# frozen_string_literal: true\n\n" if frozen
|
|
119
|
-
new_content += "#--\n#{spdx_block}#++\n\n"
|
|
120
|
-
new_content += cleaned.sub(/\A\n+/, "") # Ensure no double blank lines
|
|
121
|
-
|
|
122
|
-
if new_content != original
|
|
123
|
-
File.write(file, new_content)
|
|
124
|
-
puts " Normalized #{file}"
|
|
125
|
-
fixed_count += 1
|
|
126
|
-
end
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
puts fixed_count.zero? ? "All Ruby files properly normalized!" : "Fixed #{fixed_count} files."
|
|
130
|
-
end
|
|
131
|
-
end
|
|
132
|
-
task(:reuse) { Rake::Task["reuse:lint"].invoke }
|
|
133
|
-
|
|
134
|
-
namespace :lint do
|
|
135
|
-
task :safe_rdoc_coverage do
|
|
136
|
-
sh "bundle exec rake rdoc:coverage"
|
|
137
|
-
end
|
|
138
|
-
|
|
139
|
-
task docs: %w[autodoc rubycritic safe_rdoc_coverage reuse:lint]
|
|
140
|
-
task code: %w[rubocop rubycritic cargo:fmt cargo:clippy cargo:test]
|
|
141
|
-
task licenses: %w[reuse:lint]
|
|
142
|
-
task all: %w[docs code licenses]
|
|
143
|
-
|
|
144
|
-
namespace :fix do
|
|
145
|
-
desc "Auto-fix RuboCop offenses (most aggressive)"
|
|
146
|
-
task :rubocop do
|
|
147
|
-
sh "bundle exec rubocop --autocorrect-all"
|
|
148
|
-
end
|
|
149
|
-
|
|
150
|
-
desc "Auto-fix Clippy warnings (most aggressive: --fix --allow-dirty --allow-staged)"
|
|
151
|
-
task :clippy do
|
|
152
|
-
sh "cd ext/ratatui_ruby && cargo clippy --fix --allow-dirty --allow-staged"
|
|
153
|
-
end
|
|
154
|
-
|
|
155
|
-
desc "Add SPDX headers and normalize Ruby file structure"
|
|
156
|
-
task reuse: %w[reuse:fix reuse:normalize_ruby]
|
|
157
|
-
|
|
158
|
-
desc "Run all auto-fix tasks"
|
|
159
|
-
task all: %w[lint:fix:rubocop lint:fix:clippy lint:fix:reuse]
|
|
160
|
-
end
|
|
161
|
-
end
|
|
162
|
-
|
|
163
|
-
desc "Run all lint auto-fix tasks"
|
|
164
|
-
task("lint:fix") { Rake::Task["lint:fix:all"].invoke }
|
|
165
|
-
|
|
166
|
-
# Aliases for convenience
|
|
167
|
-
task "rubocop:autocorrect_all" => "lint:fix:rubocop"
|
|
168
|
-
|
|
169
|
-
desc "Run all lint tasks"
|
|
170
|
-
task(:lint) { Rake::Task["lint:all"].invoke }
|
data/tasks/rdoc_config.rb
DELETED
|
@@ -1,29 +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
|
-
module RDocConfig
|
|
9
|
-
MAX_FILE_SIZE = 100_000 # 100KB - skip large files like chat logs
|
|
10
|
-
|
|
11
|
-
RDOC_FILES = Dir.glob(%w[
|
|
12
|
-
doc/**/*.md
|
|
13
|
-
examples/**/*.md
|
|
14
|
-
*.md
|
|
15
|
-
*.rdoc
|
|
16
|
-
lib/**/*.rb
|
|
17
|
-
exe/**/*
|
|
18
|
-
]).reject { |f|
|
|
19
|
-
# Skip large files
|
|
20
|
-
if File.size(f) > MAX_FILE_SIZE
|
|
21
|
-
warn "RDoc: skipping #{f} (#{File.size(f) / 1024}KB > #{MAX_FILE_SIZE / 1024}KB limit)"
|
|
22
|
-
next true
|
|
23
|
-
end
|
|
24
|
-
# Skip verification examples (internal testing, not user-facing)
|
|
25
|
-
f.start_with?("examples/verify_")
|
|
26
|
-
}.freeze
|
|
27
|
-
|
|
28
|
-
MAIN = "README.md"
|
|
29
|
-
end
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
|
|
2
|
-
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
3
|
-
|
|
4
|
-
image: archlinux
|
|
5
|
-
packages:
|
|
6
|
-
- bash
|
|
7
|
-
- base-devel
|
|
8
|
-
- curl
|
|
9
|
-
- openssl
|
|
10
|
-
- libyaml
|
|
11
|
-
- zlib
|
|
12
|
-
- readline
|
|
13
|
-
- gdbm
|
|
14
|
-
- ncurses
|
|
15
|
-
- libffi
|
|
16
|
-
<%- if has_rust -%>
|
|
17
|
-
- clang
|
|
18
|
-
<%- end -%>
|
|
19
|
-
- git
|
|
20
|
-
artifacts:
|
|
21
|
-
- <%= gem_name %>/pkg/<%= gem_filename %>
|
|
22
|
-
sources:
|
|
23
|
-
- https://git.sr.ht/~kerrick/<%= gem_name %>
|
|
24
|
-
tasks:
|
|
25
|
-
- setup: |
|
|
26
|
-
curl https://mise.jdx.dev/install.sh | sh
|
|
27
|
-
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.buildenv
|
|
28
|
-
echo 'eval "$($HOME/.local/bin/mise activate bash)"' >> ~/.buildenv
|
|
29
|
-
echo 'export LANG="en_US.UTF-8"' >> ~/.buildenv
|
|
30
|
-
echo 'export LC_ALL="en_US.UTF-8"' >> ~/.buildenv
|
|
31
|
-
<%- if has_rust -%>
|
|
32
|
-
echo 'export BINDGEN_EXTRA_CLANG_ARGS="-include stdbool.h"' >> ~/.buildenv
|
|
33
|
-
<%- end -%>
|
|
34
|
-
. ~/.buildenv
|
|
35
|
-
export CI="true"
|
|
36
|
-
cd <%= gem_name %>
|
|
37
|
-
sed -i 's/ruby = .*/ruby = "<%= ruby_version %>"/' mise.toml
|
|
38
|
-
mise install
|
|
39
|
-
mise x -- pip install reuse
|
|
40
|
-
mise x -- gem install bundler:<%= bundler_version %>
|
|
41
|
-
mise reshim
|
|
42
|
-
mise x -- bundle config set --local frozen 'true'
|
|
43
|
-
mise x -- bundle install
|
|
44
|
-
<%- if has_rust -%>
|
|
45
|
-
mise x -- bundle exec rake compile
|
|
46
|
-
<%- end -%>
|
|
47
|
-
- test: |
|
|
48
|
-
. ~/.buildenv
|
|
49
|
-
cd <%= gem_name %>
|
|
50
|
-
echo "Testing Ruby <%= ruby_version %>"
|
|
51
|
-
mise x -- bundle exec rake test
|
|
52
|
-
- lint: |
|
|
53
|
-
. ~/.buildenv
|
|
54
|
-
cd <%= gem_name %>
|
|
55
|
-
echo "Linting Ruby <%= ruby_version %>"
|
|
56
|
-
mise x -- bundle exec rake lint
|
|
57
|
-
- package: |
|
|
58
|
-
. ~/.buildenv
|
|
59
|
-
cd <%= gem_name %>
|
|
60
|
-
mise x -- bundle exec rake build
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
|
|
3
|
-
|
|
4
|
-
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
5
|
-
-->
|
|
6
|
-
|
|
7
|
-
<!DOCTYPE html>
|
|
8
|
-
<html lang="en">
|
|
9
|
-
<head>
|
|
10
|
-
<meta charset="UTF-8">
|
|
11
|
-
<title><%= project_name %> documentation</title>
|
|
12
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
13
|
-
<meta name="description" content="API documentation and guides for <%= project_name %>, organized by version.">
|
|
14
|
-
<link rel="stylesheet" href="../styles.css">
|
|
15
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
16
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
17
|
-
<link
|
|
18
|
-
href="https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..900;1,9..144,300..900&family=Source+Sans+3:ital,wght@0,300..900;1,300..900&display=swap"
|
|
19
|
-
rel="stylesheet">
|
|
20
|
-
</head>
|
|
21
|
-
<body>
|
|
22
|
-
<header class="header">
|
|
23
|
-
<div class="header__inner">
|
|
24
|
-
<a href="/" class="header__brand">
|
|
25
|
-
<img src="../logo-small.png" alt="RatatuiRuby Logo" class="header__logo" width="48" height="48">
|
|
26
|
-
<span class="header__wordmark">RatatuiRuby</span>
|
|
27
|
-
</a>
|
|
28
|
-
<nav class="header__nav" aria-label="Primary">
|
|
29
|
-
<a href="/#rich-moments">Better <abbr title="Command Line Interfaces">CLIs</abbr></a>
|
|
30
|
-
<a href="/#build">Full <abbr title="Terminal User Interfaces">TUIs</abbr></a>
|
|
31
|
-
<a href="/#frameworks">Frameworks</a>
|
|
32
|
-
<a href="/docs/v0.10/" class="header__nav-external">API →</a>
|
|
33
|
-
<a href="/docs/v0.10/doc/index_md.html" class="header__nav-external">Guides →</a>
|
|
34
|
-
</nav>
|
|
35
|
-
</div>
|
|
36
|
-
</header>
|
|
37
|
-
|
|
38
|
-
<main>
|
|
39
|
-
<section class="section">
|
|
40
|
-
<div class="section__inner">
|
|
41
|
-
<header class="section__header">
|
|
42
|
-
<span class="section__eyebrow">Reference</span>
|
|
43
|
-
<h1 class="section__title">Documentation</h1>
|
|
44
|
-
<p class="section__intro">API reference, guides, and examples for current and past versions of <%= project_name %>.</p>
|
|
45
|
-
</header>
|
|
46
|
-
|
|
47
|
-
<ul class="version-list">
|
|
48
|
-
<% versions.each do |version| %>
|
|
49
|
-
<li class="version-list__item<%= ' version-list__item--latest' if version.latest? %>">
|
|
50
|
-
<a href="<%= version.slug %>/index.html" class="version-list__link">
|
|
51
|
-
<span class="version-list__name"><%= version.name %></span>
|
|
52
|
-
<span class="version-list__meta">
|
|
53
|
-
<% if version.latest? %>
|
|
54
|
-
Latest release via RubyGems
|
|
55
|
-
<% elsif version.edge? %>
|
|
56
|
-
Pre-release via git
|
|
57
|
-
<% else %>
|
|
58
|
-
Historical
|
|
59
|
-
<% end %>
|
|
60
|
-
</span>
|
|
61
|
-
</a>
|
|
62
|
-
</li>
|
|
63
|
-
<% end %>
|
|
64
|
-
</ul>
|
|
65
|
-
</div>
|
|
66
|
-
</section>
|
|
67
|
-
</main>
|
|
68
|
-
|
|
69
|
-
<footer class="footer">
|
|
70
|
-
<div class="footer__inner">
|
|
71
|
-
<!-- Megafooter columns -->
|
|
72
|
-
<div class="footer__columns">
|
|
73
|
-
<div class="footer__column">
|
|
74
|
-
<h3 class="footer__heading">Get Started</h3>
|
|
75
|
-
<ul class="footer__list">
|
|
76
|
-
<li><a href="/docs/v0.10/doc/getting_started/quickstart_md.html">Quickstart <span
|
|
77
|
-
class="footer__tag">Alpha</span></a>
|
|
78
|
-
</li>
|
|
79
|
-
<li><a href="/docs/v0.10/examples/app_cli_rich_moments/README_md.html">Examples</a></li>
|
|
80
|
-
<li><a href="/docs/v0.10/"><abbr title="Application Programming Interface">API</abbr> Reference</a></li>
|
|
81
|
-
<li><a href="/docs/v0.10/doc/index_md.html">Guides</a></li>
|
|
82
|
-
</ul>
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<div class="footer__column">
|
|
86
|
-
<h3 class="footer__heading">Ecosystem</h3>
|
|
87
|
-
<ul class="footer__list">
|
|
88
|
-
<li><a href="https://git.sr.ht/~kerrick/ratatui_ruby-tea">Tea <span
|
|
89
|
-
class="footer__tag">Alpha</span></a></li>
|
|
90
|
-
<li><a href="https://sr.ht/~kerrick/ratatui_ruby/#chapter-3-the-object-path--kit">Kit <span
|
|
91
|
-
class="footer__tag footer__tag--muted">Planned</span></a></li>
|
|
92
|
-
<li><a href="https://sr.ht/~kerrick/ratatui_ruby/#chapter-5-the-framework">Framework <span
|
|
93
|
-
class="footer__tag footer__tag--muted">Planned</span></a></li>
|
|
94
|
-
<li><a href="https://sr.ht/~kerrick/ratatui_ruby/#chapter-6-licensing"><abbr
|
|
95
|
-
title="User Interface">UI</abbr> Widgets
|
|
96
|
-
<span class="footer__tag footer__tag--muted">Planned</span></a></li>
|
|
97
|
-
</ul>
|
|
98
|
-
</div>
|
|
99
|
-
|
|
100
|
-
<div class="footer__column">
|
|
101
|
-
<h3 class="footer__heading">Community</h3>
|
|
102
|
-
<ul class="footer__list">
|
|
103
|
-
<li><a href="https://lists.sr.ht/~kerrick/ratatui_ruby-discuss">Discuss and Chat</a></li>
|
|
104
|
-
<li><a href="https://lists.sr.ht/~kerrick/ratatui_ruby-announce">Announcements</a></li>
|
|
105
|
-
<li><a href="https://lists.sr.ht/~kerrick/ratatui_ruby-devel">Development</a></li>
|
|
106
|
-
<li><a href="https://todo.sr.ht/~kerrick/ratatui_ruby">Bug Tracker</a></li>
|
|
107
|
-
</ul>
|
|
108
|
-
</div>
|
|
109
|
-
|
|
110
|
-
<div class="footer__column">
|
|
111
|
-
<h3 class="footer__heading">Contribute</h3>
|
|
112
|
-
<ul class="footer__list">
|
|
113
|
-
<li><a href="https://man.sr.ht/~kerrick/ratatui_ruby/contributing.md">Contributing Guide</a></li>
|
|
114
|
-
<li><a href="https://man.sr.ht/~kerrick/ratatui_ruby/code_of_conduct.md">Code of Conduct</a></li>
|
|
115
|
-
<li><a href="https://man.sr.ht/~kerrick/ratatui_ruby/history/index.md">Project History</a></li>
|
|
116
|
-
<li><a href="https://lists.sr.ht/~kerrick/ratatui_ruby-devel/patches">Pull Requests</a></li>
|
|
117
|
-
</ul>
|
|
118
|
-
</div>
|
|
119
|
-
</div>
|
|
120
|
-
|
|
121
|
-
<!-- Bottom bar -->
|
|
122
|
-
<div class="footer__bottom">
|
|
123
|
-
<div class="footer__brand">
|
|
124
|
-
<img src="../logo-small.png" alt="" class="footer__logo" width="32" height="32" aria-hidden="true">
|
|
125
|
-
<span class="footer__wordmark">RatatuiRuby</span>
|
|
126
|
-
</div>
|
|
127
|
-
<nav class="footer__meta" aria-label="Meta links">
|
|
128
|
-
<a href="https://git.sr.ht/~kerrick/ratatui_ruby">Source</a>
|
|
129
|
-
<a href="https://rubygems.org/gems/ratatui_ruby">RubyGems</a>
|
|
130
|
-
<a href="https://ratatui.rs">Ratatui</a>
|
|
131
|
-
<a href="https://builds.sr.ht/~kerrick/ratatui_ruby?">Build Status</a>
|
|
132
|
-
</nav>
|
|
133
|
-
<p class="footer__copy">© 2026 Kerrick Long · Library: <a
|
|
134
|
-
href="https://spdx.org/licenses/LGPL-3.0-or-later.html">LGPL-3.0-or-later</a> · Website: <a
|
|
135
|
-
href="https://spdx.org/licenses/CC-BY-NC-ND-4.0.html">CC-BY-NC-ND-4.0</a> · Snippets: <a
|
|
136
|
-
href="https://spdx.org/licenses/MIT-0.html">MIT-0</a></p>
|
|
137
|
-
</div>
|
|
138
|
-
</div>
|
|
139
|
-
</footer>
|
|
140
|
-
</body>
|
|
141
|
-
</html>
|
data/tasks/resources/rubies.yml
DELETED
data/tasks/sourcehut.rake
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
#--
|
|
4
|
-
# SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
|
|
5
|
-
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
6
|
-
#++
|
|
7
|
-
|
|
8
|
-
desc "Generate SourceHut build manifests from template"
|
|
9
|
-
task sourcehut: "sourcehut:build"
|
|
10
|
-
|
|
11
|
-
namespace :sourcehut do
|
|
12
|
-
desc "Build SourceHut manifests"
|
|
13
|
-
task build: "sourcehut:build:manifest"
|
|
14
|
-
|
|
15
|
-
namespace :build do
|
|
16
|
-
desc "Generate SourceHut build manifests from template"
|
|
17
|
-
task :manifest do
|
|
18
|
-
require "erb"
|
|
19
|
-
require "yaml"
|
|
20
|
-
|
|
21
|
-
spec = Gem::Specification.load("ratatui_ruby.gemspec")
|
|
22
|
-
|
|
23
|
-
# Read version directly from file to ensure we get the latest version
|
|
24
|
-
# even if it was just bumped in the same Rake execution
|
|
25
|
-
version_content = File.read("lib/ratatui_ruby/version.rb")
|
|
26
|
-
version = version_content.match(/VERSION = "(.+?)"/)[1]
|
|
27
|
-
|
|
28
|
-
# Normalize version using Gem::Version - RubyGems converts hyphens
|
|
29
|
-
# (e.g., "1.0.0-beta.1" -> "1.0.0.pre.beta.1")
|
|
30
|
-
normalized_version = Gem::Version.new(version).to_s
|
|
31
|
-
|
|
32
|
-
gem_filename = "#{spec.name}-#{normalized_version}.gem"
|
|
33
|
-
|
|
34
|
-
rubies = YAML.load_file("tasks/resources/rubies.yml")
|
|
35
|
-
|
|
36
|
-
bundler_version = File.read("Gemfile.lock").match(/BUNDLED WITH\n\s+([\d.]+)/)[1]
|
|
37
|
-
|
|
38
|
-
template = File.read("tasks/resources/build.yml.erb")
|
|
39
|
-
erb = ERB.new(template, trim_mode: "-")
|
|
40
|
-
|
|
41
|
-
FileUtils.mkdir_p ".builds"
|
|
42
|
-
|
|
43
|
-
# Remove old generated files to ensure a clean state
|
|
44
|
-
Dir.glob(".builds/*.yml").each { |f| File.delete(f) }
|
|
45
|
-
|
|
46
|
-
rubies.each do |ruby_version|
|
|
47
|
-
filename = ".builds/ruby-#{ruby_version}.yml"
|
|
48
|
-
puts "Generating #{filename}..."
|
|
49
|
-
gem_name = spec.name
|
|
50
|
-
has_rust = File.exist?("ext/#{gem_name}/Cargo.toml")
|
|
51
|
-
content = erb.result_with_hash(ruby_version:, gem_name:, gem_filename:, bundler_version:, has_rust:)
|
|
52
|
-
File.write(filename, content)
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
desc "Update stable branch to match release and set as default"
|
|
58
|
-
task :update_stable do
|
|
59
|
-
# Read version to determine tag
|
|
60
|
-
version_content = File.read("lib/ratatui_ruby/version.rb")
|
|
61
|
-
version = version_content.match(/VERSION = "(.+?)"/)[1]
|
|
62
|
-
tag_name = "v#{version}"
|
|
63
|
-
|
|
64
|
-
# Verify that the version file matches the actual git tag
|
|
65
|
-
# This prevents updating stable to the wrong version if the release failed
|
|
66
|
-
latest_tag = `git describe --tags --abbrev=0`.strip
|
|
67
|
-
if latest_tag != tag_name
|
|
68
|
-
abort "Fatal: Version mismatch! 'lib/ratatui_ruby/version.rb' says #{tag_name}, but the latest git tag is #{latest_tag}."
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
puts "Updating stable branch to point to #{tag_name}..."
|
|
72
|
-
# Resolve the tag to a commit hash (peel annotated tags)
|
|
73
|
-
# This renders a commit SHA that can be pushed to a branch head
|
|
74
|
-
commit_sha = `git rev-parse #{tag_name}^{}`.strip
|
|
75
|
-
|
|
76
|
-
# Update local stable branch to match
|
|
77
|
-
sh "git branch -f stable #{commit_sha}"
|
|
78
|
-
|
|
79
|
-
# Push the commit to remote stable branch
|
|
80
|
-
# This creates 'stable' if it doesn't exist, or fast-forwards it.
|
|
81
|
-
sh "git push origin #{commit_sha}:stable"
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
if Rake::Task.task_defined?("release")
|
|
86
|
-
Rake::Task["release"].enhance do
|
|
87
|
-
# Replace Bundler's normalized tag with semver-style for prerelease versions.
|
|
88
|
-
# Bundler creates tags using normalized Gem::Version (e.g., v1.0.0.pre.beta.1).
|
|
89
|
-
# Semver uses hyphens (e.g., v1.0.0-beta.1). We want only the semver tag.
|
|
90
|
-
version_content = File.read("lib/ratatui_ruby/version.rb")
|
|
91
|
-
version = version_content.match(/VERSION = "(.+?)"/)[1]
|
|
92
|
-
|
|
93
|
-
if version.include?("-")
|
|
94
|
-
normalized_tag = "v#{Gem::Version.new(version)}"
|
|
95
|
-
semver_tag = "v#{version}"
|
|
96
|
-
|
|
97
|
-
if normalized_tag != semver_tag
|
|
98
|
-
puts "Replacing normalized tag #{normalized_tag} with semver tag #{semver_tag}..."
|
|
99
|
-
# Delete the normalized tag locally and remotely
|
|
100
|
-
sh "git tag -d #{normalized_tag}"
|
|
101
|
-
sh "git push origin :refs/tags/#{normalized_tag}"
|
|
102
|
-
# Create the semver tag pointing to the same commit
|
|
103
|
-
sh "git tag #{semver_tag} HEAD"
|
|
104
|
-
sh "git push origin #{semver_tag}"
|
|
105
|
-
end
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
Rake::Task["sourcehut:update_stable"].invoke
|
|
109
|
-
end
|
|
110
|
-
end
|
data/tasks/steep.rake
DELETED
|
@@ -1,45 +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 "tmpdir"
|
|
9
|
-
require_relative "launcher_script"
|
|
10
|
-
require_relative "terminal_window"
|
|
11
|
-
require_relative "crash_report"
|
|
12
|
-
|
|
13
|
-
class AppScreenshot < Data.define(:app, :output_path)
|
|
14
|
-
def capture
|
|
15
|
-
print " 📸 #{app}..."
|
|
16
|
-
|
|
17
|
-
LauncherScript.new(app.app_path, Dir.pwd).run do |launcher|
|
|
18
|
-
TerminalWindow.new(launcher.path, launcher.pid_file).open do |window|
|
|
19
|
-
take_snapshot(window.window_id)
|
|
20
|
-
|
|
21
|
-
if File.size?(output_path)
|
|
22
|
-
puts " done."
|
|
23
|
-
true
|
|
24
|
-
else
|
|
25
|
-
FileUtils.rm_f(output_path)
|
|
26
|
-
puts " FAILED"
|
|
27
|
-
puts
|
|
28
|
-
puts " Window rendered nothing (app may have crashed before drawing)"
|
|
29
|
-
puts
|
|
30
|
-
false
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
rescue => e
|
|
35
|
-
puts " FAILED"
|
|
36
|
-
puts
|
|
37
|
-
puts CrashReport.new(app, e, "Program crashed before screenshot could be taken:")
|
|
38
|
-
puts
|
|
39
|
-
false
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
private def take_snapshot(window_id)
|
|
43
|
-
system("screencapture", "-l", window_id.to_s, "-o", "-x", output_path)
|
|
44
|
-
end
|
|
45
|
-
end
|
|
@@ -1,54 +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
|
-
class CrashReport < Data.define(:app, :error, :preamble)
|
|
9
|
-
def self.new(app, error, preamble = nil)
|
|
10
|
-
# Allow preamble to be optional while Data.define requires all fields
|
|
11
|
-
super(app:, error:, preamble:)
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def to_s
|
|
15
|
-
output = error.message.strip
|
|
16
|
-
formatted_error = output.split("\n").map { |line| format_line(line) }.join("\n")
|
|
17
|
-
preamble_section = preamble ? <<~PREAMBLE.chomp : ""
|
|
18
|
-
#{box_top}
|
|
19
|
-
#{format_line(preamble)}
|
|
20
|
-
#{box_bottom}
|
|
21
|
-
PREAMBLE
|
|
22
|
-
|
|
23
|
-
<<~TEXT
|
|
24
|
-
#{preamble_section}
|
|
25
|
-
#{border_top(app.to_s)}
|
|
26
|
-
#{formatted_error}
|
|
27
|
-
#{box_bottom}
|
|
28
|
-
TEXT
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
private def box_top
|
|
32
|
-
"┌#{'─' * (width - 2)}┐"
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
private def box_bottom
|
|
36
|
-
"└#{'─' * (width - 2)}┘"
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
private def border_top(title)
|
|
40
|
-
left = "┌─ #{title} "
|
|
41
|
-
right = "┐"
|
|
42
|
-
dashes = "─" * (width - left.length - right.length)
|
|
43
|
-
left + dashes + right
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
private def format_line(line)
|
|
47
|
-
truncated = line[0...(width - 4)]
|
|
48
|
-
"│ #{truncated.ljust(width - 4)} │"
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
private def width
|
|
52
|
-
80
|
|
53
|
-
end
|
|
54
|
-
end
|
|
@@ -1,27 +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
|
-
class ExampleApp < Data.define(:directory)
|
|
9
|
-
def self.all
|
|
10
|
-
examples_dir = File.expand_path("../../examples", __dir__)
|
|
11
|
-
Dir.glob("#{examples_dir}/*/app.rb").map do |path|
|
|
12
|
-
new(File.basename(File.dirname(path)))
|
|
13
|
-
end.sort_by(&:directory)
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def app_path
|
|
17
|
-
"examples/#{directory}/app.rb"
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def screenshot_filename
|
|
21
|
-
"#{directory}.png"
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def to_s
|
|
25
|
-
directory
|
|
26
|
-
end
|
|
27
|
-
end
|