Commit f8c24445 by Kelley Reynolds

Remove unnecessary mv/unlink from Filesystem#flush_writes, complicates some failure modes

parent 772c8e96
...@@ -38,12 +38,7 @@ module Paperclip ...@@ -38,12 +38,7 @@ module Paperclip
file.close file.close
FileUtils.mkdir_p(File.dirname(path(style_name))) FileUtils.mkdir_p(File.dirname(path(style_name)))
log("saving #{path(style_name)}") log("saving #{path(style_name)}")
begin FileUtils.cp(file.path, path(style_name))
FileUtils.mv(file.path, path(style_name))
rescue SystemCallError
FileUtils.cp(file.path, path(style_name))
FileUtils.rm(file.path)
end
FileUtils.chmod(0666&~File.umask, path(style_name)) FileUtils.chmod(0666&~File.umask, path(style_name))
end end
......
...@@ -81,8 +81,6 @@ class IntegrationTest < Test::Unit::TestCase ...@@ -81,8 +81,6 @@ class IntegrationTest < Test::Unit::TestCase
original.close original.close
tf.rewind tf.rewind
File.expects(:unlink).with(tf.instance_variable_get(:@tmpname))
@d2.avatar.expects(:to_file).with(:original).returns(tf) @d2.avatar.expects(:to_file).with(:original).returns(tf)
@d2.avatar.reprocess! @d2.avatar.reprocess!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment