diff --git a/Jakefile.js b/Jakefile.js index c981383..002132e 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -11,6 +11,8 @@ var ROOT_DIR = __dirname, BUILD_DIR = path.join(ROOT_DIR, 'build'), TEST_DIR = path.join(ROOT_DIR, 'test'); +var VERSION_TEMPLATE_VAR = '{{VERSION}}'; + namespace('package', function () { // gets the project version from package.json task('version', function () { @@ -53,7 +55,8 @@ task('test', function () { var mochaBin = path.join(ROOT_DIR, 'node_modules', '.bin', 'mocha'); var testCmd = mochaBin + ' ' + TEST_DIR; - jake.exec(testCmd, function () {}, {printStdout: true}); + jake.exec(testCmd, function () { + }, {printStdout: true}); }); task('default', function () { @@ -65,8 +68,8 @@ task('default', function () { function concatFiles(files, outputFile, callback) { var readHandlers = files.map(function (file) { return function (callback) { - fs.readFile(file, function (err, data) { - callback(err, data); + fs.readFile(file, function (err, contentBuffer) { + callback(err, contentBuffer); }) }; }); @@ -75,6 +78,8 @@ function concatFiles(files, outputFile, callback) { if (err) { return callback(err); } - fs.writeFile(outputFile, files.join(os.EOL), callback); + var output = files.join(os.EOL) + .replace(VERSION_TEMPLATE_VAR, pkg.version); + fs.writeFile(outputFile, output, callback); }); } \ No newline at end of file diff --git a/build/l33teral-0.7.1.js b/build/l33teral-0.7.2.js similarity index 99% rename from build/l33teral-0.7.1.js rename to build/l33teral-0.7.2.js index a9927fc..892e375 100644 --- a/build/l33teral-0.7.1.js +++ b/build/l33teral-0.7.2.js @@ -1,5 +1,5 @@ /** - * l33teral + * l33teral 0.7.2 * * The MIT License (MIT) * @@ -92,7 +92,7 @@ continue; } - if (defaultValue !== undefined) { + if (arguments.length === 2) { return defaultValue; } diff --git a/l33teral.js b/l33teral.js index cb45d32..e133636 100644 --- a/l33teral.js +++ b/l33teral.js @@ -67,7 +67,7 @@ continue; } - if (defaultValue !== undefined) { + if (arguments.length === 2) { return defaultValue; } diff --git a/license.js b/license.js index 7b70351..1f2b239 100644 --- a/license.js +++ b/license.js @@ -1,5 +1,5 @@ /** - * l33teral + * l33teral {{VERSION}} * * The MIT License (MIT) * diff --git a/package.json b/package.json index de1c46b..f12daa1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "l33teral", - "version": "0.7.1", + "version": "0.7.2", "author": "Nicholas Cloud", "description": "functions to help deal with object literals", "keywords": ["literals", "objects", "utilities"], @@ -16,7 +16,7 @@ "clone": "0.1.5", "rimraf": "2.1.4" }, - "main": "./build/l33teral-0.7.1", + "main": "./build/l33teral-0.7.2", "scripts": { "test": "jake test --trace", "prepublish": "jake build"