Skip to content

Commit

Permalink
[refactor] This is the initial commit for my intent to port
Browse files Browse the repository at this point in the history
wheres-waldo to node >v0.6.x. Having a hard time triying to read the
code, plus some internal modules are just outdated, like fab, ntest, and
`redisclient`, I'll add better support and API, In this commit I'm just
seeing what it looks like this code so nothing impressive here
  • Loading branch information
alejandro committed Jan 11, 2012
1 parent 29fdbeb commit 5b4db11
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 21 deletions.
13 changes: 4 additions & 9 deletions README.md
Expand Up @@ -6,16 +6,11 @@ Track what users are on which pages with redis.

Depends on fab, ntest, redisclient, and underscore.

There's no packaging system for node.js yet, so I've just been creating symlinks
in my `~/.node_libraries` path.
> npm install w-whaldo
// or
> git clone alejandromg/wheres-whaldo
> cd wheres-whaldo && npm install

$ ln -s /path/to/fab ~/.node_libraries/fab
$ ln -s /path/to/redisclient ~/.node_libraries/redisclient
$ ln -s /path/to/underscore ~/.node_libraries/underscore
$ ln -s /path/to/wheres-waldo/lib ~/.node_libraries/wheres-waldo

$ ln -s /path/to/redisclient/redisclient.js ~/.node_libraries/redisclient/index.js
$ ln -s /path/to/underscore/underscore-min.js ~/.node_libraries/underscore/index.js

## Usage

Expand Down
2 changes: 1 addition & 1 deletion lib/api.js
Expand Up @@ -7,7 +7,7 @@ var Query = require('querystring'),
// higher level method if you don't want to worry about setting up the waldo
// and redis objects. args are passed right to redis.
exports.create = function(port, host) {
redisClient = require('redisclient')
redisClient = require('redis')
redis = new redisClient.Client(port, host)
waldo = require('./index').create(redis)
return this.createServer(waldo)
Expand Down
24 changes: 24 additions & 0 deletions package.json
@@ -0,0 +1,24 @@
{
"name":"w-waldo",
"version":"1.0.0",
"description":"Track what users are on which pages with redis.",
"author":"technoweenie",
"contributors":[
"Alejandro Morales <vamg008@gmail.com>"
],
"git":"",
"keywords":["realtime","track","users","location"],
"dependencies":{
"redis":"0.7.x",
"fab":"0.5.2",
"underscore":"1.2.x"
},
"repository": {
"type": "git",
"url": "git://github.com/alejandromg/wheres-waldo.git"
},
"engines":{
"node":">=0.6.x"
},
"maintainers":"Alejandro Morales <vamg008@gmail.com>"
}
10 changes: 5 additions & 5 deletions test/api_test.js
@@ -1,16 +1,16 @@
var redisclient = require('redisclient'),
var redisclient = require('redis'),
whereswaldo = require('../lib'),
assert = require('assert'),
testHttp = require('./helpers/test_client'),
promises = require('./lib/promise-group')
promises = require('../lib/promise-group')
listeners = require('./helpers/temp_listeners')
sys = require('sys'),
sys = require('util'),
api = require('../lib/api');

process.mixin(GLOBAL, require('ntest'));
//process.mixin(GLOBAL, require('ntest'));

var PORT = 8889,
redis = new redisclient.Client(),
redis = new redisclient.createClient(),
waldo = whereswaldo.create(redis),
client = testHttp.createClient(PORT),
waldoServer = api.createServer(waldo);
Expand Down
11 changes: 5 additions & 6 deletions test/waldo_test.js
@@ -1,14 +1,13 @@
var redisclient = require('redisclient'),
var redisclient = require('redis'),
whereswaldo = require('../lib'),
promises = require('../lib/promise-group'),
assert = require('assert'),
sys = require('sys'),
redis = new redisclient.Client();
sys = require('util'),

redis = new redisclient.createClient();


process.mixin(GLOBAL, require('ntest'));
redis.flushdb().wait()

describe("new waldo instance")
newWaldo = whereswaldo.create(redis);

it("has a default prefix", function() {
Expand Down

0 comments on commit 5b4db11

Please sign in to comment.