Permalink
Browse files

. Should fix the double buffer bug

  • Loading branch information...
1 parent 56e304e commit 7991defe5025a5fc300f703d1f6921a4e7dda2b8 @kschiess committed Mar 29, 2012
Showing with 7 additions and 4 deletions.
  1. +4 −0 website/lib/document.rb
  2. +3 −4 website/lib/example.rb
View
@@ -53,6 +53,10 @@ def run_example
return
end
+ # Prevent Ruby from buffering the script for too long. After a fork,
+ # Ruby buffers become a problem.
+ @target.flush
+
unless @example.run
puts "error".red
@example.output[:err].lines.each { |line|
View
@@ -38,11 +38,10 @@ def run
code = produce_example_code
pid = fork do
- # redirect_streams(tempfiles)
- # # puts example_code
- # eval(code, nil, @file, @line)
+ redirect_streams(tempfiles)
+ # puts example_code
+ eval(code, nil, @file, @line)
end
- p Process.pid
Process.wait(pid)
# Read these tempfiles.

0 comments on commit 7991def

Please sign in to comment.