Permalink
Browse files

Merge pull request #18 from node-migrator-bot/clean

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

Hello koles!

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 nodejs/node-v0.x-archive@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
  • Loading branch information...
2 parents 460eeb3 + 1400609 commit 7b562135cf280033f719ea7357bd85b7c96b9a4d @koles committed Aug 20, 2012
Showing with 17 additions and 17 deletions.
  1. +2 −2 bin/reshuffle.js
  2. +5 −5 test/echo.js
  3. +2 −2 test/index.js
  4. +8 −8 test/stream.js
View
@@ -1,11 +1,11 @@
var csv = require('../lib/ya-csv'),
- sys = require('sys');
+ util = require('util');
var reader = csv.createCsvStreamReader(process.openStdin(), { columnsFromHeader: true });
var writer = csv.createCsvStreamWriter(process.stdout);
if (process.argv.length < 3) {
- sys.error("Usage: " + process.argv[0] + " " + process.argv[1] + " <output columns>");
+ util.error("Usage: " + process.argv[0] + " " + process.argv[1] + " <output columns>");
process.exit(1);
}
View
@@ -1,10 +1,10 @@
var csv = require('../lib/ya-csv'),
- sys = require('sys');
+ util = require('util');
-sys.debug('start');
+util.debug('start');
if (process.argv.length < 3) {
- sys.error("Usage: node " + process.argv[1] + " <csv file>");
+ util.error("Usage: node " + process.argv[1] + " <csv file>");
process.exit(1);
}
@@ -23,8 +23,8 @@ var lines = 0;
var columns = 0;
csvIn.addListener('end', function() {
- sys.debug('end');
- sys.debug(columns + ' columns, ' + lines + ' lines');
+ util.debug('end');
+ util.debug(columns + ' columns, ' + lines + ' lines');
});
csvIn.addListener('data', function(data) {
View
@@ -2,7 +2,7 @@ var sys;
try {
sys = require('util');
} catch (e) {
- sys = require('sys');
+ util = require('util');
@williamkapke

williamkapke Aug 25, 2012

Whoops. That's not right.

}
var csv = require('../lib/ya-csv'),
@@ -26,7 +26,7 @@ var columns = 0;
csvIn.addListener('end', function() {
assert.strictEqual(expectedRows, lines, "Wrong number of records");
- sys.debug(columns + ' columns, ' + lines + ' lines');
+ util.debug(columns + ' columns, ' + lines + ' lines');
});
csvIn.addListener('data', function(data) {
View
@@ -1,11 +1,11 @@
var csv = require('../lib/ya-csv'),
- sys = require('sys'),
+ util = require('util'),
fs = require('fs');
-sys.debug('start');
+util.debug('start');
if (process.argv.length < 3) {
- sys.error("Usage: node " + process.argv[1] + " <csv file>");
+ util.error("Usage: node " + process.argv[1] + " <csv file>");
process.exit(1);
}
@@ -19,13 +19,13 @@ var lines = 0;
var columns = 0;
csvIn.addListener('end', function() {
- sys.debug('end');
- sys.debug(columns + ' columns, ' + lines + ' lines');
+ util.debug('end');
+ util.debug(columns + ' columns, ' + lines + ' lines');
});
csvIn.addListener('error', function(e) {
- sys.debug('error');
- sys.debug(e);
+ util.debug('error');
+ util.debug(e);
});
csvIn.addListener('data', function(data) {
@@ -37,7 +37,7 @@ var file = process.argv[2];
var fileIn = fs.createReadStream(file, {flags: 'r', bufferSize: 10});
fileIn.setEncoding('utf8');
fileIn.on('data', function(data) {
- sys.debug(data);
+ util.debug(data);
csvIn.parse(data);
});
fileIn.on('end', function(data) {

0 comments on commit 7b56213

Please sign in to comment.