Permalink
Browse files

[fix] Changed require('util') to require('util') for compatibility wi…

…th node v0.8
  • Loading branch information...
1 parent efc3789 commit 0e674d256144339fd4d1d600240e460087ced7a5 @blakmatrix blakmatrix committed Jun 24, 2012
Showing with 16 additions and 16 deletions.
  1. +3 −3 README.markdown
  2. +3 −3 examples/broadcast.js
  3. +8 −8 examples/deviceids.js
  4. +2 −2 lib/sosumi.js
View
@@ -16,15 +16,15 @@ This is essentially a port of Tyler Hall's [PHP Sosumi Class](http://github.com/
Event handling is optional, but sexy time.
- var sys = require('sys'),
+ var util = require('util'),
Sosumi = require('sosumi'),
fmiService = new Sosumi('stevejobs', 'jizzmodo');
// by default, devices are fetched when you create a new Sosumi object, a 'devices'
// event is emitted on successful fetch. At this point, fmiService.devices is populated
// as well.
fmiService.on('devices', function (devices) {
- sys.puts('Got our devices: ' + sys.inspect(devices));
+ util.puts('Got our devices: ' + util.inspect(devices));
if (devices != null) {
// Blast a message out to all your registered devices
@@ -33,7 +33,7 @@ Event handling is optional, but sexy time.
// We can grab an event when a specific message has been sent
fmiService.on('messageSent', function (content) {
- sys.puts('Sent the message: ' + sys.inspect(content));
+ util.puts('Sent the message: ' + util.inspect(content));
});
}
}
View
@@ -6,15 +6,15 @@
// Copyright 2010 Conceited Software. All rights reserved.
//
-var sys = require('sys'),
+var util = require('util'),
Sosumi = require('sosumi'),
fmiService = new Sosumi('stevejobs', 'jizzmodo');
// by default, devices are fetched when you create a new Sosumi object, a 'devices'
// event is emitted on successful fetch. At this point, fmiService.devices is populated
// as well.
fmiService.on('devices', function (devices) {
- sys.puts('Got our devices: ' + sys.inspect(devices));
+ util.puts('Got our devices: ' + util.inspect(devices));
if (devices != null) {
// Blast a message out to all your registered devices
@@ -23,7 +23,7 @@ fmiService.on('devices', function (devices) {
// We can grab an event when a specific message has been sent
fmiService.on('messageSent', function (content) {
- sys.puts('Sent the message: ' + sys.inspect(content));
+ util.puts('Sent the message: ' + util.inspect(content));
});
}
}
View
@@ -6,29 +6,29 @@
// Copyright 2010 Conceited Software. All rights reserved.
//
-var sys = require('sys'),
+var util = require('util'),
Sosumi = require('sosumi'),
fmiService = new Sosumi('stevejobs', 'jizzmodo');
// by default, devices are fetched when you create a new Sosumi object, a 'devices'
// event is emitted on successful fetch. At this point, fmiService.devices is populated
// as well.
fmiService.on('devices', function (devices) {
- sys.puts('======================================================================');
- sys.puts('=== Listing Device IDs for MobileMe account: ' + fmiService.username);
- sys.puts('======================================================================');
+ util.puts('======================================================================');
+ util.puts('=== Listing Device IDs for MobileMe account: ' + fmiService.username);
+ util.puts('======================================================================');
if (devices != null) {
// Let's loop through and print our device ids, this is useful to save ids
// for later use, without relying on that extra api call.
for (var deviceIndex = 0; deviceIndex < devices.length; deviceIndex++) {
- sys.puts(' ' + devices[deviceIndex].name + ': ');
- sys.puts(' ' + devices[deviceIndex].id);
+ util.puts(' ' + devices[deviceIndex].name + ': ');
+ util.puts(' ' + devices[deviceIndex].id);
}
}
- sys.puts('======================================================================');
- sys.puts('Listed '+ devices.length + ' id' + (devices.length == 1)? '' : 's' );
+ util.puts('======================================================================');
+ util.puts('Listed '+ devices.length + ' id' + (devices.length == 1)? '' : 's' );
});
// if something goes wrong, an error event is emitted with a description of the problem.
View
@@ -6,7 +6,7 @@
// Copyright 2010 Conceited Software. All rights reserved.
//
-var sys = require('sys'),
+var util = require('util'),
events = require('events'),
http = require('http'),
Buffer = require('buffer').Buffer,
@@ -25,7 +25,7 @@ function Sosumi(mobileMeUsername, mobileMeUserPassword, performUpdateNow)
}
}
-sys.inherits(Sosumi, events.EventEmitter);
+util.inherits(Sosumi, events.EventEmitter);
Sosumi.prototype.locate = function(deviceIndex, timeout)
{

0 comments on commit 0e674d2

Please sign in to comment.