lib/mysql.rb in caploy-0.1.12 vs lib/mysql.rb in caploy-0.2.0
- old
+ new
@@ -48,11 +48,11 @@
end
# cleanup = true removes the mysqldump file after loading, false leaves it in db/
def load(file, cleanup)
unzip_file = File.join(File.dirname(file), File.basename(file, '.bz2'))
- @cap.run "cd #{@cap.current_path}; bunzip2 -f #{file} && RAILS_ENV=#{@cap.rails_env} rake db:drop db:create && #{import_cmd(unzip_file)}"
+ @cap.run "cd #{@cap.current_path}; bunzip2 -f #{file} && RAILS_ENV=#{@cap.rails_env} #{rake} db:drop db:create && #{import_cmd(unzip_file)}"
File.unlink(unzip_file) if cleanup
end
end
class Local < Base
@@ -62,10 +62,10 @@
end
# cleanup = true removes the mysqldump file after loading, false leaves it in db/
def load(file, cleanup)
unzip_file = File.join(File.dirname(file), File.basename(file, '.bz2'))
- system("bunzip2 -f #{file} && rake db:drop db:create && #{import_cmd(unzip_file)} && rake db:migrate")
+ system("bunzip2 -f #{file} && #{rake} db:drop db:create && #{import_cmd(unzip_file)} && #{rake} db:migrate")
File.unlink(unzip_file) if cleanup
end
def dump
system "#{dump_cmd} | bzip2 - - > #{output_file}"