This file contains hidden or 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
var q = function() { | |
var args = _.flatten(arguments); | |
var ctr = args.length; | |
var complete; | |
function run(i) { | |
args[i](function() { | |
if (i + 1 === ctr) { | |
if (complete) { | |
complete(); |
This file contains hidden or 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
match = require 'minimatch' | |
_ = require 'underscore' | |
class Events | |
on: (evt, handler = _.i, scope = @) -> | |
@_events or= [] | |
spec = | |
evt: evt | |
handler: handler | |
scope: scope |
This file contains hidden or 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
match = require 'minimatch' | |
_ = require 'underscore' | |
class Events | |
constructor: -> | |
@_events = []; | |
on: (evt, handler = _.i, scope = @) -> | |
@_events.push {evt, handler, scope};@ | |
fire: (evt, args...) -> | |
_.each @_events, (spec) => |
This file contains hidden or 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
// going to use _ for array flattening until this - http://yuilibrary.com/projects/yui3/ticket/2531371 is resolved. | |
var _ = require('underscore'), | |
YUI = require('yui3').YUI; | |
YUI.add('node-js', function (Y) { | |
Y.namespace('nodejs'); | |
Y.nodejs.require = function () { | |
var requires = {}, | |
modules = _.flatten(arguments); |
NewerOlder