A screenshot of the Rooibos website. The header has a red cup of tea as a logo, with Rooibos and a navigation bar including "Get Started," "The Pattern," "Testing," "Ecosystem," "API ->," "Guides ->," and "Examples ->." The visible part of the webpage says:
See it in action
## Hello, MVU
The simplest Rooibos app. Press any key to increment the counter. Press Ctrl+C to quit.
require "rooibos"
module Counter
# Init: How do you create the initial model?
Init = -> { 0 }
# View: What does the user see?
View = -> (model, tui) { tui.paragraph(text: <<~END) }
Current count: #{model}.
Press any key to increment.
Press Ctrl+C to quit.
END
# Update: What happens when things change?
Update = -> (message, model) {
if message.ctrl_c?
Rooibos::Command.exit
elsif message.key?
model + 1
end
}
end
Rooibos.run(Counter)
That's the whole pattern: Model holds state, Init creates it, View renders it, and Update changes it. The runtime handles everything else.
#### Get Started
* Why Rooibos?
* Installation
* Ruby Primer
* Quickstart
* Tutorial: Build a File Browser
#### Learn the Essentials
* The MVU Pattern
* Models & State
* Messages
* Update Functions
* Views
* Commands
> 60 lines of code Build a Complete File Browser Navigate directories, open files, handle errors, style content, vim keybindings — all working.