gem install rufletBreaking change:
- old install command:
gem install ruflet_cli - new install command:
gem install ruflet
ruflet new my_app
cd my_appbundle installruflet run main.rbWhen running mobile target, CLI prints:
- mobile connect URL
- WebSocket URL
- QR code for scan-connect
Install Ruflet mobile app from:
Then either:
- manually enter URL shown in terminal, or
- tap
Scan QRand scan terminal QR
ruflet run main.rb --web
ruflet run main.rb --desktopMobile is the default target, so ruflet run main.rb is enough.
ruflet build apk
ruflet build ios
ruflet build web
ruflet build macos
ruflet build windows
ruflet build linuxruflet newgenerates appGemfilewithgem "ruflet_core"andgem "ruflet_server".- App code can use
Ruflet.run do |page| ... endor a class-based app.
main.rb:
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
)
)
end