lib/gorgon/pipe_forker.rb in gorgon-0.11.0 vs lib/gorgon/pipe_forker.rb in gorgon-0.11.1

- old
+ new

@@ -1,22 +1,24 @@ -module PipeForker - def pipe_fork - stdin = Pipe.new(*IO.pipe) - pid = fork do - stdin.write.close - STDIN.reopen(stdin.read) - stdin.read.close +module Gorgon + module PipeForker + def pipe_fork + stdin = Pipe.new(*IO.pipe) + pid = fork do + stdin.write.close + STDIN.reopen(stdin.read) + stdin.read.close - yield + yield - exit - end + exit + end - stdin.read.close + stdin.read.close - return pid, stdin.write - end + return pid, stdin.write + end - private + private - Pipe = Struct.new(:read, :write) + Pipe = Struct.new(:read, :write) + end end