Rust crates for Ruby, one gem per crate, each bound one to one.
For some jobs, Rust has a crate and Ruby has nothing to match it: reading the system clipboard, catching a keyboard shortcut while another program has focus, opening the system's file dialog, or reading a URL, a domain name, or a date the way a browser or a Rust program reads it. Ferro turns each such crate into a Ruby gem that keeps the crate's names, errors, error messages, and behavior, so the crate's documentation describes the gem too. Each gem's README lists where the gem differs from its crate, and why.
Ferro is for Ruby developers who need what one of those crates does, in a command-line tool, a desktop app, or code that trades data with a Rust program. Tokra, a port of Tauri to Ruby, builds on Ferro's gems.
Compared with what you may use now:
- Ruby's standard library has no clipboard, global shortcuts, native
dialogs, or desktop notifications. Where it overlaps with a crate, it
follows other rules:
URIraisesURI::InvalidURIErroronHTTPS://Bücher.example\shop, a URL a browser opens, andTime.parsereads2026-02-30as March 2, a date the time crate refuses. - Writing a binding yourself, with
magnus and
rb-sys as Ferro does, you bind
the methods your project calls, under names you choose, and keep up
with each release of the crate yourself. Ferro's rules have each gem
bind the crate's whole public API at its latest release, and each
README says which release that is. A Ferro gem catches a panic in the
crate and raises an exception you can rescue, where magnus alone turns
the panic into Ruby's
fatal, which ends the process. Each gem ships RBS signatures and RDoc for its whole API.
Each gem has a folder under gems/, and its README there says how to
install the gem, what it runs on, and how to use it.
- ferro-arboard binds arboard: read and write the system clipboard's text, HTML, images, and lists of files.
- ferro-global_hotkey binds global-hotkey: register a keyboard shortcut for the whole system, and get an event each time someone presses or releases it.
- ferro-idna binds idna: turn a Unicode domain name into the ASCII form DNS looks up, and back, by the rules browsers follow.
- ferro-kdl binds kdl: read a KDL document, keep its comments and spacing when you print it, and get the position of each fault in a bad one.
- ferro-notify_rust binds notify-rust: show a desktop notification, with buttons, and wait for the one the person clicks.
- ferro-rfd binds rfd: open the system's dialogs to pick files or a folder, choose where to save, or ask a question with a few buttons.
- ferro-time binds time: parse, format, and compute dates, times of day, UTC offsets, and durations by the time crate's rules.
- ferro-url binds url: parse, resolve, change, and serialize URLs by the WHATWG URL Standard, as browsers do.
- ferro-usage_lib binds usage-lib: parse a program's command line by a usage spec, show its help, and write its man page and shell completions.
The releases page lists the gems' releases, with their notes.
Report a bug under
Bug Reports on the setdef
forum, and ask a question under
Discussion. Name the
gem and its version, and give your operating system, the output of
ruby -v and rustc -V, the code you ran, what you expected, and its
full output. Where a gem and its crate in Rust disagree, the bug is the
gem's.
Report a security problem privately, as SECURITY.md says, never on the forum.
CONTRIBUTING.md holds the rules for everyone who
changes Ferro. To build the gems, install git and mise,
then run bin/setup (bin\setup.cmd on Windows) in your checkout;
AGENTS.md lists the commands that run the tests and the
checks a push has to pass.
Each gem is under the license of the crate it binds, as its README says.
Everything else in this repository is licensed by what it is. The
tooling that builds, checks, and releases the gems, such as the Rakefile
and tasks/, is under the
GNU AGPL 3.0 or later. No gem contains
any of it, so a program that uses a gem takes on only that gem's
license. The documentation outside the gems is under
CC BY-SA 4.0. Each gem's README, CHANGELOG,
and design document are under CC BY 4.0, as
its code is permissive. Code examples in documentation are under
MIT-0, so you can paste them with no notice, and
Gemfile.lock is under CC0 1.0. A few files
taken from other projects, such as the RuboCop configuration in
vendor/goodcop, keep their MIT license. The
header of each file, or REUSE.toml, lists the file's
license, as the REUSE Specification
requires.
I use four words for how code and prose comes to exist. Code or prose I wrote, I typed by hand, with nothing generated. Code or prose I wrought, an AI agent generated while I iterated with it, and I reviewed every change before committing it, so I own every diff. Code or prose I requested, an agent built with little or no review from me, but I take ownership of the outcome or product because I tested and iterated. Code or prose I rushed, an agent built with little or no feedback from me, and may or may not be useful (or safe).
Everything in Ferro outside the gems' folders is rushed: AI agents built its tooling, CI, and shared documents, this README included, with little or no feedback from the maintainer, under the rules in AGENTS.md and CONTRIBUTING.md. In place of review, the pre-push hook runs the tooling's tests, RuboCop, and REUSE's check on each push, and CI runs them again on Linux, macOS, and Windows. Each gem's README says how that gem is made. declare-ai.org.