Installation

Globally

To install Farce globally, you can use the following command:

$ gem install farce

As a project dependency

If you want to use Farce directly in your project, it is recommended to do so via Bundler. Add Farce to your Gemfile:

source "https://gem.coop" # or "https://rubygems.org"

gem "farce"

Then run bundle install to install the dependencies.

As a library dependency

Farce's main purpose is to be used as a dependency for other libraries. As such, it will most commonly be added as a runtime dependency to your gemspec:

Gem::Specification.new do |spec|
  # ...
  spec.add_dependency "farce"
end

Local setup

If you want to work on Farce itself, you can clone the repository and use mise to set everything up:

For more details, or if you aren't using mise, check the contribution guidelines.

$ git clone https://github.com/rkh/farce.git # prefix with `jj` if you're using Jujutsu
$ cd farce
$ mise run

Loading Farce

You should always require farce, rather than any other files in lib. Other files are not intended as entry points.

require "farce"

Constants (classes, modules, etc.) under the Farce namespace are loaded lazily (thread- and ractor-safe), so there is no need to specifically load any particular file.

README · Introduction · Compatibility and Dependencies