aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/cgi_process.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/cgi_process.rb b/actionpack/lib/action_controller/cgi_process.rb
index 9166a8d433..e4e86615c0 100644
--- a/actionpack/lib/action_controller/cgi_process.rb
+++ b/actionpack/lib/action_controller/cgi_process.rb
@@ -124,20 +124,20 @@ module ActionController #:nodoc:
super()
end
- def out
+ def out(output = $stdout)
convert_content_type!(@headers)
- $stdout.binmode if $stdout.respond_to?(:binmode)
- $stdout.sync = false
+ output.binmode if output.respond_to?(:binmode)
+ output.sync = false if output.respond_to?(:sync=)
begin
- print @cgi.header(@headers)
+ output.write(@cgi.header(@headers))
if @cgi.send(:env_table)['REQUEST_METHOD'] == 'HEAD'
return
elsif @body.respond_to?(:call)
@body.call(self)
else
- print @body
+ output.write(@body)
end
rescue Errno::EPIPE => e
# lost connection to the FCGI process -- ignore the output, then