scm: use "ASCII-8BIT" in IO.popen() in Ruby 1.9.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4938 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-02-24 04:03:16 +00:00
parent f27637b07c
commit e51aeb5a40
1 changed files with 6 additions and 1 deletions

View File

@ -200,7 +200,12 @@ module Redmine
cmd = "#{cmd} 2>>#{RAILS_ROOT}/log/scm.stderr.log"
end
begin
IO.popen(cmd, "r+") do |io|
if RUBY_VERSION < '1.9'
mode = "r+"
else
mode = "r+:ASCII-8BIT"
end
IO.popen(cmd, mode) do |io|
io.close_write
block.call(io) if block_given?
end