Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
bump version to 0.1.0, add test and point main at new lib directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Springmeyer committed Nov 19, 2011
1 parent a842b31 commit 30d4ccc
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
node_modules
build
.lock-wscript
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
build:
node-waf build

.PHONY: build

test:
@NODE_PATH=./lib:$NODE_PATH node_modules/.bin/expresso

.PHONY: build test
1 change: 1 addition & 0 deletions lib/eio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var eio = module.exports = exports = require('./eio.node');
1 change: 1 addition & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./eio');
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "eio",
"description": "Control libeio from JavaScript",
"version": "0.0.2",
"version": "0.1.0",
"author": {
"name": "Development Seed",
"url": "http://developmentseed.org/",
Expand All @@ -11,5 +11,5 @@
"node": ">=0.4.x"
},
"licenses": [{ "type": "BSD" }],
"main": "./build/default/eio.node"
"main": "./lib/eio"
}
8 changes: 8 additions & 0 deletions test/threads.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var eio = require('eio');

exports['io test'] = function(beforeExit, assert) {
// Increase number of threads to 1.5x the number of logical CPUs.
var cpus = require('os').cpus().length;
var threads = Math.ceil(Math.max(4, cpus* 1.5));
eio.setMinParallel(threads);
}
14 changes: 14 additions & 0 deletions wscript
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import os
import Options
from Configure import ConfigurationError
from shutil import copy2 as copy

TARGET = 'eio'
TARGET_FILE = '%s.node' % TARGET
dest = 'lib/%s' % TARGET_FILE

def set_options(opt):
opt.tool_options("compiler_cxx")
Expand All @@ -22,3 +24,15 @@ def build(bld):
obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-Wall"]
obj.target = TARGET
obj.source = "src/eio.cc"

def shutdown():
if Options.commands['clean']:
if os.path.exists(TARGET_FILE):
unlink(TARGET_FILE)
else:
if os.path.exists('build/Release/%s' % TARGET_FILE):
copy('build/Release/%s' % TARGET_FILE, dest)
elif os.path.exists('build/default/%s' % TARGET_FILE):
copy('build/default/%s' % TARGET_FILE, dest)


0 comments on commit 30d4ccc

Please sign in to comment.