]> git.openstreetmap.org Git - rails.git/blob - config/preinitializer.rb
377e6bad4a6a13ac33095926085eccefccc925fb
[rails.git] / config / preinitializer.rb
1 require 'yaml'
2
3 env = ENV['RAILS_ENV'] || 'development'
4 config = YAML.load_file(File.expand_path(env == "test" ? "../example.application.yml" : "../application.yml", __FILE__))
5
6 ENV.each do |key,value|
7   if key.match(/^OSM_(.*)$/)
8     Object.const_set(Regexp.last_match(1).upcase, value)
9   end
10 end
11
12 config[env].each do |key,value|
13   unless Object.const_defined?(key.upcase)
14     Object.const_set(key.upcase, value)
15   end
16 end