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
events = require('events') | |
recipe = (id, description, action) -> | |
# `recipe` wraps the Cake `task` command but fires a events through 'recipe'. | |
# | |
# One can listen for an event with `recipe.on('event_name', callback)`, and | |
# call that event with `recipe.emit('event_name', args)`. | |
# | |
# If `action` takes two arguments, the second argument is presumed to be a | |
# `done` callback. The presence of this callback makes the recipe |
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
class jQueryCasperWrapper | |
constructor: (@selector) -> | |
wrappedMethods = ['data', 'visible'] # ... plus all the other jQuery functions being wrapped | |
_.each(wrappedMethods, (method) => # lodash/underscore foreach -- just from my own preferences | |
wrapper = (args...) => @RemotejQuery(method, args) | |
@[method] = wrapper | |
) | |
RemotejQuery: (methodName, args) -> |
NewerOlder