Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Simple Ruby framework-agnostic application configuration.
Ruby

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
doc
lib
spec
.gitignore
README
Rakefile

README

= AppConfig

An easy to use, customizable library to easily store and retrieve application
configuration, API keys or basically anything in 'key => value' pairs.


== Usage

Usage is simple.  Just pass either a hash of options, or a block, to
AppConfig.configure.  See AppConfig::Base for a list of valid options.

For example, given this YAML file:

  ---
  admin_email: 'admin@example.com'
  api_name:    'Supr Webz 2.0'
  api_key:     'SUPERAWESOMESERVICE'

Use it like so:

  require 'app_config'

  AppConfig.configure do |config|
    config.storage_method = :yaml
    config.path = '/path/to/app_config.yml'
  end

  AppConfig[admin_email]  # => 'admin@example.com'
  AppConfig[:api_name]    # => 'Supr Webz 2.0'
  AppConfig[:api_key]     # => 'SUPERAWESOMESERVICE'

Want SQLite3 support?  No problem!

  AppConfig.configure do |config|
    config.storage_method = :sqlite
    config.database = '/path/to/database.sqlite3'
  end

  AppConfig[:column]  # => 'value'
Something went wrong with that request. Please try again.