Ruby gems that bind Rust crates one to one.
Rust has well-tested crates for jobs Ruby's standard library leaves alone: the system clipboard, native file dialogs, desktop notifications, global hotkeys, URLs parsed the way browsers parse them. Binding one yourself means writing and maintaining native code, and a binding that invents its own API leaves you translating between its docs and the crate's.
Each Ferro gem binds one crate and mirrors it: the crate's names, errors, and behavior, translated only where Rust has no Ruby meaning. The crate's own documentation stays your guide. Ferro spun out of Tokra, whose plugins build on these gems.
| Gem | Crate | Status |
|---|---|---|
| ferro-arboard | arboard 3.7.0, the system clipboard | 0.1.0.pre.2 |
| ferro-rfd | rfd 0.17.2, native file and message dialogs | 0.1.0.pre.2 |
| ferro-notify-rust | notify-rust 4.18.2, desktop notifications | 0.1.0.pre.1, unreleased |
| ferro-global-hotkey | global-hotkey 0.9.0, global hotkeys | 0.1.0.pre.1, unreleased |
| ferro-idna | idna 1.1.0, internationalized domain names | 0.1.0.pre.1, unreleased |
| ferro-url | url 2.5.8, WHATWG URLs | 0.1.0.pre.1, unreleased |
| ferro-time | time 0.3.55, dates, times, offsets, and durations | 0.1.0.pre.1, unreleased |
require "ferro/arboard"
clipboard = Ferro::Arboard::Clipboard.new
clipboard.set_text("Hello from Ruby")
clipboard.get_text # => "Hello from Ruby"Each gem compiles a Rust extension when it installs, so you need Rust and Cargo. Its README names the versions.
Nothing is on RubyGems.org yet. Each release is a tag, such as
ferro-arboard/v0.1.0, so take a gem from its tag:
# Gemfile
gem "ferro-arboard", git: "https://github.com/setdef/Ferro", tag: "ferro-arboard/v0.1.0", glob: "gems/*/*.gemspec"Ferro needs Ruby 4.0 and Rust; mise installs both
from mise.toml, along with the REUSE tool the
gate uses.
mise install
mise x -- pip install "reuse[charset-normalizer]==6.2.0"
bundle install
bundle exec rake # the gate: every check, across every gem
bundle exec rake gate:arboard # one gem's checks, while you work on itEach gem releases on its own, through rake tasks: rake bump:arboard:patch
commits a release, and rake release:arboard:tag tags it and pushes the
tag. A new gem's first release is rake bump:<gem>:current, which
releases the version it starts at instead of skipping past it.
AGENTS.md says who may run which.
Start with AGENTS.md, which holds the rules for people and agents alike, and ADR 001, which explains how a crate becomes a gem.
Each gem takes its crate's license: ferro-arboard is MIT OR Apache-2.0, as arboard is, ferro-rfd is MIT, as rfd is, ferro-notify-rust is MIT OR Apache-2.0, as notify-rust is, ferro-global-hotkey is Apache-2.0 OR MIT, as global-hotkey is, and ferro-idna, ferro-url, and ferro-time are MIT OR Apache-2.0, as idna, url, and time are. The repository's tooling is AGPL-3.0-or-later. Documentation is CC-BY-SA-4.0, code snippets in it are MIT-0, and lockfiles are CC0-1.0. Every file says which applies; REUSE checks it, and the texts are in LICENSES.