From 72ae0b4b07ed053007460bab81d710a29624a9a7 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 27 Feb 2012 11:57:04 -0800 Subject: call binmode on the tempfile for Ruby 1.8 compatibility --- activesupport/lib/active_support/core_ext/file/atomic.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/core_ext/file/atomic.rb b/activesupport/lib/active_support/core_ext/file/atomic.rb index fd1633ff45..fc3277f4d2 100644 --- a/activesupport/lib/active_support/core_ext/file/atomic.rb +++ b/activesupport/lib/active_support/core_ext/file/atomic.rb @@ -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 -- cgit v1.2.3