diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-27 11:57:04 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-27 11:57:04 -0800 |
commit | f42c96331a4882cf36dfa7cd305c00dc4fae03dd (patch) | |
tree | 0d7d1d42d1f85c02fe5ce4596e3067ddbce856fd | |
parent | 1b9e19cd22f2b5d5e7b82e042f92340822c0f966 (diff) | |
download | rails-f42c96331a4882cf36dfa7cd305c00dc4fae03dd.tar.gz rails-f42c96331a4882cf36dfa7cd305c00dc4fae03dd.tar.bz2 rails-f42c96331a4882cf36dfa7cd305c00dc4fae03dd.zip |
call binmode on the tempfile for Ruby 1.8 compatibility
-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 |