Class: BardRake::Mysql

Inherits:
Object
  • Object
show all
Extended by:
Rake::DSL
Defined in:
lib/bard/rake/db.rb

Class Method Summary collapse

Class Method Details

.dumpObject

Raises:

  • (RuntimeError)


74
75
76
77
78
# File 'lib/bard/rake/db.rb', line 74

def dump
  mysqldump = `which mysqldump`.strip
  raise RuntimeError, "Cannot find mysqldump." if mysqldump.blank?
  sh "#{mysqldump} -e #{mysql_options} > #{FILE_PATH}"
end

.loadObject

Raises:

  • (RuntimeError)


80
81
82
83
84
# File 'lib/bard/rake/db.rb', line 80

def load
  mysql = `which mysql`.strip
  raise RuntimeError, "Cannot find mysql." if mysql.blank?
  sh "#{mysql} #{mysql_options} < #{FILE_PATH}"
end