Rinfo

Gem Version Build Status Dependency Status

Usage

Ever wish you could have quick and easy access to release information ("rinfo") about your Rails application's latest release? Well now you can!

Rinfo adds the following route to your application:

get '/rinfo.json'

Accessing your rinfo.json page will product something like this:

{
  Deployed By: "Rafe Colton",
  Deployed At: "2014-03-17 15:18:35 -0700",
  Rails Env: "development",
  Branch: "master",
  Rev: "018f44579795167c56066c013b4b18e196142ecb"
}

It's as easy as that!

NOTE: For now, the Deployed At value is being estimated as the timestamp on the most latest commit.

Installation

To add rinfo to your Rails application, add the rinfo gem to your Gemfile:

gem 'rinfo'

Then, to install the gem:

bundle install

Configuring

Rinfo's functionality is extremely simple, and it doesn't require any configuration, but should you desire, it is configurable.

Your configuration file config/initializers/rinfo.rb would look something like this:

# config/initializers/rinfo.rb
Rinfo.env_blacklist = :prod, :production

Rinfo.filename = 'rinfo.json'

env_blacklist

The env_blacklist attribute is a list of environments such that if it includes your RAILS_ENV, the /rinfo.json route will return a 404 response insetad of a JSON blob. The arguments provided can be a string, an array, or a comma separated list, and each entry can be either a string or a symbol. The default blacklist is [:prod, :production]

NOTE: There is one special value :all, which, if included in your list, will prevent rinfo.json from showing up entirely, regardless of your RAILS_ENV

filename

The filename attribute allows you to set the filename at which your release information is available. The default value of rinfo.json will mean your file is available at /rinfo.json.