EN /HU | Login

RuBBS

rubbs is an in-house Ruby gem for building Telnet BBS servers — from a one-screen line prompt to a full Synchronet-style multi-window application, all in Ruby. It powers our BBS Server.

What you get

  • Telnet & ANSI — IAC negotiation (SGA, ECHO, NAWS terminal size), full-screen ANSI with a double-buffered delta diff, xterm 1000/1006 SGR mouse for clickable menus and wheel-scroll lists.
  • Widgets — Label, Button, TextInput, TextArea, Checkbox, ListBox, ScrollView, ProgressBar, Spinner, plus HBox / VBox / Panel containers and a CP437 ANSI-art viewer.
  • Pre-built windowsInfo, Form, MasterDetail, Stream (chat / log), opened imperatively or from a window DSL.
  • Theming — five presets (synchronet, nortoncommander, dosnavigator, neumanntronics, mono), each a frozen role-name → ANSI palette, overridable per key.
  • Markdown & ASCII art — Markdown-to-ANSI renderer, box-drawing banners, FIGlet (Artii) big banners, ERB screen templates.
  • PersistenceBBS::Store: a thread-safe, upsert-by-session_id CSV file with an in-memory cache.

Overview

The gem is named bbs. It boots a TCP listener, handles Telnet negotiation, hands each connection a Session, and gives you three layers to build on. Your code declares only screens, windows and services.

RUBY
require 'bbs'

BBS.configure do |c|
  c.flow = BBS::Flow.define do
    big_banner 'My BBS'
    ask :name, prompt: 'Your name'
    say 'Welcome!', style: :success
  end
end

BBS.start

Connect with telnet localhost 2323.

The three layers

Layer What it is When to use
BBS::Flow Line-oriented declarative dialogue (ask / say / menu / persist) Login, registration, simple wizards
BBS::TUI Single-screen page router with frame-buffer delta rendering Single-purpose full-screen UIs
BBS::Application Widget framework: Menubar, Window, Button, TextInput, ListBox, … Multi-window Synchronet-style BBSes

They mix in one session — typically Flow for login, then Application for the main shell. Inside a flow you can hand off and return when the user exits.

TEXT
TCPServer → Session → FlowRunner ─┬→ TUIRunner
                                  ├→ Application#run
                                  └→ FlowRunner (sub-flow)

Installation

RUBY
gem 'bbs', git: 'https://git.teletypegames.org/engines/rubbs.git'

Used by the Teletype Games BBS

Our public BBS Server (games.teletype.hu:2323) runs on rubbs. The gem provides the ANSI interface, menubar, stacked modal windows, Telnet server and mouse support; the bbs-server repo holds only Teletype-specific configuration — service wiring, window definitions, formatters.

Source layout

File Responsibility
lib/bbs.rb Public surface: BBS.configure, BBS.config, BBS.start.
bbs/server.rb TCP accept loop, one thread per client.
bbs/session.rb Telnet negotiation, mouse enable/disable, idle timer.
bbs/telnet.rb Telnet protocol, key parsing, xterm SGR mouse.
bbs/flow.rb, bbs/flow_runner.rb Flow DSL + interpreter.
bbs/tui.rb, bbs/tui_runner.rb Page router with frame-buffer rendering.
bbs/frame_buffer.rb Double-buffer, delta diff, ANSI string utilities.
bbs/application.rb Widget event loop, window stack, builder DSL.
bbs/widgets.rb, bbs/widget.rb, bbs/container.rb Widget tree + built-in widgets.
bbs/window.rb, bbs/windows/* Window + pre-built window types.
bbs/theme.rb Style palette presets.
bbs/markdown.rb Markdown → ANSI line renderer.
bbs/store.rb Thread-safe cached CSV upsert.

Repository

https://git.teletypegames.org/engines/rubbs