Permalink
Browse files

call binmode on the tempfile for Ruby 1.8 compatibility

  • Loading branch information...
1 parent 0d7a507 commit 63069ecf524e36fb4668dfeb668504a9eb953a6b @arunagw arunagw committed Mar 1, 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 63069ec

Please sign in to comment.