Skip to content
Browse files

call binmode on the tempfile for Ruby 1.8 compatibility

  • Loading branch information...
1 parent 1b9e19c commit f42c96331a4882cf36dfa7cd305c00dc4fae03dd @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
View
3 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 f42c963

Please sign in to comment.
Something went wrong with that request. Please try again.