Comparing version 0.4.1 to 0.4.2
@@ -0,1 +1,10 @@ | ||
/* | ||
* Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved. | ||
* Copyrights licensed under the New BSD License. | ||
* See the accompanying LICENSE file for terms. | ||
*/ | ||
/* | ||
* Bootstraps browser based Gear.js | ||
*/ | ||
var path = require('path'), | ||
@@ -5,5 +14,4 @@ gear = require(path.join(process.cwd(), 'index')); | ||
var files = [ | ||
'lib/registry.js', | ||
'vendor/async.js', | ||
'lib/blob.js', | ||
'lib/queue.js', | ||
'lib/tasks/concat.js', | ||
@@ -13,11 +21,20 @@ 'lib/tasks/core.js', | ||
'lib/tasks/tasks.js', | ||
'lib/tasks/write.js' | ||
'lib/tasks/write.js', | ||
'lib/registry.js', | ||
'lib/queue.js' | ||
]; | ||
new gear.Queue() | ||
new gear.Queue({registry: new gear.Registry({module: 'gear-lib'})}) | ||
.load(files) | ||
.concat() | ||
.write('build/gear.js') | ||
.tasks({ | ||
write: {task: 'write', options: 'build/gear.js'}, | ||
minify: {task: 'jsminify'}, | ||
writeminify: {task: 'write', options: 'build/gear.min.js', requires: 'minify'}, | ||
join: {requires: ['write', 'writeminify']} // Sample join | ||
}) | ||
.run(function(err, results) { | ||
console.log(err); | ||
if (err) { | ||
console.log(err); | ||
} | ||
}); |
@@ -7,7 +7,13 @@ /* | ||
(function(exports) { | ||
var async, Registry, Blob; | ||
if (typeof require !== 'undefined') { | ||
var async = require('async'), | ||
Registry = require('./registry').Registry, | ||
Blob = require('./blob').Blob; | ||
async = require('async'); | ||
Registry = require('./registry').Registry; | ||
Blob = require('./blob').Blob; | ||
} | ||
else { | ||
async = this.async; | ||
Registry = this.gear.Registry; | ||
Blob = this.gear.Blob; | ||
} | ||
@@ -14,0 +20,0 @@ /* |
@@ -11,2 +11,5 @@ /* | ||
} | ||
else { | ||
var default_tasks = this.tasks; | ||
} | ||
@@ -20,5 +23,9 @@ /* | ||
// Load default tasks | ||
if (typeof __dirname !== 'undefined') { | ||
this.load({dirname: __dirname + '/tasks'}); | ||
} | ||
else if (typeof default_tasks !== 'undefined') { | ||
this.load({tasks: default_tasks}); | ||
} | ||
@@ -52,2 +59,6 @@ if (options) { | ||
} | ||
if (options.tasks) { | ||
this._loadTasks(options.tasks); | ||
} | ||
}, | ||
@@ -81,7 +92,10 @@ | ||
var name, | ||
file = require(filename); | ||
this._loadTasks(require(filename)); | ||
}, | ||
for (name in file) { | ||
this._tasks[name] = file[name]; | ||
_loadTasks: function(tasks) { | ||
var name; | ||
for (name in tasks) { | ||
this._tasks[name] = tasks[name]; | ||
} | ||
@@ -88,0 +102,0 @@ }, |
@@ -7,2 +7,3 @@ /* | ||
(function(exports) { | ||
/** | ||
@@ -54,2 +55,14 @@ * Gets a blob. | ||
inspect.browser = true; | ||
/** | ||
* Do nothing. | ||
* | ||
* @param dummy {N/A} N/A. | ||
* @param blob {Array} Incoming blob. | ||
* @param done {Function} Callback on task completion. | ||
*/ | ||
var noop = exports.noop = function noop(dummy, blob, done) { | ||
done(null, blob); | ||
}; | ||
noop.browser = true; | ||
})(typeof exports === 'undefined' ? this.tasks || (this.tasks = {}) : exports); |
@@ -7,5 +7,9 @@ /* | ||
(function(exports) { | ||
var async; | ||
if (typeof require !== 'undefined') { | ||
var async = require('async'); | ||
async = require('async'); | ||
} | ||
else { | ||
async = this.async; | ||
} | ||
@@ -21,2 +25,3 @@ /** | ||
var item, | ||
name, | ||
requires, | ||
@@ -42,10 +47,27 @@ fn, | ||
for (item in workflow) { | ||
name = workflow[item].task ? workflow[item].task : 'noop'; | ||
requires = workflow[item].requires; | ||
fn = task(workflow[item].task, workflow[item].options, requires || []); | ||
if (requires === undefined) { | ||
requires = []; | ||
} else { | ||
if (!Array.isArray(requires)) { | ||
requires = [requires]; | ||
} | ||
} | ||
fn = task(name, workflow[item].options, requires); | ||
auto[item] = requires ? requires.concat(fn) : fn; | ||
} | ||
async.auto(auto, done); | ||
async.auto(auto, function(err, results) { | ||
if (err) { | ||
done(err); | ||
return; | ||
} | ||
done(err, results.join ? results.join : []); | ||
}); | ||
}; | ||
tasks.type = 'iterate'; | ||
})(typeof exports === 'undefined' ? this.tasks || (this.tasks = {}) : exports); |
{ | ||
"name": "gear", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Gear.js - Task-based build system.", | ||
@@ -16,4 +16,5 @@ "author": "Stephen Murphy <stephen@hypernaut.com>", | ||
"should": "0.6.x", | ||
"mocha": "1.0.x" | ||
"mocha": "1.0.x", | ||
"gear-lib": ">= 0.4.x" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53466
30
1305
3