File : README.md
Maintainer : Felix C. Stegerman <[email protected]>
Date : 2013-09-01
Copyright : Copyright (C) 2013 Felix C. Stegerman
Version : v0.2.0
Description
[rb-]localconfig - local configuration for ruby (web) apps
localconfig makes it easy to load (additional) configuration files
from ~/.apps/<name>
, where name is determined by the current
directory. You can easily require ruby files and load json and yaml
files from this directory.
Additionally, it allows rails applications to easily define admin:exists and admin:create rake tasks to make it easier to automate application setup.
Just about everything is configurable: see the docs.
For an example w/ rails, see https://github.com/obfusk/localconfig-rails-example.
Examples
Gemfile
gem 'localconfig', require: 'localconfig/rails'
config/localconfig.rb
LocalConfig['rails'].configure do |c|
puts "env: #{c.env}, #{Rails.env}"
c.require 'init.rb'
c.load_json 'pg.json'
c.on_admin_exists do |username|
# ...
end
c.on_admin_create do |username, password, email|
# ...
end
end
Specs & Docs
$ rake spec
$ rake docs
TODO
- more specs/docs?
- ...
License
GPLv2 [1] or EPLv1 [2].
References
[1] GNU General Public License, version 2 --- http://www.opensource.org/licenses/GPL-2.0
[2] Eclipse Public License, version 1 --- http://www.opensource.org/licenses/EPL-1.0