lib/mini_magick/utilities.rb in mini_magick-4.13.2 vs lib/mini_magick/utilities.rb in mini_magick-5.0.0
- old
+ new
@@ -22,14 +22,12 @@
end
nil
end
def tempfile(extension)
- Tempfile.new(["mini_magick", extension], MiniMagick.tmpdir).tap do |tempfile|
- tempfile.binmode
- yield tempfile if block_given?
- tempfile.close
- end
+ tempfile = Tempfile.new(["mini_magick", extension], MiniMagick.tmpdir, binmode: true)
+ yield tempfile if block_given?
+ tempfile.close
+ tempfile
end
-
end
end