Skip to content

Instantly share code, notes, and snippets.

@jamesp
Forked from Oshuma/app_config.yml
Created December 7, 2008 06:02
Show Gist options
  • Save jamesp/33045 to your computer and use it in GitHub Desktop.
Save jamesp/33045 to your computer and use it in GitHub Desktop.
# config/app_config.yml
---
defaults: &defaults
:name: Super Awesome Blog
:tagline: My super awesome blog and stuff.
:email: you@example.org
development:
<<: *defaults
# Override the defaults.
test:
<<: *defaults
# Override the defaults.
production:
<<: *defaults
# Override the defaults.
:tagline: My super awesome blog, in production!
# config/init.rb
Merb::BootLoader.after_app_loads do
# This will get executed after your app's classes have been loaded.
begin
config_file = File.expand_path(Merb.root + '/config/app_config.yml')
AppConfig = YAML.load_file(config_file)[Merb.env] unless defined? AppConfig
rescue => error
puts 'AppConfig could not be loaded!'
puts error
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment