Module: Rooibos

Defined in:
lib/rooibos.rb,
lib/rooibos/cli.rb,
lib/rooibos/error.rb,
lib/rooibos/router.rb,
lib/rooibos/command.rb,
lib/rooibos/message.rb,
lib/rooibos/runtime.rb,
lib/rooibos/version.rb,
lib/rooibos/welcome.rb,
lib/rooibos/shortcuts.rb,
lib/rooibos/transition.rb,
lib/rooibos/command/all.rb,
lib/rooibos/message/all.rb,
lib/rooibos/router/rule.rb,
lib/rooibos/test_helper.rb,
lib/rooibos/command/http.rb,
lib/rooibos/command/open.rb,
lib/rooibos/command/wait.rb,
lib/rooibos/message/open.rb,
lib/rooibos/router/guard.rb,
lib/rooibos/router/route.rb,
lib/rooibos/command/batch.rb,
lib/rooibos/command/clock.rb,
lib/rooibos/command/timed.rb,
lib/rooibos/configuration.rb,
lib/rooibos/message/batch.rb,
lib/rooibos/message/clock.rb,
lib/rooibos/message/error.rb,
lib/rooibos/message/timer.rb,
lib/rooibos/router/action.rb,
lib/rooibos/command/bubble.rb,
lib/rooibos/command/custom.rb,
lib/rooibos/command/outlet.rb,
lib/rooibos/command/random.rb,
lib/rooibos/message/random.rb,
lib/rooibos/message/routed.rb,
lib/rooibos/command/deliver.rb,
lib/rooibos/message/bubbled.rb,
lib/rooibos/router/registry.rb,
lib/rooibos/cli/commands/new.rb,
lib/rooibos/cli/commands/run.rb,
lib/rooibos/message/canceled.rb,
lib/rooibos/router/predicate.rb,
lib/rooibos/command/lifecycle.rb,
lib/rooibos/router/flow/inward.rb,
lib/rooibos/router/flow/outward.rb,
lib/rooibos/router/rule/forward.rb,
lib/rooibos/router/rule/observe.rb,
lib/rooibos/router/rule/receive.rb,
lib/rooibos/message/system/batch.rb,
lib/rooibos/router/flow/dispatch.rb,
lib/rooibos/router/router_update.rb,
lib/rooibos/message/http_response.rb,
lib/rooibos/message/system/stream.rb,
lib/rooibos/router/rule/otherwise.rb,
lib/rooibos/router/registry/routes.rb,
lib/rooibos/router/registry/actions.rb,
lib/rooibos/router/registry/forwards.rb,
lib/rooibos/router/registry/observes.rb,
lib/rooibos/router/registry/receives.rb,
lib/rooibos/router/registry/otherwises.rb

Overview

– SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>

SPDX-License-Identifier: AGPL-3.0-or-later ++

Defined Under Namespace

Modules: CLI, Command, Message, Router, Shortcuts, TestHelper, Welcome Classes: Configuration, Error, Runtime, Transition

Constant Summary collapse

VERSION =

The version of this gem. See semver.org/spec/v2.0.0.html

"0.8.0"

Class Method Summary collapse

Class Method Details

.normalize_init(result) ⇒ Object

Normalizes Init callable return value to [model, command] tuple.

Init callables use DWIM syntax. They can return just a model, just a command, or a full [model, command] tuple.

This method handles all formats. Use it when composing child fragment Inits in fractal architecture.

result

The Init return value.

Examples

– SPDX-SnippetBegin SPDX-FileCopyrightText: 2026 Kerrick Long SPDX-License-Identifier: MIT-0 ++

# Parent fragment composes children
Init = ->(theme:) do
  stats_model, stats_cmd = Rooibos.normalize_init(StatsPanel::Init.(theme: theme))
  network_model, network_cmd = Rooibos.normalize_init(NetworkPanel::Init.(theme: theme))

  model = Model.new(stats: stats_model, network: network_model)
  command = Command.batch(stats_cmd, network_cmd)
  [model, command]
end

– SPDX-SnippetEnd ++



64
65
66
# File 'lib/rooibos.rb', line 64

def self.normalize_init(result)
  Runtime.normalize_init(result)
end

.run(root_fragment = nil) ⇒ Object

Starts the MVU event loop.

Convenience delegator to Runtime.run. See Runtime for full documentation.



31
32
33
# File 'lib/rooibos.rb', line 31

def self.run(root_fragment = nil, **)
  Runtime.run(root_fragment, **)
end