Skip to content

Commit a9310b3

Browse files
author
haoxin
committed
add badges; add coverage; fix tests; rm makefile, npmignore
1 parent 49d09d0 commit a9310b3

File tree

8 files changed

+67
-111
lines changed

8 files changed

+67
-111
lines changed

.gitignore

Lines changed: 3 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,7 @@
1-
# Compiled source #
2-
###################
3-
*.com
4-
*.class
5-
*.dll
6-
*.exe
7-
*.o
8-
*.so
91

10-
# Packages #
11-
############
12-
# it's better to unpack these files and commit the raw source
13-
# git has its own built in compression methods
14-
*.7z
15-
*.dmg
16-
*.gz
17-
*.iso
18-
*.jar
19-
*.rar
20-
*.tar
21-
*.zip
22-
23-
# Logs and databases #
24-
######################
25-
*.log
26-
*.sql
27-
*.sqlite
28-
29-
# OS generated files #
30-
######################
312
.DS_Store*
32-
ehthumbs.db
33-
Icon?
34-
Thumbs.db
35-
36-
# Node.js #
37-
###########
38-
lib-cov
39-
*.seed
40-
*.log
41-
*.csv
42-
*.dat
43-
*.out
44-
*.pid
45-
*.gz
3+
*-link
464

47-
pids
48-
logs
49-
results
50-
51-
node_modules
525
npm-debug.log
53-
54-
# Components #
55-
##############
56-
57-
/build
58-
/components
59-
60-
# ImageMagick #
61-
###############
62-
63-
*.cache
64-
*.mpc
65-
66-
# Other #
67-
#########
68-
test/*.2
69-
test/*/*.2
70-
test/*.mp4
71-
test/images/originalSideways.jpg.2
6+
node_modules
7+
coverage

.npmignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
language: node_js
22
node_js:
3-
- "0.10"
3+
- "0.10"
4+
- "0.11"
5+
script: "npm run-script test-travis"
6+
after_script: "npm install coveralls@2 && cat ./coverage/lcov.info | coveralls"

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
The MIT License (MIT)
3+
4+
Copyright (c) 2014 Jonathan Ong [email protected]
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

Makefile

Lines changed: 0 additions & 12 deletions
This file was deleted.

README.md

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
# fs.readdirSyncRecursive [![Build Status](https://travis-ci.org/jonathanong/fs-readdir-recursive.png)](https://travis-ci.org/jonathanong/fs-readdir-recursive)
1+
# fs.readdirSyncRecursive
2+
3+
[![NPM version][npm-image]][npm-url]
4+
[![Build status][travis-image]][travis-url]
5+
[![Test coverage][coveralls-image]][coveralls-url]
6+
[![Dependency Status][david-image]][david-url]
7+
[![License][license-image]][license-url]
8+
[![Downloads][downloads-image]][downloads-url]
9+
[![Gittip][gittip-image]][gittip-url]
210

311
Read a directory recursively.
412

@@ -15,7 +23,7 @@ var read = require('fs-readdir-recursive')
1523
read(__dirname) === [
1624
'test/test.js',
1725
'index.js',
18-
'Makefile',
26+
'LICENSE',
1927
'package.json',
2028
'README.md'
2129
]
@@ -35,26 +43,19 @@ function (x) {
3543

3644
Which basically just ignores `.` files.
3745

38-
## License
39-
40-
The MIT License (MIT)
41-
42-
Copyright (c) 2013 Jonathan Ong [email protected]
43-
44-
Permission is hereby granted, free of charge, to any person obtaining a copy
45-
of this software and associated documentation files (the "Software"), to deal
46-
in the Software without restriction, including without limitation the rights
47-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
48-
copies of the Software, and to permit persons to whom the Software is
49-
furnished to do so, subject to the following conditions:
50-
51-
The above copyright notice and this permission notice shall be included in
52-
all copies or substantial portions of the Software.
53-
54-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
55-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
56-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
57-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
58-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
59-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
60-
THE SOFTWARE.
46+
[npm-image]: https://img.shields.io/npm/v/fs-readdir-recursive.svg?style=flat-square
47+
[npm-url]: https://npmjs.org/package/fs-readdir-recursive
48+
[github-tag]: http://img.shields.io/github/tag/fs-utils/fs-readdir-recursive.svg?style=flat-square
49+
[github-url]: https://github.com/fs-utils/fs-readdir-recursive/tags
50+
[travis-image]: https://img.shields.io/travis/fs-utils/fs-readdir-recursive.svg?style=flat-square
51+
[travis-url]: https://travis-ci.org/fs-utils/fs-readdir-recursive
52+
[coveralls-image]: https://img.shields.io/coveralls/fs-utils/fs-readdir-recursive.svg?style=flat-square
53+
[coveralls-url]: https://coveralls.io/r/fs-utils/fs-readdir-recursive
54+
[david-image]: http://img.shields.io/david/fs-utils/fs-readdir-recursive.svg?style=flat-square
55+
[david-url]: https://david-dm.org/fs-utils/fs-readdir-recursive
56+
[license-image]: http://img.shields.io/npm/l/fs-readdir-recursive.svg?style=flat-square
57+
[license-url]: LICENSE
58+
[downloads-image]: http://img.shields.io/npm/dm/fs-readdir-recursive.svg?style=flat-square
59+
[downloads-url]: https://npmjs.org/package/fs-readdir-recursive
60+
[gittip-image]: https://img.shields.io/gratipay/jonathanong.svg?style=flat-square
61+
[gittip-url]: https://gratipay.com/jonathanong/

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
"description": "Recursively read a directory",
44
"version": "0.0.2",
55
"scripts": {
6-
"test": "make test"
6+
"test": "mocha --reporter spec",
7+
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot",
8+
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"
79
},
810
"devDependencies": {
11+
"istanbul": "0",
912
"mocha": "*",
1013
"should": "*"
1114
},
@@ -19,6 +22,9 @@
1922
"type": "git",
2023
"url": "https://github.com/jonathanong/fs-readdir-recursive.git"
2124
},
25+
"files": [
26+
"index.js"
27+
],
2228
"bugs": {
2329
"url": "https://github.com/jonathanong/fs-readdir-recursive/issues",
2430
"email": "[email protected]"

test/test.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var fs = require('fs')
22
var path = require('path')
3+
var should = require('should')
34

45
var read = require('../')
56

@@ -15,14 +16,14 @@ describe('fs.readdirSyncRecursive()', function () {
1516

1617
it('should work at the root with a filter', function (done) {
1718
var files = read(path.join(__dirname, '..'), function (name) {
18-
return name[0] !== '.' && name !== 'node_modules'
19+
return name[0] !== '.' && name !== 'node_modules' && name !== 'coverage'
1920
})
2021

2122
files.length.should.equal(5)
2223
files.sort().should.eql([
2324
'test/test.js',
2425
'index.js',
25-
'Makefile',
26+
'LICENSE',
2627
'package.json',
2728
'README.md'
2829
].sort())
@@ -61,14 +62,14 @@ describe('fs.readdirSyncRecursive()', function () {
6162
fs.symlinkSync(path.join(__dirname, '..'), linkname, 'dir')
6263

6364
var files = read(linkname, function (name) {
64-
return name[0] !== '.' && name !== 'node_modules'
65+
return name[0] !== '.' && name !== 'node_modules' && name !== 'coverage'
6566
})
6667

6768
files.length.should.equal(5)
6869
files.sort().should.eql([
6970
'test/test.js',
7071
'index.js',
71-
'Makefile',
72+
'LICENSE',
7273
'package.json',
7374
'README.md'
7475
].sort())

0 commit comments

Comments
 (0)