From c78e903794697392889bccef0b2007647e71e53e Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 9 Jun 2011 15:30:58 -0700 Subject: [PATCH 1/4] Change rebuild back to using migrate --- lib/tasks/db.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index 94fda525d..68a9439ac 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -4,7 +4,7 @@ namespace :db do desc "rebuild and prepare test db" - task :rebuild => [:drop, :create, 'schema:load', 'db:test:prepare'] + task :rebuild => [:drop, :create, :migrate, 'db:test:prepare'] namespace :integration do # desc 'Check for pending migrations and load the integration schema' From ac8587290a53cb8e69d28c01bad9f18a2a4d6e33 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 9 Jun 2011 15:31:16 -0700 Subject: [PATCH 2/4] Throw in a travis config file to try using travis --- .travis.yml | 6 ++++++ app/models/app_config.rb | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..fca7c4b2d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +rvm: + - ree + - 1.9.2 + +script: "rake cruise" +env: "TRAVIS=true" diff --git a/app/models/app_config.rb b/app/models/app_config.rb index f84a0f46c..b8a7ea1ae 100644 --- a/app/models/app_config.rb +++ b/app/models/app_config.rb @@ -9,7 +9,7 @@ class AppConfig < Settingslogic namespace Rails.env def self.load! - if no_config_file? && !have_old_config_file? + if no_config_file? && !have_old_config_file? && !travis? $stderr.puts <<-HELP ******** You haven't set up your Diaspora settings file. ********** Please do the following: @@ -36,7 +36,7 @@ HELP end super - + normalize_pod_url normalize_admins end @@ -53,6 +53,10 @@ 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]}" @@ -94,4 +98,4 @@ HELP end return @@pod_uri end -end \ No newline at end of file +end From 91b9bab52debd9889534d673fc2dbbeb35d30350 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 9 Jun 2011 15:33:38 -0700 Subject: [PATCH 3/4] Bundle exec the rake in travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fca7c4b2d..ed742c3ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,5 +2,5 @@ rvm: - ree - 1.9.2 -script: "rake cruise" +script: "bundle exec rake cruise" env: "TRAVIS=true" From e1fb5846b6da5642d7dec361a9f31823d9992d98 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 9 Jun 2011 15:45:01 -0700 Subject: [PATCH 4/4] 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 b8a7ea1ae..23bbe2277 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]}"