diaspora/config/initializers/2_before_load_services.rb
Steven Hancock a8de3a5a3f Rails.root and File.join cleanup
- `Rails.root` is a `Pathname`, so let's use `Rails.root.join`
- Clean up most of the remaining `File.join`s
2012-06-11 03:13:20 -07:00

18 lines
691 B
Ruby

# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
def load_config_yaml filename
YAML.load(ERB.new(File.read(filename)).result)
end
oauth_keys_file = Rails.root.join('config', 'oauth_keys.yml').to_s
SERVICES = load_config_yaml("#{oauth_keys_file}.example")
#this is to be backwards compatible with current production setups
if File.exist? oauth_keys_file
ActiveSupport::Deprecation.warn("01/05/2012 keys in oauth_keys.yml should be moved into application.yml. SEE application.yml.example for updated key names")
SERVICES.deep_merge!(load_config_yaml(oauth_keys_file))
end