Browse files

improve variable names

  • Loading branch information...
1 parent ca71a61 commit 936fe2609ac2bc6cd20d5f90d232fec60c318bf9 @chrismytton committed Jul 14, 2011
Showing with 9 additions and 9 deletions.
  1. +6 −6 lib/index.js
  2. +3 −3 src/index.coffee
View
12 lib/index.js
@@ -45,24 +45,24 @@ exports.Bot = Bot = (function() {
return _results;
};
Bot.prototype.start = function() {
- var i, _i, _len, _ref;
+ var interface, _i, _len, _ref;
_ref = this.interfaces;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- i = _ref[_i];
- i.listen();
+ interface = _ref[_i];
+ interface.listen();
}
this.hear(/help/, this.help);
return this.emit('start');
};
Bot.prototype.stop = function(finished) {
- var closing, i, _i, _len, _ref, _results;
+ var closing, interface, _i, _len, _ref, _results;
console.log("\nStopping " + this.name);
closing = this.interfaces.length;
_ref = this.interfaces;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- i = _ref[_i];
- _results.push(i.close(function() {
+ interface = _ref[_i];
+ _results.push(interface.close(function() {
if (--closing === 0) {
return finished();
}
View
6 src/index.coffee
@@ -92,15 +92,15 @@ exports.Bot = class Bot extends EventEmitter
# coolbot.start();
#
start: ->
- i.listen() for i in @interfaces
+ interface.listen() for interface in @interfaces
@hear /help/, @help
@emit 'start'
stop: (finished) ->
console.log "\nStopping #{@name}"
closing = @interfaces.length
- for i in @interfaces
- i.close ->
+ for interface in @interfaces
+ interface.close ->
finished() if --closing is 0
# Reset the bot's `handlers` and `descriptions`, note this does not stop

0 comments on commit 936fe26

Please sign in to comment.