Skip to content

Instantly share code, notes, and snippets.

@joshk joshk/Rakefile

Created Feb 15, 2012
Embed
What would you like to do?
# encoding: utf-8
ENV['LIB_NAME'] = 'spree_reviews'
require 'bundler'
Bundler::GemHelper.install_tasks
Bundler.setup
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new
require 'spree/core/testing_support/common_rake'
desc "Default Task"
task :default => [:spec]
desc "Prepare Continuous Integration environment"
task :prepare_ci_env do
adapter = ENV["DB"] || "sqlite3"
database = ENV["DB_DATABASE"] || (adapter == "sqlite3" ? "db/development.sqlite3" : "ci_spree_reviews")
configuration = {
"test" => {
"adapter" => adapter,
"database" => database,
"username" => ENV["DB_USERNAME"],
"password" => ENV["DB_PASSWORD"],
"host" => ENV["DB_HOST"] || "localhost",
"encoding" => ENV["DB_ENCODING"] || "utf8",
"pool" => (ENV["DB_POOL"] || 5).to_int,
"timeout" => (ENV["DB_TIMEOUT"] || 5000).to_int
}
}
filename = "spec/dummy/config/database.yml"
File.open(filename, "w") do |f|
f.write(configuration.to_yaml)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.