Merge branch 'master' of github.com:diaspora/diaspora

This commit is contained in:
danielvincent 2010-09-21 18:14:54 -07:00
commit 0323024fca
4 changed files with 16 additions and 23 deletions

View file

@ -1,17 +0,0 @@
---
default:
socket_host: 0.0.0.0
socket_debug: false
pod_url: tom.joindiaspora.com
mongo_post: 27017
socket_collection_name: websocket
socket_port: 8080
pubsub_server: https://pubsubhubbub.appspot.com/
mongo_host: localhost
debug: false
production:
development:
pod_url: tom.joindiaspora.com
test:
pod_url: http://example.org/
socket_port: 8081

View file

@ -2,10 +2,20 @@
# licensed under the Affero General Public License version 3. See
# the COPYRIGHT file.
raw_config = File.read("#{Rails.root}/config/app_config.yml")
all_envs = YAML.load(raw_config)
if all_envs[Rails.env]
APP_CONFIG = all_envs['default'].merge(all_envs[Rails.env]).symbolize_keys
def load_config_yaml filename
YAML.load(File.read(filename))
end
if File.exist? "#{Rails.root}/config/app_config.yml"
all_envs = load_config_yaml "#{Rails.root}/config/app_config.yml"
all_envs = load_config_yaml "#{Rails.root}/config/app_config_example.yml" unless all_envs
else
puts "WARNING: No config/app_config.yml found! Look at config/app_config_example.yml for help."
all_envs = load_config_yaml "#{Rails.root}/config/app_config_example.yml"
end
if all_envs[Rails.env.to_s]
APP_CONFIG = all_envs['default'].merge(all_envs[Rails.env.to_s]).symbolize_keys
else
APP_CONFIG = all_envs['default'].symbolize_keys
end

View file

@ -46,7 +46,7 @@ def set_app_config username
current_config[Rails.env.to_s] ||= {}
current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com"
current_config['default']['pod_url'] = "#{username}.joindiaspora.com"
file = File.new(Rails.root.join('..','shared','app_config.yml'),'w')
file = File.new(Rails.root.join('..','..','shared','app_config.yml'),'w')
file.write(current_config.to_yaml)
file.close
end

View file

@ -11,7 +11,7 @@ def set_app_config username
current_config[Rails.env.to_s] ||= {}
current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com"
current_config['default']['pod_url'] = "#{username}.joindiaspora.com"
file = File.new(Rails.root.join('..','shared','app_config.yml'),'w')
file = File.new(Rails.root.join('..','..','shared','app_config.yml'),'w')
file.write(current_config.to_yaml)
file.close
end