# File lib/main/program/instance_methods.rb, line 128 def stdout= io unless(defined?(@stdout) and (@stdout == io)) @stdout = if io.respond_to?('write') io else fd = open(io.to_s, 'w+') @finalizers.push(lambda{ fd.close }) fd end begin STDOUT.reopen(@stdout) rescue $stdout = @stdout ::Object.send(:remove_const, 'STDOUT') ::Object.send(:const_set, 'STDOUT', @stdout) end end end