Skip to content

Instantly share code, notes, and snippets.

@adamvr
Created July 16, 2012 13:55
Show Gist options
  • Select an option

  • Save adamvr/3122852 to your computer and use it in GitHub Desktop.

Select an option

Save adamvr/3122852 to your computer and use it in GitHub Desktop.
Initializer for config files
::APP_CONFIG = {}
ignore = [:database]
Path.glob("#{Rails.root}/config/*.yml") do |f|
key = File.basename(f, '.yml').to_sym
content = YAML.load_file(f)[Rails.env]
::APP_CONFIG[file] = content unless ignore.include? key
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment