Skip to content

Commit

Permalink
A bit more doco.
Browse files Browse the repository at this point in the history
  • Loading branch information
mde committed Nov 27, 2010
1 parent c150ca0 commit 7bb393e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/jake.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,23 @@ jake = new function () {
!(obj.propertyIsEnumerable('length'));
}

/**
* Tells us if the task has any dependencies
* @param {Array.<String>} deps An array of dependencies
* @return {Boolean} true if deps is a non-empty Array
*/
, _taskHasDeps = function (deps) {
return !!(deps && _isArray(deps) && deps.length);
}

/**
* Handles a file task
* @param {Error} err Error, if any, returned from fs.lstat
* @param {fs.Stats} stats Stats obj, if any, returned from fs.lstat
* @param {String} name The task name
* @param {Array} deps The array of dependencies, if any
* @callback {Function} Callback for running the task
*/
, _handleFileTask = function (err, stats, name, deps, callback) {
// If the task has dependencies these are invoked in order.
// If any of them were changed after the current file, or
Expand All @@ -197,6 +210,7 @@ jake = new function () {
// be found, simply execute the task and use the
// current time as the last time it changed.
else if (err) {
// File not found
if (err.errno == 2) {
_taskList.push(name);
callback(new Date());
Expand All @@ -218,6 +232,8 @@ jake = new function () {
* recursively -- depth-first, so deps run first
* @param {String} name The name of the current task whose
* dependencies are being parsed.
* @param {Boolean} root Is this the root task of a dependency tree or not
* @param {Function} [callback] Callbacks for async tasks
*/
, _parseDeps = function (name, root, callback) {
var task = _this.getTask(name),
Expand Down

0 comments on commit 7bb393e

Please sign in to comment.