Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  cleanup gpl display
  move 'libblode' to 'util'
  • Loading branch information
benlemasurier committed Mar 21, 2012
1 parent f6a35ce commit f19f00b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 33 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,2 @@
*.swp
node_modules/
File renamed without changes.
37 changes: 13 additions & 24 deletions blode.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,19 +2,8 @@
* Blode - a simple, powerful syslog-like event broadcast daemon * Blode - a simple, powerful syslog-like event broadcast daemon
* Copyright (C) 2010 Ben LeMasurier * Copyright (C) 2010 Ben LeMasurier
* *
* This program is free software; you can redistribute it and/or * This program can be distributed under the terms of the GNU GPL.
* modify it under the terms of the GNU General Public License * See the file COPYING.
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */


/* /*
Expand All @@ -30,14 +19,14 @@ HOST = "127.0.0.1";


require("./lib/Math.uuid"); require("./lib/Math.uuid");


var lib = require("./lib/libblode"), var util = require("./lib/util"),
ws = require("websocket-server"), ws = require("websocket-server"),
net = require("net"), net = require("net"),
sys = require("sys"), sys = require("sys"),
url = require("url"), url = require("url"),
http = require("http"), http = require("http"),
dgram = require("dgram"), dgram = require("dgram"),
event = require("events"), event = require("events"),
emitter = new event.EventEmitter, emitter = new event.EventEmitter,
config = require('./config').config, config = require('./config').config,
log_buffer = { id: 0, severity: 'none', message: '--MARK--' }; log_buffer = { id: 0, severity: 'none', message: '--MARK--' };
Expand Down Expand Up @@ -134,13 +123,13 @@ var server = net.createServer(function(stream) {
socket_clients.remove(client); socket_clients.remove(client);
client.stream.end(); client.stream.end();
}); });

stream.on('data', function(data) { stream.on('data', function(data) {
socket_buffer += data; socket_buffer += data;
var message = socket_buffer.indexOf("\r"); var message = socket_buffer.indexOf("\r");
if (message !== -1) { if (message !== -1) {
var json = socket_buffer.slice(0, message); var json = socket_buffer.slice(0, message);
try { try {


var broadcast_events = JSON.parse(json); var broadcast_events = JSON.parse(json);


Expand Down
9 changes: 0 additions & 9 deletions lib/libblode.js

This file was deleted.

13 changes: 13 additions & 0 deletions lib/util.js
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Blode - a simple, powerful syslog-like event broadcast daemon
* Copyright (C) 2010 Ben LeMasurier <ben.lemasurier@gmail.com>
*
* This program can be distributed under the terms of the GNU GPL.
* See the file COPYING.
*/

Array.prototype.remove = function(e) {
for(var i = 0, j = this.length; i < j; i++)
if(e == this[i])
return this.splice(i, 1);
};

0 comments on commit f19f00b

Please sign in to comment.