Skip to content
Browse files

Updates to FileList, PackageTask to deal with removal of require.paths

  • Loading branch information...
1 parent f998f92 commit 4edf414c9d45fff6a7c93ddb53846f1d00243bbc mde committed Sep 18, 2011
Showing with 12 additions and 14 deletions.
  1. +1 −3 Jakefile
  2. +2 −4 README.md
  3. +9 −5 bin/cli.js
  4. +0 −1 lib/file_list.js
  5. +0 −1 lib/package_task.js
View
4 Jakefile
@@ -1,10 +1,8 @@
-var PackageTask = require('package_task').PackageTask;
-
var fs = require('fs')
, pkg = JSON.parse(fs.readFileSync('package.json').toString())
, version = pkg.version
-var t = new PackageTask('jake', 'v' + version, function () {
+var t = new jake.PackageTask('jake', 'v' + version, function () {
var fileList = [
'Makefile'
, 'Jakefile'
View
6 README.md
@@ -313,8 +313,7 @@ The list displayed will be all tasks whose namespace/name contain the filter-str
Jake's PackageTask programmically creates a set of tasks for packaging up your project for distribution. Here's an example:
- var PackageTask = require('package_task').PackageTask
- , t = new PackageTask('fonebone', 'v0.1.2112', function () {
+ var t = new jake.PackageTask('fonebone', 'v0.1.2112', function () {
var fileList = [
'Jakefile'
, 'README.md'
@@ -346,8 +345,7 @@ When any of the normal JavaScript Array methods (or the `toArray` method) are ca
To build the list of files, use FileList's `include` and `exclude` methods:
- var FileList = require('file_list').FileList
- , list = new FileList();
+ var list = new jake.FileList();
list.include('foo/*.txt');
list.include(['bar/*.txt', 'README.md']);
list.include('Makefile', 'package.json');
View
14 bin/cli.js
@@ -18,14 +18,14 @@
*/
var args = process.argv.slice(2)
- , lib_path = __dirname + '/../lib/'
+ , libPath = __dirname + '/../lib'
, fs = require('fs')
, sys = require('sys')
- , jake = require(lib_path + 'jake.js')
- , api = require(lib_path + 'api.js')
- , Program = require(lib_path + 'program.js').Program
+ , jake = require(libPath + '/jake.js')
+ , api = require(libPath + '/api.js')
+ , Program = require(libPath + '/program.js').Program
, program = new Program()
- , Loader = require(lib_path + 'loader.js').Loader
+ , Loader = require(libPath + '/loader.js').Loader
, loader = new Loader()
, pkg = JSON.parse(fs.readFileSync(__dirname + '/../package.json').toString())
, opts
@@ -50,6 +50,10 @@ if (!program.preemptiveOption()) {
global[p] = api[p];
}
+ // Get convenient refs to FileList, PackageTask
+ jake.FileList = require(libPath + '/file_list').FileList
+ jake.PackageTask = require(libPath + '/package_task').PackageTask
+
// Enhance env with any env vars passed in
for (var p in envVars) { process.env[p] = envVars[p]; }
View
1 lib/file_list.js
@@ -280,5 +280,4 @@ FileList.clone = function (list, items) {
return clone;
};
-jake.FileList = FileList;
exports.FileList = FileList;
View
1 lib/package_task.js
@@ -18,7 +18,6 @@
var path = require('path')
, fs = require('fs')
- , list = require('file_list')
, exec = require('child_process').exec
, currDir = process.cwd();

0 comments on commit 4edf414

Please sign in to comment.
Something went wrong with that request. Please try again.