-
Notifications
You must be signed in to change notification settings - Fork 145
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
Tyler Kellen
committed
Oct 3, 2012
0 parents
commit e494c24
Showing
11 changed files
with
175 additions
and
0 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,3 @@ | ||
node_modules | ||
npm-debug.log | ||
tmp |
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,2 @@ | ||
"Cowboy" Ben Alman (http://benalman.com) | ||
Tyler Kellen (http://goingslowly.com) |
Empty file.
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,43 @@ | ||
/* | ||
* grunt-contrib-server | ||
* http://gruntjs.com/ | ||
* | ||
* Copyright (c) 2012 "Cowboy" Ben Alman, contributors | ||
* Licensed under the MIT license. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
module.exports = function(grunt) { | ||
|
||
// Project configuration. | ||
grunt.initConfig({ | ||
jshint: { | ||
all: [ | ||
'Gruntfile.js', | ||
'tasks/*.js' | ||
], | ||
options: { | ||
curly: true, | ||
eqeqeq: true, | ||
immed: true, | ||
latedef: true, | ||
newcap: true, | ||
noarg: true, | ||
sub: true, | ||
undef: true, | ||
boss: true, | ||
eqnull: true, | ||
node: true, | ||
es5: true | ||
} | ||
} | ||
}); | ||
|
||
// Actually load this plugin's task(s). | ||
grunt.loadTasks('tasks'); | ||
|
||
// By default, lint task. | ||
grunt.registerTask('default', ['jshint']); | ||
|
||
}; |
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 @@ | ||
Copyright (c) 2012 "Cowboy" Ben Alman, contributors | ||
|
||
Permission is hereby granted, free of charge, to any person | ||
obtaining a copy of this software and associated documentation | ||
files (the "Software"), to deal in the Software without | ||
restriction, including without limitation the rights to use, | ||
copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the | ||
Software is furnished to do so, subject to the following | ||
conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. |
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,3 @@ | ||
# grunt-contrib-server (unreleased, for grunt v0.4.0a) | ||
|
||
> Concatenate files. |
Empty file.
Empty file.
Empty file.
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,38 @@ | ||
{ | ||
"name": "grunt-contrib-concat", | ||
"description": "Concatenate files.", | ||
"version": "0.4.0", | ||
"homepage": "https://github.com/gruntjs/grunt-contrib-concat", | ||
"author": { | ||
"name": "\"Cowboy\" Ben Alman", | ||
"email": "cowboy@rj3.net", | ||
"url": "http://gruntjs.com/" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/gruntjs/grunt-contrib-concat.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/gruntjs/grunt-contrib-concat/issues" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "https://github.com/gruntjs/grunt-contrib-concat/blob/master/LICENSE-MIT" | ||
} | ||
], | ||
"main": "Gruntfile.js", | ||
"engines": { | ||
"node": ">= 0.6.0" | ||
}, | ||
"scripts": { | ||
"test": "grunt test" | ||
}, | ||
"devDependencies": { | ||
"grunt-contrib-clean": "0.4.0a", | ||
"grunt": "~0.4.0a" | ||
}, | ||
"keywords": [ | ||
"gruntplugin" | ||
] | ||
} |
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,64 @@ | ||
/* | ||
* grunt-contrib-server | ||
* http://gruntjs.com/ | ||
* | ||
* Copyright (c) 2012 "Cowboy" Ben Alman, contributors | ||
* Licensed under the MIT license. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
module.exports = function(grunt) { | ||
|
||
// Nodejs libs. | ||
var path = require('path'); | ||
|
||
// External libs. | ||
var connect = require('connect'); | ||
|
||
// ========================================================================== | ||
// TASKS | ||
// ========================================================================== | ||
|
||
grunt.registerTask('server', 'Start a static web server.', function() { | ||
// Merge task-specific options with these defaults. | ||
var options = this.options({ | ||
port: 8000, | ||
base: '.', | ||
keepalive: false | ||
}); | ||
|
||
// Connect requires the base path to be absolute. | ||
var base = path.resolve(options.base); | ||
|
||
// Sweet, sweet middleware. | ||
var middleware = [ | ||
// Serve static files. | ||
connect.static(base), | ||
// Make empty directories browsable. (overkill?) | ||
connect.directory(base) | ||
]; | ||
|
||
// If --debug was specified, enable logging. | ||
if (grunt.option('debug')) { | ||
connect.logger.format('grunt', ('[D] server :method :url :status ' + | ||
':res[content-length] - :response-time ms').magenta); | ||
middleware.unshift(connect.logger('grunt')); | ||
} | ||
|
||
// Start server. | ||
grunt.log.writeln('Starting static web server on port ' + options.port + '.'); | ||
connect.apply(null, middleware).listen(options.port); | ||
|
||
// So many people expect this task to keep alive that I'm adding an option | ||
// for it. Running the task explicitly as grunt:keepalive will override any | ||
// value stored in the config. Have fun, people. | ||
if (this.flags.keepalive || options.keepalive) { | ||
// This is now an async task. Since we don't store a handle to the "done" | ||
// function, this task will never, ever, ever terminate. Have fun! | ||
this.async(); | ||
grunt.log.write('Waiting forever...'); | ||
} | ||
}); | ||
|
||
}; |