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:18 -0800 |
commit | 72ae0b4b07ed053007460bab81d710a29624a9a7 (patch) | |
tree | 068716f1d42cd58f94df68c91004a603001fad7c /activesupport/lib/active_support/core_ext | |
parent | 210c33f3523a64cc597be3e60143cca57ec96c14 (diff) | |
download | rails-72ae0b4b07ed053007460bab81d710a29624a9a7.tar.gz rails-72ae0b4b07ed053007460bab81d710a29624a9a7.tar.bz2 rails-72ae0b4b07ed053007460bab81d710a29624a9a7.zip |
call binmode on the tempfile for Ruby 1.8 compatibility
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-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 |