Skip to content

Instantly share code, notes, and snippets.

@machu
Created May 4, 2010 02:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save machu/388875 to your computer and use it in GitHub Desktop.
Save machu/388875 to your computer and use it in GitHub Desktop.
diff --git a/core/tdiary/dispatcher.rb b/core/tdiary/dispatcher.rb
index be54430..974a982 100644
--- a/core/tdiary/dispatcher.rb
+++ b/core/tdiary/dispatcher.rb
@@ -204,11 +204,11 @@ module TDiary
@target = TARGET[target]
end
- def dispatch_cgi( cgi = CGI.new, stdout = STDOUT, stderr = STDERR )
+ def dispatch_cgi( cgi = CGI.new, stdout = nil, stderr = nil )
stdout_orig = $stdout;stderr_orig = $stderr
begin
- $stdout = stdout
- $stderr = stderr
+ $stdout = stdout if stdout
+ $stderr = stderr if stderr
@target.run( cgi )
ensure
$stdout = stdout_orig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment