diff options
-rw-r--r-- | activesupport/lib/active_support/core_ext/file/atomic.rb | 3 |
1 files changed, 2 insertions, 1 deletions
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 |