Skip to content

Commit

Permalink
version bump 0.2.1 use istanbul for coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
cainus committed Apr 1, 2014
1 parent c038d66 commit 82bd7c1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 42 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -13,3 +13,4 @@ results

npm-debug.log
node_modules/
coverage
22 changes: 12 additions & 10 deletions Makefile
@@ -1,18 +1,20 @@
REPORTER = spec
test:
@NODE_ENV=test ./node_modules/.bin/mocha -b --reporter $(REPORTER) --recursive
@NODE_ENV=test ./node_modules/.bin/mocha -b --reporter $(REPORTER)

lib-cov:
./node_modules/jscoverage/bin/jscoverage lib lib-cov
lint:
./node_modules/.bin/jshint ./test ./index.js

test-cov: lib-cov
@urlgreyConnect_COVERAGE=1 $(MAKE) test REPORTER=html-cov 1> coverage.html
rm -rf lib-cov
test-cov:
$(MAKE) lint
@NODE_ENV=test ./node_modules/.bin/istanbul cover \
./node_modules/mocha/bin/_mocha -- -R spec

test-coveralls: lib-cov
test-coveralls:
echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID)
$(make) test
@urlgreyConnect_COVERAGE=1 $(MAKE) test REPORTER=mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js || true
rm -rf lib-cov
$(MAKE) test
@NODE_ENV=test ./node_modules/.bin/istanbul cover \
./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && \
cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js || true

.PHONY: test
25 changes: 20 additions & 5 deletions index.js
@@ -1,5 +1,20 @@
var dir = './lib/';
if (process.env.urlgreyConnect_COVERAGE){
dir = './lib-cov/';
}
module.exports = require(dir + 'urlgrey-connect');
var urlgrey = require('urlgrey');
var isFunction = function(functionToCheck) {
var getType = {};
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
};

module.exports = function(protocol, name){
if (!name){
name = 'uri';
}
return function(req, res, next){
var protocolValue = protocol;
if (isFunction(protocol)){
protocolValue = protocol(req);
}
var url = protocolValue + '://' + req.headers.host + req.url;
req[name] = urlgrey(url);
next();
};
};
20 changes: 0 additions & 20 deletions lib/urlgrey-connect.js

This file was deleted.

12 changes: 5 additions & 7 deletions package.json
Expand Up @@ -2,7 +2,7 @@
"name": "urlgrey-connect",
"description": "[![Build Status](https://secure.travis-ci.org/cainus/urlgrey-connect.png?branch=master)](http://travis-ci.org/cainus/urlgrey-connect) [![Coverage Status](https://coveralls.io/repos/cainus/urlgrey-connect/badge.png?branch=master)](https://coveralls.io/r/cainus/urlgrey-connect) [![NPM version](https://badge.fury.io/js/urlgrey-connect.png)](http://badge.fury.io/js/urlgrey-connect)",
"keywords": [],
"version": "0.2.0",
"version": "0.2.1",
"bugs": {
"url": "https://github.com/cainus/urlgrey-connect/issues"
},
Expand All @@ -13,21 +13,19 @@
"Gregg Caines <gregg@caines.ca> (http://caines.ca)"
],
"dependencies": {
"urlgrey": "0.3.2"
"urlgrey": "0.3.2",
"jshint": "^2.4.4"
},
"devDependencies": {
"istanbul": "0.2.7",
"hottap": "1.0.1",
"connect": "2.7.8",
"mocha-lcov-reporter": "0.0.1",
"jscoverage": "0.3.6",
"coveralls": "2.0.7",
"coveralls": "2.10.0",
"mocha": "1.8.1",
"should": "1.1.0"
},
"engines": {
"node": ">=0.8.14 < 0.9.0",
"npm": "1.1.65"
},
"main": "index.js",
"repository": {
"type": "git",
Expand Down

0 comments on commit 82bd7c1

Please sign in to comment.