From aa5870570fbbf7e8c848ffe4ac7529069c52b840 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 20 Aug 2014 12:23:22 -0600 Subject: [PATCH] :memo: Convert BufferedProcess docs --- src/buffered-node-process.coffee | 2 +- src/buffered-process.coffee | 46 ++++++++++++++++---------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/buffered-node-process.coffee b/src/buffered-node-process.coffee index d4a360357..808bc27a4 100644 --- a/src/buffered-node-process.coffee +++ b/src/buffered-node-process.coffee @@ -6,7 +6,7 @@ path = require 'path' # # This is necessary on Windows since it doesn't support shebang `#!` lines. # -# ## Requiring in packages +# ## Examples # # ```coffee # {BufferedNodeProcess} = require 'atom' diff --git a/src/buffered-process.coffee b/src/buffered-process.coffee index c3cda37e4..ed6474f3b 100644 --- a/src/buffered-process.coffee +++ b/src/buffered-process.coffee @@ -4,7 +4,7 @@ ChildProcess = require 'child_process' # Public: A wrapper which provides standard error/output line buffering for # Node's ChildProcess. # -# ## Requiring in packages +# ## Examples # # ```coffee # {BufferedProcess} = require 'atom' @@ -19,25 +19,25 @@ module.exports = class BufferedProcess # Public: Runs the given command by spawning a new child process. # - # options - An {Object} with the following keys: - # :command - The {String} command to execute. - # :args - The {Array} of arguments to pass to the command (optional). - # :options - The options {Object} to pass to Node's `ChildProcess.spawn` - # method (optional). - # :stdout - The callback {Function} that receives a single argument which - # contains the standard output from the command. The callback is - # called as data is received but it's buffered to ensure only - # complete lines are passed until the source stream closes. After - # the source stream has closed all remaining data is sent in a - # final call (optional). - # :stderr - The callback {Function} that receives a single argument which - # contains the standard error output from the command. The - # callback is called as data is received but it's buffered to - # ensure only complete lines are passed until the source stream - # closes. After the source stream has closed all remaining data - # is sent in a final call (optional). - # :exit - The callback {Function} which receives a single argument - # containing the exit status (optional). + # * `options` An {Object} with the following keys: + # * `command` The {String} command to execute. + # * `args` The {Array} of arguments to pass to the command (optional). + # * `options` The options {Object} to pass to Node's `ChildProcess.spawn` + # method (optional). + # * `stdout` The callback {Function} that receives a single argument which + # contains the standard output from the command. The callback is + # called as data is received but it's buffered to ensure only + # complete lines are passed until the source stream closes. After + # the source stream has closed all remaining data is sent in a + # final call (optional). + # * `stderr` The callback {Function} that receives a single argument which + # contains the standard error output from the command. The + # callback is called as data is received but it's buffered to + # ensure only complete lines are passed until the source stream + # closes. After the source stream has closed all remaining data + # is sent in a final call (optional). + # * `exit` The callback {Function} which receives a single argument + # containing the exit status (optional). constructor: ({command, args, options, stdout, stderr, exit}={}) -> options ?= {} # Related to joyent/node#2318 @@ -95,9 +95,9 @@ class BufferedProcess # 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. + # * `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. bufferStream: (stream, onLines, onDone) -> stream.setEncoding('utf8') buffered = ''