$LOAD_PATH.unshift File.expand_path("../../lib", __dir__)
require "ratatui_ruby"
class VerifyReadmeUsage
def run
RatatuiRuby.run do |tui|
loop do
tui.draw do |frame|
frame.render_widget(
tui.paragraph(
text: "Hello, Ratatui! Press 'q' to quit.",
alignment: :center,
block: tui.block(
title: "My Ruby TUI App",
borders: [:all],
border_style: { fg: "cyan" }
)
),
frame.area
)
end
case tui.poll_event
in { type: :key, code: "q" } | { type: :key, code: "c", modifiers: ["ctrl"] }
break
else
nil
end
end
end
end
end
VerifyReadmeUsage.new.run if __FILE__ == $PROGRAM_NAME