Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Hi! I fixed some calls to "sys" for you! #2

Open
wants to merge 1 commit into from

3 participants

@node-migrator-bot

Hello truedat101!

I am migrationBot, an open-source bot, and I'm here to help you migrate your codebase to node v0.8!

Did you know that the "sys" module throws an error if your program tries to require it in node v0.8? To help keep your code running, I automatically replaced var sys = require('sys') with var util = require('util').

If you'd like to know more about these changes in node.js, take a look at joyent/node@1582cf#L1R51 and https://github.com/joyent/node/blob/1582cfebd6719b2d2373547994b3dca5c8c569c0/ChangeLog#L51 and http://blog.jit.su/introducing-blakmatrix-and-migratorbot .

As for myself, I was written by your friendly neighborhood node ninjas at Nodejitsu, and you can find them at #nodejitsu on irc.freenode.net or with http://webchat.jit.su .

Enjoy!

--migrationBot

@truedat101
Owner

Time to fix this.

@truedat101
Owner

Will fix for v0.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 23, 2012
  1. @blakmatrix
This page is out of date. Refresh to see the latest.
View
14 deps/nodeunit/README.md
@@ -327,13 +327,13 @@ if its missing:
var reporter = require('nodeunit').reporters.default;
}
catch(e) {
- var sys = require('sys');
- sys.puts("Cannot find nodeunit module.");
- sys.puts("You can download submodules for this project by doing:");
- sys.puts("");
- sys.puts(" git submodule init");
- sys.puts(" git submodule update");
- sys.puts("");
+ var util = require('util');
+ util.puts("Cannot find nodeunit module.");
+ util.puts("You can download submodules for this project by doing:");
+ util.puts("");
+ util.puts(" git submodule init");
+ util.puts(" git submodule update");
+ util.puts("");
process.exit();
}
View
14 deps/nodeunit/bin/nodeunit
@@ -2,7 +2,7 @@
var
fs = require('fs'),
- sys = require('sys'),
+ util = require('util'),
path = require('path');
require.paths.push(process.cwd());
@@ -62,19 +62,19 @@ args.forEach(function (arg) {
}).filter(function (reporter_file) {
return reporter_file !== 'index';
});
- sys.puts('Build-in reporters: ');
+ util.puts('Build-in reporters: ');
reporters.forEach(function (reporter_file) {
var reporter = require('../lib/reporters/' + reporter_file);
- sys.puts(' * ' + reporter_file + (reporter.info ? ': ' + reporter.info : ''));
+ util.puts(' * ' + reporter_file + (reporter.info ? ': ' + reporter.info : ''));
});
process.exit(0);
} else if ((arg === '-v') || (arg === '--version')) {
var content = fs.readFileSync(__dirname + '/../package.json', 'utf8');
var pkg = JSON.parse(content);
- sys.puts(pkg.version);
+ util.puts(pkg.version);
process.exit(0);
} else if ((arg === '-h') || (arg === '--help')) {
- sys.puts(usage);
+ util.puts(usage);
process.exit(0);
} else {
files.push(arg);
@@ -82,8 +82,8 @@ args.forEach(function (arg) {
});
if (files.length === 0) {
- sys.puts('Files required.');
- sys.puts(usage);
+ util.puts('Files required.');
+ util.puts(usage);
process.exit(1);
}
View
4 deps/nodeunit/deps/ejs.js
@@ -9,7 +9,7 @@
* Module dependencies.
*/
-var sys = require('sys');
+var util = require('util');
/**
* Library version.
@@ -85,7 +85,7 @@ var parse = exports.parse = function(str){
*/
var compile = exports.compile = function(str, options){
- if (options.debug) sys.puts(parse(str));
+ if (options.debug) util.puts(parse(str));
return new Function('locals, escape', parse(str));
};
View
26 deps/nodeunit/lib/reporters/default.js
@@ -11,7 +11,7 @@
var nodeunit = require('../nodeunit'),
utils = require('../utils'),
fs = require('fs'),
- sys = require('sys'),
+ util = require('util'),
track = require('../track'),
path = require('path');
AssertionError = require('../assert').AssertionError;
@@ -59,42 +59,42 @@ exports.run = function (files, options, callback) {
});
var tracker = track.createTracker(function (tracker) {
if (tracker.unfinished()) {
- sys.puts('');
- sys.puts(error(bold(
+ util.puts('');
+ util.puts(error(bold(
'FAILURES: Undone tests (or their setups/teardowns): '
)));
var names = tracker.names();
for (var i = 0; i < names.length; i += 1) {
- sys.puts('- ' + names[i]);
+ util.puts('- ' + names[i]);
}
- sys.puts('');
- sys.puts('To fix this, make sure all tests call test.done()');
+ util.puts('');
+ util.puts('To fix this, make sure all tests call test.done()');
process.reallyExit(tracker.unfinished());
}
});
nodeunit.runFiles(paths, {
moduleStart: function (name) {
- sys.puts('\n' + bold(name));
+ util.puts('\n' + bold(name));
},
testDone: function (name, assertions) {
tracker.remove(name);
if (!assertions.failures()) {
- sys.puts('' + name);
+ util.puts('' + name);
}
else {
- sys.puts(error('' + name) + '\n');
+ util.puts(error('' + name) + '\n');
assertions.forEach(function (a) {
if (a.failed()) {
a = utils.betterErrors(a);
if (a.error instanceof AssertionError && a.message) {
- sys.puts(
+ util.puts(
'Assertion Message: ' +
assertion_message(a.message)
);
}
- sys.puts(a.error.stack + '\n');
+ util.puts(a.error.stack + '\n');
}
});
}
@@ -103,14 +103,14 @@ exports.run = function (files, options, callback) {
var end = new Date().getTime();
var duration = end - start;
if (assertions.failures()) {
- sys.puts(
+ util.puts(
'\n' + bold(error('FAILURES: ')) + assertions.failures() +
'/' + assertions.length + ' assertions failed (' +
assertions.duration + 'ms)'
);
}
else {
- sys.puts(
+ util.puts(
'\n' + bold(ok('OK: ')) + assertions.length +
' assertions (' + assertions.duration + 'ms)'
);
View
56 deps/nodeunit/lib/reporters/html.js
@@ -11,7 +11,7 @@
var nodeunit = require('../nodeunit'),
utils = require('../utils'),
fs = require('fs'),
- sys = require('sys'),
+ util = require('util'),
path = require('path'),
AssertionError = require('assert').AssertionError;
@@ -35,72 +35,72 @@ exports.run = function (files, options) {
return path.join(process.cwd(), p);
});
- sys.puts('<html>');
- sys.puts('<head>');
- sys.puts('<title></title>');
- sys.puts('<style type="text/css">');
- sys.puts('body { font: 12px Helvetica Neue }');
- sys.puts('h2 { margin:0 ; padding:0 }');
- sys.puts('pre { font: 11px Andale Mono; margin-left: 1em; padding-left: 1em; margin-top:0; font-size:smaller;}');
- sys.puts('.assertion_message { margin-left: 1em; }');
- sys.puts(' ol {' +
+ util.puts('<html>');
+ util.puts('<head>');
+ util.puts('<title></title>');
+ util.puts('<style type="text/css">');
+ util.puts('body { font: 12px Helvetica Neue }');
+ util.puts('h2 { margin:0 ; padding:0 }');
+ util.puts('pre { font: 11px Andale Mono; margin-left: 1em; padding-left: 1em; margin-top:0; font-size:smaller;}');
+ util.puts('.assertion_message { margin-left: 1em; }');
+ util.puts(' ol {' +
' list-style: none;' +
' margin-left: 1em;' +
' padding-left: 1em;' +
' text-indent: -1em;' +
'}');
- sys.puts(' ol li.pass:before { content: "\\2714 \\0020"; }');
- sys.puts(' ol li.fail:before { content: "\\2716 \\0020"; }');
- sys.puts('</style>');
- sys.puts('</head>');
- sys.puts('<body>');
+ util.puts(' ol li.pass:before { content: "\\2714 \\0020"; }');
+ util.puts(' ol li.fail:before { content: "\\2716 \\0020"; }');
+ util.puts('</style>');
+ util.puts('</head>');
+ util.puts('<body>');
nodeunit.runFiles(paths, {
moduleStart: function (name) {
- sys.puts('<h2>' + name + '</h2>');
- sys.puts('<ol>');
+ util.puts('<h2>' + name + '</h2>');
+ util.puts('<ol>');
},
testDone: function (name, assertions) {
if (!assertions.failures()) {
- sys.puts('<li class="pass">' + name + '</li>');
+ util.puts('<li class="pass">' + name + '</li>');
}
else {
- sys.puts('<li class="fail">' + name);
+ util.puts('<li class="fail">' + name);
assertions.forEach(function (a) {
if (a.failed()) {
a = utils.betterErrors(a);
if (a.error instanceof AssertionError && a.message) {
- sys.puts('<div class="assertion_message">' +
+ util.puts('<div class="assertion_message">' +
'Assertion Message: ' + a.message +
'</div>');
}
- sys.puts('<pre>');
- sys.puts(a.error.stack);
- sys.puts('</pre>');
+ util.puts('<pre>');
+ util.puts(a.error.stack);
+ util.puts('</pre>');
}
});
- sys.puts('</li>');
+ util.puts('</li>');
}
},
moduleDone: function () {
- sys.puts('</ol>');
+ util.puts('</ol>');
},
done: function (assertions) {
var end = new Date().getTime();
var duration = end - start;
if (assertions.failures()) {
- sys.puts(
+ util.puts(
'<h3>FAILURES: ' + assertions.failures() +
'/' + assertions.length + ' assertions failed (' +
assertions.duration + 'ms)</h3>'
);
}
else {
- sys.puts(
+ util.puts(
'<h3>OK: ' + assertions.length +
' assertions (' + assertions.duration + 'ms)</h3>'
);
}
- sys.puts('</body>');
+ util.puts('</body>');
// should be able to flush stdout here, but doesn't seem to work,
// instead delay the exit to give enough to time flush.
setTimeout(function () {
View
8 deps/nodeunit/lib/reporters/junit.js
@@ -11,7 +11,7 @@
var nodeunit = require('../nodeunit'),
utils = require('../utils'),
fs = require('fs'),
- sys = require('sys'),
+ util = require('util'),
path = require('path'),
async = require('../../deps/async'),
AssertionError = require('assert').AssertionError,
@@ -156,13 +156,13 @@ exports.run = function (files, opts, callback) {
opts.output,
module.name + suffix + '.xml'
);
- sys.puts('Writing ' + filename);
+ util.puts('Writing ' + filename);
fs.writeFile(filename, rendered, cb);
},
function (err) {
if (err) throw err;
else if (assertions.failures()) {
- sys.puts(
+ util.puts(
'\n' + bold(error('FAILURES: ')) +
assertions.failures() + '/' +
assertions.length + ' assertions failed (' +
@@ -170,7 +170,7 @@ exports.run = function (files, opts, callback) {
);
}
else {
- sys.puts(
+ util.puts(
'\n' + bold(ok('OK: ')) + assertions.length +
' assertions (' + assertions.duration + 'ms)'
);
View
18 deps/nodeunit/lib/reporters/minimal.js
@@ -11,7 +11,7 @@
var nodeunit = require('../nodeunit'),
utils = require('../utils'),
fs = require('fs'),
- sys = require('sys'),
+ util = require('util'),
path = require('path'),
AssertionError = require('assert').AssertionError;
@@ -58,21 +58,21 @@ exports.run = function (files, options) {
nodeunit.runFiles(paths, {
moduleStart: function (name) {
- sys.print(bold(name) + ': ');
+ util.print(bold(name) + ': ');
},
moduleDone: function (name, assertions) {
- sys.puts('');
+ util.puts('');
if (assertions.failures()) {
assertions.forEach(function (a) {
if (a.failed()) {
a = utils.betterErrors(a);
if (a.error instanceof AssertionError && a.message) {
- sys.puts(
+ util.puts(
'Assertion in test ' + bold(a.testname) + ': ' +
magenta(a.message)
);
}
- sys.puts(a.error.stack + '\n');
+ util.puts(a.error.stack + '\n');
}
});
}
@@ -82,10 +82,10 @@ exports.run = function (files, options) {
},
testDone: function (name, assertions) {
if (!assertions.failures()) {
- sys.print('.');
+ util.print('.');
}
else {
- sys.print(red('F'));
+ util.print(red('F'));
assertions.forEach(function (assertion) {
assertion.testname = name;
});
@@ -95,14 +95,14 @@ exports.run = function (files, options) {
var end = new Date().getTime();
var duration = end - start;
if (assertions.failures()) {
- sys.puts(
+ util.puts(
'\n' + bold(red('FAILURES: ')) + assertions.failures() +
'/' + assertions.length + ' assertions failed (' +
assertions.duration + 'ms)'
);
}
else {
- sys.puts(
+ util.puts(
'\n' + bold(green('OK: ')) + assertions.length +
' assertions (' + assertions.duration + 'ms)'
);
View
18 deps/nodeunit/lib/reporters/skip_passed.js
@@ -11,7 +11,7 @@
var nodeunit = require('../nodeunit'),
utils = require('../utils'),
fs = require('fs'),
- sys = require('sys'),
+ util = require('util'),
path = require('path'),
AssertionError = require('assert').AssertionError;
@@ -58,44 +58,44 @@ exports.run = function (files, options) {
nodeunit.runFiles(paths, {
moduleStart: function (name) {
- sys.puts('\n' + bold(name));
+ util.puts('\n' + bold(name));
},
testDone: function (name, assertions) {
if (assertions.failures()) {
- sys.puts(error('' + name) + '\n');
+ util.puts(error('' + name) + '\n');
assertions.forEach(function (a) {
if (a.failed()) {
a = utils.betterErrors(a);
if (a.error instanceof AssertionError && a.message) {
- sys.puts(
+ util.puts(
'Assertion Message: ' + assertion_message(a.message)
);
}
- sys.puts(a.error.stack + '\n');
+ util.puts(a.error.stack + '\n');
}
});
}
},
moduleDone: function (name, assertions) {
if (!assertions.failures()) {
- sys.puts('✔ all tests passed');
+ util.puts('✔ all tests passed');
}
else {
- sys.puts(error('✖ some tests failed'));
+ util.puts(error('✖ some tests failed'));
}
},
done: function (assertions) {
var end = new Date().getTime();
var duration = end - start;
if (assertions.failures()) {
- sys.puts(
+ util.puts(
'\n' + bold(error('FAILURES: ')) + assertions.failures() +
'/' + assertions.length + ' assertions failed (' +
assertions.duration + 'ms)'
);
}
else {
- sys.puts(
+ util.puts(
'\n' + bold(ok('OK: ')) + assertions.length +
' assertions (' + assertions.duration + 'ms)'
);
View
8 deps/nodeunit/lib/track.js
@@ -3,7 +3,7 @@
* the undone tests.
*/
-var sys = require('sys');
+var util = require('util');
exports.createTracker = function (on_exit) {
@@ -39,11 +39,11 @@ exports.createTracker = function (on_exit) {
exports.default_on_exit = function (tracker) {
if (tracker.unfinished()) {
- sys.puts('');
- sys.puts('Undone tests (or their setups/teardowns): ');
+ util.puts('');
+ util.puts('Undone tests (or their setups/teardowns): ');
var names = tracker.names();
for (var i = 0; i < names.length; i += 1) {
- sys.puts(names[i]);
+ util.puts(names[i]);
}
process.reallyExit(tracker.unfinished());
}
View
6 deps/nodeunit/lib/utils.js
@@ -10,7 +10,7 @@
var async = require('../deps/async'),
fs = require('fs'),
- sys = require('sys'),
+ util = require('util'),
Script = process.binding('evals').Script,
http = require('http');
@@ -190,8 +190,8 @@ exports.betterErrors = function (assertion) {
Object.getOwnPropertyDescriptor(e, 'expected')) {
// alexgorbatchev 2010-10-22 :: Added a bit of depth to inspection
- var actual = sys.inspect(e.actual, false, 10).replace(/\n$/, '');
- var expected = sys.inspect(e.expected, false, 10).replace(/\n$/, '');
+ var actual = util.inspect(e.actual, false, 10).replace(/\n$/, '');
+ var expected = util.inspect(e.expected, false, 10).replace(/\n$/, '');
var multiline = (
actual.indexOf('\n') !== -1 ||
expected.indexOf('\n') !== -1
Something went wrong with that request. Please try again.