forked from serby/jangle
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Paul Serby
committed
Feb 20, 2012
0 parents
commit a309b6d
Showing
6 changed files
with
143 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,35 @@ | ||
# Node.js with Express and Stlyus | ||
public/css/*.css | ||
public/css/main/*.css | ||
public/css/admin/*.css | ||
/.monitor | ||
|
||
# Eclipse | ||
/.project | ||
/.settings | ||
/.buildpath | ||
|
||
# Windows | ||
Thumbs.db | ||
|
||
# Vim | ||
.*.sw[a-z] | ||
*.un~i | ||
tags | ||
|
||
# OsX | ||
.DS_Store | ||
Icon? | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
|
||
# nodejs npm modules | ||
/node_modules | ||
|
||
# node-cluster | ||
/pids | ||
*.sock | ||
|
||
# ZSH Cake plugin cache | ||
/.cake_task_cache |
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 @@ | ||
language: node_js | ||
node_js: | ||
- 0.4 | ||
- 0.6 |
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,12 @@ | ||
test: | ||
@./node_modules/.bin/mocha \ | ||
-r should \ | ||
-R spec | ||
|
||
lint-changed: | ||
@jshint `git status --porcelain | sed -e "s/^...//g"` | ||
|
||
lint: | ||
@jshint lib test | ||
|
||
.PHONY: test lint lint-changed |
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,15 @@ | ||
# jangle | ||
|
||
[![build status](https://secure.travis-ci.org/serby/jangle.png)](http://travis-ci.org/serby/jangle) | ||
|
||
## Installation | ||
|
||
npm install jangle | ||
|
||
## Usage | ||
|
||
## Credits | ||
[Paul Serby](https://github.com/serby/) | ||
|
||
## Licence | ||
Licenced under the [New BSD License](http://opensource.org/licenses/bsd-license.php) |
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,56 @@ | ||
var async = require('async'); | ||
|
||
module.exports.chain = function () { | ||
var | ||
responseArgs, | ||
errored = false, | ||
links = [], | ||
detectFn; | ||
|
||
var self = { | ||
link: function() { | ||
var | ||
args = Array.prototype.slice.call(arguments), | ||
fn = args.shift(); | ||
|
||
links.push(function(callback) { | ||
args.push(callback); | ||
fn.apply(fn, args); | ||
}); | ||
|
||
return self; | ||
}, | ||
detect: function(fn) { | ||
detectFn = function(error) { | ||
if (error || fn.apply(fn, arguments)) { | ||
responseArgs = Array.prototype.slice.call(arguments); | ||
} | ||
}; | ||
return self; | ||
}, | ||
error: function(fn) { | ||
var error = [responseArgs ? responseArgs.shift() : null]; | ||
if (error[0]) { | ||
fn.apply(fn, error); | ||
errored = true; | ||
} | ||
return self; | ||
}, | ||
run: function(fn) { | ||
async.forEachSeries(links, function(linkFn, done) { | ||
|
||
linkFn.bind(linkFn, function() { | ||
detectFn.apply(detectFn, arguments); | ||
done(); | ||
})(); | ||
|
||
}, function() { | ||
if (!errored) { | ||
fn.apply(fn, responseArgs); | ||
} | ||
}); | ||
} | ||
}; | ||
|
||
return self; | ||
}; |
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,21 @@ | ||
{ | ||
"author": "Paul Serby <paul@serby.net>", | ||
"name": "jangle", | ||
"description": "", | ||
"version": "0.0.1", | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:serby/jangle" | ||
}, | ||
"main": "lib/jangle.js", | ||
"scripts": { | ||
"test": "mocha -r should -R List " | ||
}, | ||
"engines": { | ||
"node": ">0.4.0" | ||
}, | ||
"dependencies": { | ||
"async": "~0.1" | ||
}, | ||
"devDependencies": {} | ||
} |