Skip to content

Instantly share code, notes, and snippets.

@ambethia
Created November 12, 2009 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ambethia/233150 to your computer and use it in GitHub Desktop.
Save ambethia/233150 to your computer and use it in GitHub Desktop.
Rake: Write out a database.yml with settings for a test environment
namespace :db do
namespace :test do
desc "Write out a database.yml with settings for a test environment"
task :config do
File.open(Rails.root + "config/database.yml", "w") do |config|
config << <<-END_YAML.gsub(/^ {10}/, '')
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
END_YAML
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment