Getting started with R.C. is take only a few minutes. Assuming you have a typical
Ruby-ready system, simply install the
$ gem install rc
To use R.C. for all projects, add the
rc bootstrap feature to your systems
RUBYOPT environment variable. You will want to add this to you start up scripts, depending on
your system that will be
.profile, or what have you.
$ export RUBYOPT="-rc $RUBYOPT"
Alternately, you can add R.C. to your project's Gemfile:
Then is will work when ever you use
Now you can then specify tool configurations in a project's Config.rb file.
# Config.rb config 'qed', profile: 'coverage' do require 'simplecov' SimpleCov.start do coverage_dir('log/coverage') end end
When the tool is run, with the coresponding profile, the configuration will be applied.
$ profile=coverage qed
As long as a tool is Ruby-based and has some means of global configuration, then R.C. can be used to configure it.
Tool developers can add dedicated support for R.C. to their project's with a simple snippet of code.
require 'rc/api' configure 'mytool' do |config| MyTool.configure(&config) if config.profile? end
Configurations are written with a very simple domain specific language.
Primarily the syntax consists of
config statments with blocks
of code that handle the configuration. The
config method takes
an the name of the command to be configured as an argument along with a
set of possible options.