This is an AMP version of the article, its original content can be found here.

How to Publish to RubyGems, in One Click

When I release a new version of jgd, a Ruby gem, to RubyGems.org, it takes 30 seconds of my time. Here is how I released a bug fix for version 1.5.1, in GitHub issue #6:

As you see, I gave a command to Rultor, and it released a new version to RubyGems. I didn't do anything else.

Now let's see how you can do the same. How you can configure your project so that the release of its new version to RubyGems.org takes just a few seconds of your time.

By the way, I assume that you're hosting your project in GitHub. If not, this entire tutorial won't work. If you are still not in GitHub, I would strongly recommend moving there.

Create RubyGems Account

Create an account in RubyGems.org.

Create rubygems.yml

Create a rubygems.yml file (you may already have it as ~/.gem/credentials):

You should get this API key from RubyGems. To find your API key, click on your user name when logged in to RubyGems.org and then click on "Edit Profile".

Encrypt rubygems.yml

Now, encrypt rubygems.yml with a rultor remote:

Instead of me/test use the name of your GitHub project.

You will get a new file rubygems.yml.asc. Add this file to the root directory of your project, commit and push. The file contains your secret information, but only the Rultor server can decrypt it.

Prepare Gemspec

In your gemspec file, make sure you use 1.0.snapshot as a version number:

This version name will be replaced by Rultor during deployment.

Configure Rultor

Create a .rultor.yml file in the root directory of your project:

In this example, replace foo with the name of your gem.

Run It!

Now it's time to see how it all works. Create a new ticket in the GitHub issue tracker, and post something like that into it (read more about Rultor commands):

You will get a response in a few seconds. The rest will be done by Rultor.

Enjoy :)

BTW, if something doesn't work as I've explained, don't hesitate to submit a ticket to Rultor issue tracker. I will try to help you.