simplebuild
Advanced tools
Comparing version 0.5.2 to 0.5.3
// Copyright (c) 2013 Titanium I.T. LLC. All rights reserved. See LICENSE.TXT for details. | ||
/*globals desc, task */ | ||
/*globals desc, task, complete, fail */ | ||
"use strict"; | ||
// We need simplebuild to work on Node v0.12.4 at minimum because that's the version | ||
// used in Let's Code JavaScript's "How To" channel. | ||
var MINIMUM_NODE_VERSION = "0.12.4"; | ||
var jakeify = require("./examples/extensions/simplebuild-ext-jakeify.js") | ||
@@ -14,3 +18,3 @@ .map("../examples/mappers/simplebuild-map-header.js") | ||
task("default", ["lint", "test"], function() { | ||
task("default", ["nodeVersion", "lint", "test"], function() { | ||
console.log("\n\nBUILD OK"); | ||
@@ -31,3 +35,15 @@ }); | ||
task("nodeVersion", [], function() { | ||
console.log("Checking Node.js version: ."); | ||
var version = require("./build/version_checker.js"); | ||
version.check({ | ||
name: "Node", | ||
expected: MINIMUM_NODE_VERSION, | ||
actual: process.version, | ||
strict: true | ||
}, complete, fail); | ||
}, { async: true }); | ||
function lintOptions() { | ||
@@ -34,0 +50,0 @@ return { |
@@ -44,3 +44,3 @@ // Copyright (c) 2013-2016 Titanium I.T. LLC. All rights reserved. For license, see "README" or "LICENSE" file. | ||
for (var i = 0; i < keys.length; i++) { | ||
var newOptions = Object.assign({}, options); | ||
var newOptions = objectAssignPolyfill({}, options); | ||
newOptions.name = options.name + "." + keys[i]; | ||
@@ -159,2 +159,29 @@ var checkResult = exports.check(arg[keys[i]], type[keys[i]], newOptions); | ||
// This Object.assign() polyfill is based on code found at: | ||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign | ||
function objectAssignPolyfill(target, varArgs) { | ||
/*jshint eqeqeq:false, eqnull:true */ | ||
if (Object.assign) return Object.assign.apply(target, arguments); | ||
if (target == null) { // TypeError if undefined or null | ||
throw new TypeError('Cannot convert undefined or null to object'); | ||
} | ||
var to = Object(target); | ||
for (var index = 1; index < arguments.length; index++) { | ||
var nextSource = arguments[index]; | ||
if (nextSource != null) { // Skip over if undefined or null | ||
for (var nextKey in nextSource) { | ||
// Avoid bugs when hasOwnProperty is shadowed | ||
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { | ||
to[nextKey] = nextSource[nextKey]; | ||
} | ||
} | ||
} | ||
} | ||
return to; | ||
} | ||
}()); |
{ | ||
"name": "simplebuild", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"description": "Universal task automation", | ||
@@ -31,3 +31,4 @@ "main": "lib/simplebuild.js", | ||
"jshint": "~2.3.0", | ||
"mocha": "~1.15.0" | ||
"mocha": "~1.15.0", | ||
"semver": "^5.3.0" | ||
}, | ||
@@ -34,0 +35,0 @@ "dependencies": { |
@@ -338,2 +338,3 @@ # Simplebuild - Universal Task Automation for Node.js | ||
* 0.5.3: Bugfix: Prevent crash on Node 0.12.4 (by polyfilling Object.assign) | ||
* 0.5.2: Bugfix: `normalizeOptions` provides better error message when option is an object literal | ||
@@ -340,0 +341,0 @@ * 0.5.1: Bugfix: `normalizeOptions` won't crash when option is an object and expected type includes undefined or null |
Sorry, the diff of this file is not supported yet
53062
26
903
386
9