config_manager.rb

Path: config_manager.rb
Last Update: Wed Apr 23 13:48:05 -0700 2008

Copyright (C) 2007 Mobio Networks, Inc.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <www.gnu.org/licenses/>.

This module manages yaml-based configuration sets. Uses some logic from the rfacebook gem.

The config_manager is a yaml-based property management system which follows the same methodology for managing property sets as database.yml. To use the config_manager, perform the following steps:

  1. In environment.rb, add the following two lines to the bottom of the file
  (we want to load the configuration statically):

<pre>require ‘rmobio/config_manager’</pre>

  1. Run the following rake task to generate the boilerplate configs:

<pre>rake rmobio:setup</pre>

  1. Edit config/rmobio.yml and add your properties (here we set a property
  called "ad_network" with a value of "ad_sense")

<pre>

   development:
      ad_network: ad_sense

</pre>

  1. To use a property, reference the hash accordingly. e.g. @adnetwork =
  MOBIO_CONFIG['ad_network']

Included Modules

Rmobio::ConfigManager

[Validate]