Project

ruflet_cli

0.01
No release in over 3 years
Ruflet command line interface for creating and running Ruflet apps.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 2.2
 Project Readme

Ruflet

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.

Start Here

  1. Install mobile client app from releases:
  1. Install Ruflet from RubyGems:
gem install ruflet
  1. Create and run your first app:
ruflet new my_app
cd my_app
bundle install
ruflet run main.rb
  1. Open Ruflet mobile client and connect:
  • Enter URL manually, or
  • Tap Scan QR and scan QR shown by ruflet run ...

Package Split

Ruflet is split into packages:

  • ruflet: CLI/install package users install from RubyGems
  • ruflet_core: core runtime implementation (protocol + UI)
  • ruflet_server: WebSocket runtime (Ruflet.run backend)
  • ruflet_rails: Rails integration/protocol adapter

Monorepo folders:

  • packages/ruflet
  • packages/ruflet_core
  • packages/ruflet_server
  • packages/ruflet_rails

New Project Behavior

ruflet new <appname> generates a Gemfile with runtime dependencies:

  • gem "ruflet_core"
  • gem "ruflet_server"

Breaking Change

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"

App Style (Required in docs/examples)

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
    )
  )
end

Widget builders are global/free helpers (text, row, column, container, etc.). Use page only for runtime/page operations (add, update, go, show_dialog, pop_dialog).

CLI

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> [--self] [--verbose]

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.

  • ruflet build ... --self uses the self-contained Flutter entrypoint with ruby_runtime.
  • ruflet build ... without --self builds the server-driven client entrypoint.

Development (Monorepo)

cd /Users/macbookpro/Documents/Izeesoft/FlutterApp/ruflet
/opt/homebrew/opt/ruby/bin/bundle install

Documentation