Skip to content

Commit

Permalink
rpc client add dynamic add/remove proxy and server interfaces and add…
Browse files Browse the repository at this point in the history
… test coverage and format codes
  • Loading branch information
changchang committed Dec 25, 2012
1 parent dc9f5e1 commit 32210db
Show file tree
Hide file tree
Showing 45 changed files with 2,701 additions and 2,639 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.project
node_modules/
coverage.html
lib-cov/
lib-cov/
coverage.html
30 changes: 16 additions & 14 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"predef": [
"describe",
"it",
"before",
"after",
"window",
"describe",
"it",
"before",
"after",
"window",
"__resources__"
],
"es5": true,
"node": true,
"eqeqeq": true,
"undef": true,
"curly": true,
"bitwise": true,
"immed": false,
"newcap": true,
"nonew": true
"es5": true,
"node": true,
"eqeqeq": true,
"undef": true,
"curly": true,
"bitwise": true,
"immed": false,
"newcap": true,
"nonew": true,
"white": false,
"strict": false
}
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
SRC = $(shell find lib -type f -name "*.js")
MOCHA_OPTS=
TESTS = test/*
REPORTER = spec
REPORTER = dot
TIMEOUT = 5000

test:
@./node_modules/.bin/mocha \
--reporter $(REPORTER) --timeout $(TIMEOUT) $(TESTS)
@NODE_ENV=test ./node_modules/.bin/mocha \
--reporter $(REPORTER) --timeout $(TIMEOUT) $(TESTS) \
$(MOCHA_OPTS)

test-cov: lib-cov
@JSCOV=1 $(MAKE) test REPORTER=html-cov > coverage.html && open coverage.html
@POMELO_RPC_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html

lib-cov:
@rm -rf ./$@
@jscoverage lib $@
@jscoverage lib lib-cov

clean:
rm -rf lib-cov
rm -f coverage.html
rm -fr lib-cov

.PHONY: test test-cov
.PHONY: test clean
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
module.exports.client = require('./lib/rpc-client/client');
module.exports.server = require('./lib/rpc-server/server');
if(process.env.POMELO_RPC_COV) {
module.exports.client = require('./lib-cov/rpc-client/client');
module.exports.server = require('./lib-cov/rpc-server/server');
} else {
module.exports.client = require('./lib/rpc-client/client');
module.exports.server = require('./lib/rpc-server/server');
}
Loading

0 comments on commit 32210db

Please sign in to comment.