Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Configster is a tidy little configuration management utility for your application. Store your configuration as YAML outside of your application. You probably haven't heard of it.
branch: master
Failed to load latest commit information.
autotest Setup for Autotest.
examples Tweaked ActiveRecord example.
lib Version bump to 0.0.3 and updated documentation.
spec Added support for loading entire directories of configs.
.gitignore Initial commit. Version bump to 0.0.3 and updated documentation.
Gemfile Initial commit.
LICENSE.txt Initial commit. Fixed Typo in
configster.gemspec Setup for Autotest.


Configster is a tidy little configuration management utility for your application.

You probably haven't heard of it.


Add this line to your application's Gemfile:

gem 'configster'

And then execute:

$ bundle

Or install it yourself as:

$ gem install configster


For most applications, you'll want to load Configster before you start loading the rest of your application. For example:

require 'configster'
Configster.load!(File.join('path', 'to', 'my_config.yml'))

You can also pass a raw hash of stuff into load! as long as it's in the format of "ClassName" => { 'variable' => 'whatever' }

Configster.load!('MyAwesomeClass' => { :something => 'cool' })

Or load an entire directory:

Configster.load!(File.join(Rails.root, 'config', 'configster'))

Then, just include Configster in any classes you want:

class KonfiguredKlass
  include Configster

Your class now has access to a configster and raw_configster function where you can query bits and pieces of your configuration.


Say you're writing a sweet application that uses HTTParty to fetch data from Twitter. You want to share this application with the world, but you don't want to hard code your credentials. Here's how you might handle that:

First, make yourself a nice little configuration file and save it to ~/my_sweet_app_credentials.yml:

  username: SweetUsername
  password: SweetPassword123

Then, you'll write your application like this:

require 'configster'

class MySweetApp

  include Configster
  include HTTParty

  def initialize
    @auth = {
      :username => configster.username,
      :password => configster.password

  def timeline(which = :friends, options = { })
    options.merge!(:basic_auth => @auth)
    self.class.get("/statuses/#{which}_timeline.json", options)


You can also access the configuration more directly without the mixin by doing the following:

# Return the config as an instance of OpenStruct

# Return the config as a raw hash

Now you can share your application without hard coding and/or sharing your credentials.

For more examples accessing Configster directly or using it without YAML, check the examples directory in the gem.


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Write specs for your changes to make sure I don't break your features in the future.
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request
Something went wrong with that request. Please try again.