Sha256: 2488d79e677c8c31ab554621914e86f5a6d50de6f8b4a712ee9a060d4a2990e0

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

= app_settings

Simple wrapper for YAML config files for Rails apps and gems

== Install

    sudo gem install ssoroka-app_settings
    rake app_settings:install_config

== Usage

=== Usage with Rails

in an initializer, put:

    $settings = AppSettings.new(File.join(Rails.root, 'config', 'app_settings.yml'))

Then anywhere in your app you can access the settings with:

    $settings['users/tim/user_name']
    $settings['users/tim/password']

Or whatever applies for your config file.

See example_config/example_for_rails.yml for an example yml file, here's some code examples to match:

    $settings['google_maps_api_keys/localhost']
    
    $settings['domains/legacy']
    
    $settings['from_address']
    
    $settings.from_address
    
=== Usage with Gems or Plugins

    # if user_config_file_path doesn't exist, default_config_file_path will be used.
    @settings = AppSettings.new(user_config_file_path, default_config_file_path)
    @settings['hoptoad/auth_token']

=== ERB in config files

The config files support ERB: <%= %>

== Copyright

Copyright (c) 2009 Steven Soroka. See LICENSE for details.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ssoroka-app_settings-0.2.0 README.rdoc