Ruflet
Ruflet lets Ruby developers build web, desktop, and mobile interfaces with a single Ruby UI layer.
Quick Start
Install the CLI and create an app:
gem install ruflet
ruflet new my_app
cd my_app
bundle install
ruflet runruflet run starts the Ruby backend and prints a QR code for a mobile client.
Use --web to open the web client or --desktop to launch the desktop client:
ruflet run --web
ruflet run --desktopWrite An App
The generated main.rb is the application entrypoint:
require "ruflet"
Ruflet.run do |page|
page.title = "Counter"
count = 0
value = text("0", size: 40)
page.add(
column(
children: [
value,
button(
"Add one",
on_click: ->(_event) do
count += 1
page.update(value, value: count.to_s)
end
)
]
)
)
endControl builders such as text, button, row, and column create the UI.
The page object manages application-level behavior including navigation,
dialogs, services, and updates.
Project Files
A generated Ruflet app includes:
-
main.rb- Ruby application entrypoint -
ruflet.yaml- app metadata, assets, extensions, and build settings -
services.yaml- protected device capabilities requested by the app -
Gemfile- Ruflet runtime dependencies
Declare camera, microphone, location, or motion access in services.yaml.
Declare optional UI extensions, such as maps or webview, in ruflet.yaml.
CLI
ruflet run [scriptname|path] [--web|--desktop] [--port PORT]
ruflet debug [scriptname|path]
ruflet devices
ruflet emulators
ruflet doctor
ruflet update [web|desktop|all] [--check] [--force]
ruflet build <apk|android|ios|aab|web|macos|windows|linux>
ruflet install [--device DEVICE_ID]Run ruflet install without --device to choose from a numbered list of
connected devices. Pass --device DEVICE_ID to skip the prompt.
Add --self to a native build when the Ruby runtime and application should be
packaged inside the client. Without --self, the built client connects to a
separately running Ruflet backend.
Rails
Use the ruflet_rails gem to mount Ruflet applications inside Rails, share
Rails models, and generate Ruflet components from standard Rails scaffolds.
See packages/ruflet_rails/README.md.
Packages
-
rufletprovides the project generator and command-line tools. -
ruflet_coreprovides controls, page APIs, and the Ruby UI runtime. -
ruflet_serverruns server-driven Ruflet applications. -
ruflet_railsintegrates Ruflet with Rails. -
ruby_runtimeembeds Ruby for self-contained native applications.