Permalink
Browse files

call binmode on the tempfile for Ruby 1.8 compatibility

  • Loading branch information...
1 parent 210c33f commit 72ae0b4b07ed053007460bab81d710a29624a9a7 @tenderlove tenderlove committed Feb 27, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 activesupport/lib/active_support/core_ext/file/atomic.rb
@@ -16,7 +16,8 @@ def self.atomic_write(file_name, temp_dir = Dir.tmpdir)
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

0 comments on commit 72ae0b4

Please sign in to comment.