Skip to content

Commit

Permalink
Travis integration + coverage reporting.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianreavis committed Nov 17, 2014
1 parent 344ef85 commit 61412d8
Show file tree
Hide file tree
Showing 11 changed files with 385 additions and 30 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
test
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: node_js
node_js:
- "0.10"
script:
- make test
- make test-ci-coverage
38 changes: 38 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.PHONY: test release

MOCHA=node_modules/.bin/mocha
COVERALLS=node_modules/.bin/coveralls
_MOCHA=node_modules/.bin/_mocha
ISTANBUL=node_modules/.bin/istanbul

test:
npm test

test-ci-coverage:
npm install coveralls
npm install istanbul
@rm -rf coverage
$(ISTANBUL) cover $(_MOCHA) --report lcovonly -- -R tap

@echo
@echo Sending report to coveralls.io...
@cat ./coverage/lcov.info | $(COVERALLS)
@rm -rf ./coverage
@echo Done

release:
ifeq ($(strip $(version)),)
@echo "\033[31mERROR:\033[0;39m No version provided."
@echo "\033[1;30mmake release version=1.0.0\033[0;39m"
else
make test
sed -i.bak 's/"version": "[^"]*"/"version": "$(version)"/' package.json
rm *.bak
git add .
git commit -a -m "Released $(version)."
git tag v$(version)
git push origin master
git push origin --tags
npm publish
@echo "\033[32mv${version} released\033[0;39m"
endif
38 changes: 30 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
geocsv-info
===========
# geocsv-info
[![NPM version](http://img.shields.io/npm/v/geocsv-info.svg)](https://www.npmjs.org/package/geocsv-info)
[![Build Status](http://img.shields.io/travis/naturalatlas/geocsv-info/master.svg)](https://travis-ci.org/naturalatlas/geocsv-info)
[![Coverage Status](http://img.shields.io/coveralls/naturalatlas/geocsv-info/master.svg)](https://coveralls.io/r/naturalatlas/geocsv-info)

node.js utility for finding out more information about a spatial csv file
A utility for finding out more information about a spatial CSV file.

```sh
$ npm install geocsv-info --save
```

## Example

Expand All @@ -11,12 +17,15 @@ var geocsvinfo = require('geocsv-info');
geocsvinfo('example.csv', function(err, info){
console.log(info);
});
```

//result
info = {
### Output

```js
{
count: 3,
separator: '|',
headers: [ 'id', 'name', 'wkt' ],
headers: ['id', 'name', 'wkt'],
fields: {
id: 'Number',
name: 'String',
Expand All @@ -27,7 +36,12 @@ info = {
name: 'wkt',
encoding: 'WKT'
},
extent: { minX: 10, minY: 10, maxX: 45, maxY: 40 }
extent: {
minX: 10,
minY: 10,
maxX: 45,
maxY: 40
}
};
```

Expand Down Expand Up @@ -68,4 +82,12 @@ info = {
+ `minX` : *number*
+ `minY` : *number*
+ `maxX` : *number*
+ `maxY` : *number*
+ `maxY` : *number*

## License

Copyright © 2013 [Brandon Reavis](http://github.com/brandonreavis)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
7 changes: 4 additions & 3 deletions cli.js → bin/geocsv-info.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
var geocsvinfo = require('./index.js');
#!/usr/bin/env node
var geocsvinfo = require('../index.js');

var filename = process.argv[2];
if (!filename) {
console.error('Filename must be provided');
process.exit(1);
}

geocsvinfo(filename, function(err, metadata){
if(err){
geocsvinfo(filename, function(err, metadata) {
if (err) {
console.log(err);
process.exit(1);
}
Expand Down
1 change: 1 addition & 0 deletions coverage/coverage.json

Large diffs are not rendered by default.

0 comments on commit 61412d8

Please sign in to comment.