Skip to content

Commit

Permalink
refactor project files into their own directories (src/ test/ lib/)
Browse files Browse the repository at this point in the history
  • Loading branch information
orlandov committed Jan 12, 2010
1 parent 170549f commit 2f79562
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -98,7 +98,7 @@ Installation
- Make sure you have git installed.
- ./update-mongo-c-driver.sh
- node-waf configure build
- node test_mongo.js
- ./run-tests.sh

BUGS
----
Expand Down
5 changes: 2 additions & 3 deletions mongodb.js → lib/mongodb.js
@@ -1,6 +1,5 @@
sys = require("sys");

var mongo = require("./mongo");
var sys = require("sys"),
mongo = require("mongo");

function Collection(mongo, db, name) {
this.mongo = mongo;
Expand Down
4 changes: 2 additions & 2 deletions run-tests.sh
@@ -1,4 +1,4 @@
#!/bin/sh

node test_bson.js
node test_mongo.js
node tests/test_bson.js
node tests/test_mongo.js
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 7 additions & 4 deletions test_bson.js → tests/test_bson.js
@@ -1,8 +1,11 @@
process.mixin(GLOBAL, require('mjsunit'));
require.paths.push("lib");

var sys = require("sys"),
mongo = require("mongo"),
mongodb = require("mongodb");

sys = require("sys");
var mongo = require("./mongo");
var mongodb = require("./mongodb");
process.mixin(GLOBAL, require('mjsunit'));
jjj = JSON.stringify;

var bson = { encode: mongo.encode, decode: mongo.decode };

Expand Down
6 changes: 5 additions & 1 deletion test_mongo.js → tests/test_mongo.js
Expand Up @@ -5,7 +5,11 @@ process.mixin(GLOBAL, require('mjsunit'));
var jjj = JSON.stringify;

var sys = require("sys");
var mongodb = require("./mongodb");

require.paths.push("lib");

var mongodb = require("mongodb");

var oid_hex = "123456789012345678901234";

var mongo = new mongodb.MongoDB();
Expand Down
5 changes: 3 additions & 2 deletions wscript
@@ -1,6 +1,7 @@
import Options
from os import unlink, symlink, popen
from os.path import exists, abspath
from shutil import copy

srcdir = '.'
blddir = 'build'
Expand All @@ -25,7 +26,7 @@ def build(bld):
mongo = bld.new_task_gen('cxx', 'shlib', 'node_addon')
mongo.cxxflags = "-g"
mongo.target = 'mongo'
mongo.source = "mongo.cc bson.cc"
mongo.source = "src/mongo.cc src/bson.cc"
mongo.uselib = "MONGO BSON"

def shutdown():
Expand All @@ -35,4 +36,4 @@ def shutdown():
if exists('mongo.node'): unlink('mongo.node')
else:
if exists('build/default/mongo.node') and not exists('mongo.node'):
symlink('build/default/mongo.node', 'mongo.node')
copy('build/default/mongo.node', 'lib/mongo.node')

0 comments on commit 2f79562

Please sign in to comment.