Closed jordan-brough closed 9 years ago
Use the block form of File.open when writing to a file. This ensures that the file gets flushed to disk when finished.
File.open
This is a problem when running tasks like Rake::Task['db:data:dump'].invoke.
Rake::Task['db:data:dump'].invoke
It hasn't been not a problem for rake db:data:dump because open files get flushed automatically when rake finishes and ruby terminates.
rake db:data:dump
Looks good to me! :+1:
Thanks!
Use the block form of
File.open
when writing to a file. This ensures that the file gets flushed to disk when finished.This is a problem when running tasks like
Rake::Task['db:data:dump'].invoke
.It hasn't been not a problem for
rake db:data:dump
because open files get flushed automatically when rake finishes and ruby terminates.