Skip to content

Instantly share code, notes, and snippets.

@matehat
Forked from jashkenas/testing.coffee
Created March 27, 2010 02:01
Show Gist options
  • Save matehat/345651 to your computer and use it in GitHub Desktop.
Save matehat/345651 to your computer and use it in GitHub Desktop.
[err, files]: fs.readdir 'test', defer
files.forEach (file) ->
return unless file.ext is '.coffee'
[err, code]: fs.readFile file, defer
CoffeeScript.run code
=>
fs.readdir('test', (function(__this) {
var __func = function() {
var _a, err, files;
_a = (arguments.length > 1 ? Array.prototype.slice(arguments, 0) : arguments[0]);
err = _a[0];
files = _a[1];
return files.forEach(function(file) {
if (!(file.ext === '.coffee')) {
return null;
}
fs.readFile(file, (function(__this) {
var __func = function() {
var _b, code;
_b = (arguments.length > 1 ? Array.prototype.slice(arguments, 0) : arguments[0]);
err = _b[0];
code = _b[1];
return CoffeeScript.run(code);
};
return (function() {
return __func.apply(__this, arguments);
});
})(this));
return null;
});
};
return (function() {
return __func.apply(__this, arguments);
});
})(this));
return null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment