Displaying 1 result from an estimated 1 matches for "redirect_io".
Did you mean:
direct_io
2012 Mar 22
1
[PATCH] make stderr_path/stdout_path support IO objects directly
...String, IO
set[var] = path
else
raise ArgumentError
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index 0c2af5d..bd71fbf 100644
--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
@@ -698,7 +698,11 @@ class Unicorn::HttpServer
end
def redirect_io(io, path)
- File.open(path, ''ab'') { |fp| io.reopen(fp) } if path
+ if path.is_a?(IO)
+ io.reopen(path)
+ elsif path
+ io.reopen(path, ''ab'')
+ end
io.sync = true
end
--
1.7.4.5