Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6eba003ab0
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (32 sloc) 0.761 kb
namespace :db do
task :config => 'app_helpers:db:config'
end
namespace :app_helpers do
desc 'Runs db:config and creates database'
task :db => [ 'app_helpers:db:config', 'db:create' ]
namespace :db do
desc 'Creates a generic database.yml file'
task :config do
if ENV['quiet'] != 'true'
puts('Database name?') unless ENV['db']
File.open 'config/database.yml', 'w' do |file|
file.write "development: &defaults
adapter: mysql
database: #{ENV['db'] || STDIN.gets.strip}
username: root
password:
host: localhost
test:
<<: *defaults
production:
<<: *defaults
"
end
end
end
desc 'Removes database.yml'
task :remove do
`rm config/database.yml`
end
end
end
Jump to Line
Something went wrong with that request. Please try again.