Website Managed Loop Verification

Verifies the full-screen managed loop example on the RatatuiRuby website.

This example exists as a documentation regression test. It ensures the websiteโ€™s โ€œBuild Something Realโ€ managed loop demo remains functional.

Usage

RatatuiRuby.run do |tui|
  loop do
    tui.draw do |frame|
      frame.render_widget(
        tui.paragraph(
          text: "Hello, RatatuiRuby!",
          alignment: :center,
          block: tui.block(
            title: "My App",
            titles: [{ content: "q: Quit", position: :bottom, alignment: :right }],
            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

Features Demonstrated