class Closure::Compiler

def compile(io)

block, for streaming.
JavaScript as a string or yields an IO object containing the response to a
Can compile a JavaScript string or open IO object. Returns the compiled
def compile(io)
  result, error = nil, nil
  status = POpen4.popen4(*command) do |stdout, stderr, stdin, pid|
    if io.respond_to? :read
      while buffer = io.read(4096) do
        stdin.write(buffer)
      end
    else
      stdin.write(io.to_s)
    end
    stdin.close
    result = block_given? ? yield(stdout) : stdout.read
    error = stderr.read
  end
  raise Error, error unless status.success?
  result
end