-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tzu-Lin Huang
committed
May 26, 2015
1 parent
99fafac
commit abb177f
Showing
5 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"browser": true, | ||
"globalstrict": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
# RollingSpider | ||
Rolling Spider remote controller app for FxOS | ||
|
||
bower install | ||
# Build | ||
|
||
```sh | ||
$> npm install | ||
$> bower install | ||
``` | ||
|
||
# Enable JS syntax linter and make it lint-as-you-save | ||
```sh | ||
$> gulp | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
'use strict'; | ||
var gulp = require('gulp'); | ||
var jshint = require('gulp-jshint'); | ||
var notify = require('gulp-notify'); | ||
var map = require('map-stream'); | ||
var events = require('events'); | ||
var emmitter = new events.EventEmitter(); | ||
var path = require('path'); | ||
|
||
|
||
var jsHintErrorReporter = map(function (file, cb) { | ||
if (!file.jshint.success) { | ||
file.jshint.results.forEach(function (err) { | ||
if (err) { | ||
//console.log(err); | ||
|
||
// Error message | ||
var msg = [ | ||
path.basename(file.path), | ||
'Line: ' + err.error.line, | ||
'Reason: ' + err.error.reason | ||
]; | ||
|
||
// Emit this error event | ||
emmitter.emit('error', new Error(msg.join('\n'))); | ||
|
||
} | ||
}); | ||
|
||
} | ||
cb(null, file); | ||
}); | ||
|
||
gulp.task('jshint', function() { | ||
gulp.src('js/**/*.js') | ||
.pipe(jshint()) | ||
.pipe(jshint.reporter('jshint-stylish')) | ||
.pipe(jsHintErrorReporter) | ||
.on('error', notify.onError(function (error) { | ||
return error.message; | ||
})); | ||
}); | ||
|
||
gulp.task('watch', function() { | ||
gulp.watch('js/**/*.js', ['jshint']); | ||
}); | ||
|
||
gulp.task('default', ['jshint'], function () { | ||
gulp.start('watch'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "fxos-rolling-spider", | ||
"version": "1.0.0", | ||
"description": "Rolling Spider Control App for Firefox OS", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/weilonge/RollingSpider.git" | ||
}, | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/weilonge/RollingSpider/issues" | ||
}, | ||
"homepage": "https://github.com/weilonge/RollingSpider#readme", | ||
"devDependencies": { | ||
"gulp": "^3.8.11", | ||
"gulp-jshint": "^1.11.0", | ||
"gulp-notify": "^2.2.0", | ||
"jshint-stylish": "^2.0.0", | ||
"map-stream": "0.0.5", | ||
"path": "^0.11.14" | ||
} | ||
} |