Ruflet is a Ruby port of Flet for building web, desktop, and mobile apps in Ruby.
Ruflet supports both class-based apps and Ruflet.run do |page| ... end.
The generated scaffold uses Ruflet.run.
- Install mobile client app from releases:
- Ruflet Releases
- Install latest Android APK or iOS build.
- Install Ruflet from RubyGems:
gem install ruflet- Create and run your first app:
ruflet new my_app
cd my_app
bundle install
ruflet run main.rb- Open Ruflet mobile client and connect:
- Enter URL manually, or
- Tap
Scan QRand scan QR shown byruflet run ...
Ruflet is split into packages:
ruflet: CLI/install package users install from RubyGemsruflet_core: core runtime implementation (protocol + UI)ruflet_server: WebSocket runtime (Ruflet.runbackend)ruflet_rails: Rails integration/protocol adapter
Monorepo folders:
packages/rufletpackages/ruflet_corepackages/ruflet_serverpackages/ruflet_rails
ruflet new <appname> generates a Gemfile with runtime dependencies:
gem "ruflet_core"gem "ruflet_server"
The CLI gem has been renamed:
- old:
gem install ruflet_cli - new:
gem install ruflet
ruflet now follows the old ruflet_cli dependency shape and only carries CLI dependencies.
App projects should keep runtime gems in the app Gemfile:
gem "ruflet_core"gem "ruflet_server"
Use the current scaffold style:
require "ruflet"
Ruflet.run do |page|
page.title = "Counter Demo"
count = 0
count_text = text(count.to_s, style: { size: 40 })
page.add(
container(
expand: true,
alignment: Ruflet::MainAxisAlignment::CENTER,
content: column(
alignment: Ruflet::MainAxisAlignment::CENTER,
horizontal_alignment: Ruflet::CrossAxisAlignment::CENTER,
children: [
text("You have pushed the button this many times:"),
count_text
]
)
),
floating_action_button: fab(
icon: Ruflet::MaterialIcons::ADD,
on_click: ->(_e) do
count += 1
page.update(count_text, value: count.to_s)
end
)
)
endWidget builders are global/free helpers (text, row, column, container, etc.).
Use page only for runtime/page operations (add, update, go, show_dialog, pop_dialog).
ruflet new <appname>
ruflet run [scriptname|path] [--web|--desktop] [--port PORT]
ruflet update [web|desktop|all] [--check] [--force] [--platform PLATFORM]
ruflet build <apk|ios|aab|web|macos|windows|linux>For monorepo development (always uses local CLI source), run:
By default ruflet build ... looks for Flutter client at ./ruflet_client.
Set RUFLET_CLIENT_DIR to override.
cd /Users/macbookpro/Documents/Izeesoft/FlutterApp/ruflet
/opt/homebrew/opt/ruby/bin/bundle install- Creating New App
- Widgets Guide
- Example apps: main.rb, solitaire.rb, calculator.rb