Skip to content

Instantly share code, notes, and snippets.

View nipe0324's full-sized avatar

nipe0324 nipe0324

  • Japan
View GitHub Profile
@hopsoft
hopsoft / db.rake
Last active May 22, 2024 22:53
Rails rake tasks for dump & restore of PostgreSQL databases
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
end
puts cmd
# Commonly used webrat steps
# http://github.com/brynary/webrat
When /言語は"(.*)"/ do |lang|
header("ACCEPT_LANGUAGE", lang)
end
When /^"(.*)"ボタンをクリックする$/ do |button|
clicks_button(button)
end