This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Jacques Crocker (author)
Sat Aug 22 03:33:53 -0700 2009
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Fri Jul 04 08:40:07 -0700 2008 | |
| |
LICENSE | Thu Jul 30 22:41:47 -0700 2009 | |
| |
README | Thu Mar 26 16:23:24 -0700 2009 | |
| |
Rakefile | Fri Jul 31 00:16:23 -0700 2009 | |
| |
init.rb | Fri Jul 04 08:40:07 -0700 2008 | |
| |
lib/ | Tue Aug 04 03:06:12 -0700 2009 | |
| |
rails/ | Wed Nov 19 00:42:55 -0800 2008 | |
| |
test/ | Sat Aug 22 03:33:53 -0700 2009 |
README
== Summary
Application level configuration.
== Author
Jacques Crocker
Modified from Original Project (AppConfig by Christopher J. Bottaro)
=== Compatibility
Rails 2.1/2.2 and Merb 1.0
=== Installing on Merb
add this to your config: dependencies.rb and run thor merb:gem:install
dependency "merb_app_config"
=== Installing on Rails
script/plugin install git://github.com/merbjedi/app_config.git
=== Accessing the AppConfig object
After installing this plugin, the AppConfig object will be global available. Entries are accessed via object member
notation:
AppConfig.my_config_entry
Nested entries are supported:
AppConfig.my_section.some_entry
=== Common config file
Config entries are compiled from
config/app_config.yml
config/app_config/settings.yml
config/app_config/#{environment}.yml
config/environments/#{environment}.yml
config/app_config/assets.yml
config/app_config/stylesheets.yml
config/app_config/javascripts.yml
settings defined in files that are lower in the list override settings higher
=== Reloading config files
You can reload the AppConfig from file at any time by running AppConfig.reload!
=== Environment specific config files
You can have environment specific config files. Environment specific config entries take precedence over common config
entries.
Example development environment config file:
RAILS_ROOT/config/environments/development.yml
Example production environment config file:
RAILS_ROOT/config/environments/production.yml
=== Embedded Ruby (ERB)
Embedded Ruby is allowed in the configuration files. See examples below.
=== Accessing Configuration Settings
Consider the two following config files.
RAILS_ROOT/config/app_config.yml:
size: 1
server: google.com
RAILS_ROOT/config/environments/development.yml:
size: 2
computed: <%= 1 + 2 + 3 %>
section:
size: 3
servers: [ {name: yahoo.com}, {name: amazon.com} ]
Notice that the environment specific config entries overwrite the common entries.
AppConfig.size -> 2
AppConfig.server -> google.com
Notice the embedded Ruby.
AppConfig.computed -> 6
Notice that object member notation is maintained even in nested entries.
AppConfig.section.size -> 3
Notice array notation and object member notation is maintained.
AppConfig.section.servers[0].name -> yahoo.com
AppConfig.section.servers[1].name -> amazon.com
==== Managing Asset Files with AppConfig
Defining stylesheets: and/or javascripts: keys will allow you to easily manage lists of assets via config
javascripts:
- application.js
- prototype_scriptaculous:
- prototype.js
- scriptaculous/effects.js
- base:
- libraries/*.js
All * file paths will be expanded out into a full list of files.
To add these javascripts to your layout just run
<%= javascripts_from_config %>
This will group the assets by key in order to use the built in Bundling







