Gem: settler

Link to source code:

Settler can be used for defining application wide settings in Rails. Settings are loaded from a YAML file and stored in the database using ActiveRecord to allow users to update settings on the fly. The YAML configuration allows you to not only specify defaults, but setting value validations and typecasts as well!

Settler originated out of fact that I found that some common features were missing from to existing solutions like binarylogic’s settingslogic and Squeegy’s rails-settings:

  • I was looking for something that would enable me to define settings in a file, but could be updated afterwards by users of a given system.
  • I wanted to enable users to change settings and therefore had to make sure that these changes would be valid. It should therefore be possible to add validations to settings.
  • Instead of being a simple key-value store, I did not want to cast a setting to its appropriate type (string, bool, integer or float) every time I used a certain setting. The configuration should therefore allow me to specify the data type of the setting, which should be properly typecasted every time I used it.

As I found that the aforementioned gems had their own strengths, I decided to use their functionality and combine it into one gem. The added value comes with the validation and typecasting functionality. Please see the Github project page for more info!


~ by moiristo on September 30, 2010.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: