From e1fb5846b6da5642d7dec361a9f31823d9992d98 Mon Sep 17 00:00:00 2001
From: Raphael Sofaer <raphael@joindiaspora.com>
Date: Thu, 9 Jun 2011 15:45:01 -0700
Subject: [PATCH] Use the example config file if travis

---
 app/models/app_config.rb | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/app/models/app_config.rb b/app/models/app_config.rb
index b8a7ea1ae2..23bbe2277e 100644
--- a/app/models/app_config.rb
+++ b/app/models/app_config.rb
@@ -5,7 +5,17 @@ require 'uri'
 
 class AppConfig < Settingslogic
 
-  source File.join(Rails.root, "config", "application.yml")
+  def self.travis?
+    ENV["TRAVIS"]
+  end
+
+  def self.source_file_name
+    file_name = "application.yml"
+    file_name << ".example" if travis?
+    File.join(Rails.root, "config", file_name)
+  end
+
+  source source_file_name
   namespace Rails.env
 
   def self.load!
@@ -53,10 +63,6 @@ HELP
     File.exists?(File.join(Rails.root, "config", "app.yml")) || (File.exists?(File.join(Rails.root, "config", "app_config.yml")))
   end
 
-  def self.travis?
-    ENV["TRAVIS"]
-  end
-
   def self.normalize_pod_url
     unless self[:pod_url] =~ /^(https?:\/\/)/ # starts with http:// or https://
       self[:pod_url] = "http://#{self[:pod_url]}"
-- 
GitLab