Ruby Gems

Stout implements the RubyGems Compact Index and JSON API for dependency resolution and gemspec metadata.

Configure Your Client

Add Stout as a gem source in your Gemfile:

# Gemfile
source "https://registry.stout.io/gems" do
  gem "my-gem", "~> 1.2"
end

# Local development
source "http://localhost:7888/gems" do
  gem "my-gem", "~> 1.2"
end

Or configure the gem CLI directly:

gem sources --add https://registry.stout.io/gems/
gem install my-gem -v 1.2.0

Install a Gem

With Bundler:

bundle install

Or directly:

gem install my-gem -v 1.2.0 --source https://registry.stout.io/gems/

Publish a Gem

Stout builds gems from source. Submit a build via the API:

curl -X POST https://registry.stout.io/api/v1/builds \
  -H "Authorization: Bearer $STOUT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "format": "rubygems",
    "repo": "https://github.com/myorg/my-gem",
    "version": "1.2.0"
  }'

Authentication

For private gems, pass credentials to Bundler:

bundle config set --local registry.stout.io token:$STOUT_TOKEN

Or use the gem CLI:

gem sources --add https://token:$STOUT_TOKEN@registry.stout.io/gems/

Endpoints

Method Path Description
GET /gems/info/{gem} Compact index info
GET /gems/api/v1/gems/{gem}.json Gem metadata (JSON)
GET /gems/gems/{gem}-{version}.gem Download gem file
GET /gems/versions Compact index versions list