Skip to content

Commit e06ce9e

Browse files
committed
Make script work and add tests
1 parent a3e625b commit e06ce9e

15 files changed

+5725
-1775
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
.DS_Store
12
components
23
build
4+
node_modules

Gruntfile.js

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
module.exports = function(grunt) {
2+
"use strict";
3+
4+
grunt.initConfig({
5+
pkg: require("./package.json"),
6+
watch: {
7+
scripts: {
8+
files: ['*.js', 'src/*.js', 'test/*.html', 'test/*.js'],
9+
tasks: ['default'],
10+
options: {
11+
spawn: false,
12+
},
13+
},
14+
},
15+
shell: {
16+
install: {
17+
command: 'component install --dev',
18+
options: {
19+
stderr: true
20+
}
21+
},
22+
build: {
23+
command: 'component build --dev',
24+
options: {
25+
stderr: true
26+
}
27+
},
28+
standalone: {
29+
command: 'component build --standalone ListFuzzySearch -n list.fuzzysearch.standalone'
30+
},
31+
mkdir: {
32+
command: 'mkdir -p dist'
33+
},
34+
move: {
35+
command: 'mv build/list.fuzzysearch.standalone.js dist/list.fuzzysearch.js'
36+
},
37+
remove: {
38+
command: 'rm -fr build components dist'
39+
}
40+
},
41+
jshint: {
42+
code: {
43+
src: ['Gruntfile.js', '*.js', 'src/*.js'],
44+
options: {
45+
expr: true,
46+
multistr: false,
47+
globals: {
48+
module: true
49+
}
50+
}
51+
},
52+
tests: {
53+
src: ['test/(*|!mocha).js'],
54+
options: {
55+
expr: true,
56+
multistr: true,
57+
globals: {
58+
jQuery: true,
59+
module: true
60+
}
61+
}
62+
}
63+
},
64+
uglify: {
65+
target: {
66+
files: {
67+
'dist/list.fuzzysearch.min.js': ['dist/list.fuzzysearch.js']
68+
}
69+
}
70+
},
71+
mocha: {
72+
cool: {
73+
src: [ 'test/index.html' ],
74+
options: {
75+
run: true,
76+
timeout: 10000,
77+
bail: false,
78+
log: true,
79+
reporter: 'Nyan',
80+
mocha: {
81+
ignoreLeaks: false
82+
}
83+
}
84+
}
85+
}
86+
});
87+
88+
grunt.loadNpmTasks("grunt-contrib-watch");
89+
grunt.loadNpmTasks('grunt-shell');
90+
grunt.loadNpmTasks('grunt-contrib-uglify');
91+
grunt.loadNpmTasks('grunt-contrib-jshint');
92+
grunt.loadNpmTasks('grunt-mocha');
93+
94+
grunt.registerTask('default', ['jshint:code', 'jshint:tests', 'shell:install', 'shell:build', 'mocha']);
95+
grunt.registerTask('dist', ['default', 'shell:standalone', 'shell:mkdir', 'shell:move', 'uglify']);
96+
grunt.registerTask('clean', ['shell:remove']);
97+
98+
grunt.registerTask('test', ['mocha']);
99+
100+
return grunt;
101+
};

Makefile

-21
This file was deleted.

Readme.md

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# List.js Fuzzy Search
32

43
Locate the best instance of 'pattern' in 'text' using the Bitap algorithm.
@@ -12,15 +11,11 @@ Plugin by: [email protected] (Jonny Strömberg / @javve)
1211
Licensed under the Apache License
1312
http://www.apache.org/licenses/LICENSE-2.0
1413

15-
## Installation
16-
17-
Install with [component(1)](http://component.io):
18-
19-
$ component install javve/list.fuzzy.js
20-
21-
## API
22-
14+
## Documentation
15+
Go to [Listjs.com/docs/plugins/pagination](http://listjs.com/docs/plugins/pagination).
2316

17+
## Contribute
18+
Read the guide at [Listjs.com/overview/contribute](http://listjs.com/overview/contribute).
2419

2520
## License
2621

bower.json

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"**/.*",
1919
"node_modules",
2020
"bower_components",
21+
"components",
2122
"test",
2223
"tests"
2324
]

component.json

+11-6
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,28 @@
66
"keywords": [],
77
"dependencies": {
88
"component/classes": "*",
9-
"component/event": "*"
9+
"segmentio/extend": "*",
10+
"javve/events": "*",
11+
"javve/get-by-class": "*",
12+
"javve/to-string": "*"
1013
},
1114
"development": {
1215
"visionmedia/mocha": "*",
13-
"chaijs/chai": "*",
16+
"techjacker/expect.js": "*",
1417
"component/jquery": "1.9.1"
1518
},
1619
"license": "Apache License",
1720
"main": "index.js",
1821
"scripts": [
19-
"index.js"
22+
"index.js",
23+
"src/fuzzy.js"
2024
],
25+
"twitter": "@javve",
26+
2127
"local": [
2228
"list"
2329
],
2430
"paths": [
2531
"/Users/Jonny/Sites/list"
26-
],
27-
"twitter": "@javve"
28-
}
32+
]
33+
}

0 commit comments

Comments
 (0)