1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

call binmode on the tempfile for Ruby 1.8 compatibility

This commit is contained in:
Aaron Patterson 2012-02-27 11:57:04 -08:00
parent 1b9e19cd22
commit f42c96331a

View file

@ -16,7 +16,8 @@ class File
require 'tempfile' unless defined?(Tempfile)
require 'fileutils' unless defined?(FileUtils)
temp_file = Tempfile.new(basename(file_name), temp_dir, :binmode => true)
temp_file = Tempfile.new(basename(file_name), temp_dir)
temp_file.binmode
yield temp_file
temp_file.close