Skip to content

Commit ec6eaae

Browse files
committed
Replaced Makefile with grunt tasks for JSHint, mocha and uglify-js.
1 parent 1a2fb2e commit ec6eaae

File tree

7 files changed

+146
-86
lines changed

7 files changed

+146
-86
lines changed

Gruntfile.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* JavaScript Canvas to Blob Gruntfile
3+
* https://github.com/blueimp/JavaScript-Canvas-to-Blob
4+
*
5+
* Copyright 2013, Sebastian Tschan
6+
* https://blueimp.net
7+
*
8+
* Licensed under the MIT license:
9+
* http://www.opensource.org/licenses/MIT
10+
*/
11+
12+
/*global module */
13+
14+
module.exports = function (grunt) {
15+
'use strict';
16+
17+
grunt.initConfig({
18+
jshint: {
19+
all: [
20+
'Gruntfile.js',
21+
'js/canvas-to-blob.js',
22+
'test/test.js'
23+
]
24+
},
25+
mocha: {
26+
all: {
27+
src: ['test/index.html'],
28+
options: {
29+
run: true,
30+
bail: true,
31+
log: true,
32+
reporter: 'Spec'
33+
},
34+
mocha: {
35+
ignoreLeaks: false
36+
}
37+
}
38+
},
39+
uglify: {
40+
production: {
41+
src: [
42+
'js/canvas-to-blob.js'
43+
],
44+
dest: 'js/canvas-to-blob.min.js'
45+
}
46+
}
47+
});
48+
49+
grunt.loadNpmTasks('grunt-contrib-jshint');
50+
grunt.loadNpmTasks('grunt-mocha');
51+
grunt.loadNpmTasks('grunt-contrib-uglify');
52+
grunt.loadNpmTasks('grunt-bump-build-git');
53+
54+
grunt.registerTask('test', ['jshint', 'mocha']);
55+
grunt.registerTask('default', ['test', 'uglify']);
56+
57+
};

Makefile

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

bower.json

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,40 @@
11
{
2-
"name": "blueimp-canvas-to-blob",
3-
"version": "2.0.7",
4-
"title": "JavaScript Canvas to Blob",
5-
"description": "JavaScript Canvas to Blob is a function to convert canvas elements into Blob objects.",
6-
"keywords": [
7-
"javascript",
8-
"canvas",
9-
"blob",
10-
"convert",
11-
"conversion"
12-
],
13-
"homepage": "https://github.com/blueimp/JavaScript-Canvas-to-Blob",
14-
"author": {
15-
"name": "Sebastian Tschan",
16-
"url": "https://blueimp.net"
17-
},
18-
"maintainers": [
19-
{
20-
"name": "Sebastian Tschan",
21-
"url": "https://blueimp.net"
22-
}
23-
],
24-
"repository": {
25-
"type": "git",
26-
"url": "git://github.com/blueimp/JavaScript-Canvas-to-Blob.git"
27-
},
28-
"devDependencies": {
29-
"uglify-js": "2.3.6"
30-
},
31-
"bugs": "https://github.com/blueimp/JavaScript-Canvas-to-Blob/issues",
32-
"licenses": [
33-
{
34-
"type": "MIT",
35-
"url": "http://www.opensource.org/licenses/MIT"
36-
}
37-
],
38-
"main": "js/canvas-to-blob.js"
2+
"name": "blueimp-canvas-to-blob",
3+
"version": "2.1.0",
4+
"title": "JavaScript Canvas to Blob",
5+
"description": "JavaScript Canvas to Blob is a function to convert canvas elements into Blob objects.",
6+
"keywords": [
7+
"javascript",
8+
"canvas",
9+
"blob",
10+
"convert",
11+
"conversion"
12+
],
13+
"homepage": "https://github.com/blueimp/JavaScript-Canvas-to-Blob",
14+
"author": {
15+
"name": "Sebastian Tschan",
16+
"url": "https://blueimp.net"
17+
},
18+
"maintainers": [
19+
{
20+
"name": "Sebastian Tschan",
21+
"url": "https://blueimp.net"
22+
}
23+
],
24+
"repository": {
25+
"type": "git",
26+
"url": "git://github.com/blueimp/JavaScript-Canvas-to-Blob.git"
27+
},
28+
"bugs": "https://github.com/blueimp/JavaScript-Canvas-to-Blob/issues",
29+
"licenses": [
30+
{
31+
"type": "MIT",
32+
"url": "http://www.opensource.org/licenses/MIT"
33+
}
34+
],
35+
"main": "js/canvas-to-blob.js",
36+
"ignore": [
37+
"/*.*",
38+
"test"
39+
]
3940
}

js/canvas-to-blob.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,43 @@
11
{
2-
"name": "blueimp-canvas-to-blob",
3-
"version": "2.0.7",
4-
"title": "JavaScript Canvas to Blob",
5-
"description": "JavaScript Canvas to Blob is a function to convert canvas elements into Blob objects.",
6-
"keywords": [
7-
"javascript",
8-
"canvas",
9-
"blob",
10-
"convert",
11-
"conversion"
12-
],
13-
"homepage": "https://github.com/blueimp/JavaScript-Canvas-to-Blob",
14-
"author": {
15-
"name": "Sebastian Tschan",
16-
"url": "https://blueimp.net"
17-
},
18-
"maintainers": [
19-
{
20-
"name": "Sebastian Tschan",
21-
"url": "https://blueimp.net"
22-
}
23-
],
24-
"repository": {
25-
"type": "git",
26-
"url": "git://github.com/blueimp/JavaScript-Canvas-to-Blob.git"
27-
},
28-
"devDependencies": {
29-
"uglify-js": "2.3.6"
30-
},
31-
"bugs": "https://github.com/blueimp/JavaScript-Canvas-to-Blob/issues",
32-
"licenses": [
33-
{
34-
"type": "MIT",
35-
"url": "http://www.opensource.org/licenses/MIT"
36-
}
37-
],
38-
"main": "js/canvas-to-blob.js"
2+
"name": "blueimp-canvas-to-blob",
3+
"version": "2.1.0",
4+
"title": "JavaScript Canvas to Blob",
5+
"description": "JavaScript Canvas to Blob is a function to convert canvas elements into Blob objects.",
6+
"keywords": [
7+
"javascript",
8+
"canvas",
9+
"blob",
10+
"convert",
11+
"conversion"
12+
],
13+
"homepage": "https://github.com/blueimp/JavaScript-Canvas-to-Blob",
14+
"author": {
15+
"name": "Sebastian Tschan",
16+
"url": "https://blueimp.net"
17+
},
18+
"maintainers": [
19+
{
20+
"name": "Sebastian Tschan",
21+
"url": "https://blueimp.net"
22+
}
23+
],
24+
"repository": {
25+
"type": "git",
26+
"url": "git://github.com/blueimp/JavaScript-Canvas-to-Blob.git"
27+
},
28+
"bugs": "https://github.com/blueimp/JavaScript-Canvas-to-Blob/issues",
29+
"licenses": [
30+
{
31+
"type": "MIT",
32+
"url": "http://www.opensource.org/licenses/MIT"
33+
}
34+
],
35+
"devDependencies": {
36+
"grunt": "~0.4.1",
37+
"grunt-contrib-uglify": "~0.2.7",
38+
"grunt-contrib-jshint": "~0.7.1",
39+
"grunt-bump-build-git": "~1.0.0",
40+
"grunt-mocha": "~0.4.1",
41+
"expect.js": "0.2.0"
42+
}
3943
}

test/index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<!--
33
/*
4-
* JavaScript Canvas to Blob Test 2.0.7
4+
* JavaScript Canvas to Blob Test 2.1.0
55
* https://github.com/blueimp/JavaScript-Canvas-to-Blob
66
*
77
* Copyright 2012, Sebastian Tschan
@@ -32,8 +32,10 @@
3232
<script src="../js/canvas-to-blob.js"></script>
3333
<script src="test.js"></script>
3434
<script>
35-
mocha.checkLeaks();
36-
mocha.run();
35+
if (!window.PHANTOMJS) {
36+
mocha.checkLeaks();
37+
mocha.run();
38+
}
3739
</script>
3840
</body>
3941
</html>

test/test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* JavaScript Canvas to Blob Test 2.0.1
2+
* JavaScript Canvas to Blob Test 2.1.0
33
* https://github.com/blueimp/JavaScript-Canvas-to-Blob
44
*
55
* Copyright 2012, Sebastian Tschan
@@ -15,11 +15,11 @@
1515
'use strict';
1616

1717
// 80x60px GIF image (color black, base64 data):
18-
var b64Data = 'R0lGODdhUAA8AIABAAAAAP///ywAAAAAUAA8AAACS4SPqcvtD6' +
18+
var b64Data = 'R0lGODdhUAA8AIABAAAAAP///ywAAAAAUAA8AAACS4SPqcvtD6' +
1919
'OctNqLs968+w+G4kiW5omm6sq27gvH8kzX9o3n+s73/g8MCofE' +
2020
'ovGITCqXzKbzCY1Kp9Sq9YrNarfcrvcLDovH5PKsAAA7',
21-
imageUrl = 'data:image/gif;base64,' + b64Data,
22-
blob = window.dataURLtoBlob && window.dataURLtoBlob(imageUrl);
21+
imageUrl = 'data:image/gif;base64,' + b64Data,
22+
blob = window.dataURLtoBlob && window.dataURLtoBlob(imageUrl);
2323

2424
describe('canvas.toBlob', function () {
2525

0 commit comments

Comments
 (0)