 path = require 'path'
 _ = require 'underscore'
 
-# Private: A wrapper which provides buffering for ChildProcess
+# Private: A wrapper which provides buffering for ChildProcess.
 module.exports =
 class BufferedProcess
   process: null
   killed: false
 
-  # options -
-  #  command: The command to execute.
-  #  args: The arguments for the given command.
-  #  options: The options to pass to ChildProcess.
-  #  stdout: The callback to receive stdout data.
-  #  stderr: The callback to receive stderr data.
-  #  exit: The callback to receive exit status.
+  # Executes the given command.
+  #
+  # * options
+  #    + command:
+  #      The command to execute.
+  #    + args:
+  #      The arguments for the given command.
+  #    + options:
+  #      The options to pass to ChildProcess.
+  #    + stdout:
+  #      The callback to receive stdout data.
+  #    + stderr:
+  #      The callback to receive stderr data.
+  #    + exit:
+  #      The callback to receive exit status.
   constructor: ({command, args, options, stdout, stderr, exit}={}) ->
     options ?= {}
     @process = ChildProcess.spawn(command, args, options)


  # Private: Helper method to pass data line by line.
  #
  # stream  - The Stream to read from.
  # onLines - The callback to call with each line of data.
  # onDone  - The callback to call when the stream has closed.
  #
  # Returns nothing.
  bufferStream: (stream, onLines, onDone) ->
    stream.setEncoding('utf8')
    buffered = ''

      onDone()

  # Public: Terminates the process.
  kill: ->
    @killed = true
    @process.kill()
