Created
February 25, 2012 03:34
-
-
Save cpsubrian/1905894 to your computer and use it in GitHub Desktop.
Workign on a repl
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
cpsubrian@blink ~/projects/node/gac (master) | |
$ cake repl | |
-------------------------- | |
____ _ ____ | |
/ ___| / \ / ___| | |
| | _ / _ \| | | |
| |_| |/ ___ \ |___ | |
\____/_/ \_\____| | |
GAC REPL - try 'help' | |
-------------------------- | |
node.js:201 | |
throw e; // process.nextTick error, or 'error' event on first tick | |
^ | |
Error: write EBADF | |
at errnoException (net.js:646:11) | |
at Object.afterWrite [as oncomplete] (net.js:480:18) |
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
# Module dependencies. | |
require 'colors' | |
# Setup the command. | |
module.exports = () -> | |
gac = new REPL() | |
### | |
# GAC REPL Class. | |
### | |
class REPL | |
constructor: () -> | |
ascii = """ | |
-------------------------- | |
____ _ ____ | |
/ ___| / \\ / ___| | |
| | _ / _ \\| | | |
| |_| |/ ___ \\ |___ | |
\\____/_/ \\_\\____| | |
GAC REPL - try 'help' | |
-------------------------- | |
""" | |
console.log ascii.blue | |
# Start the repl. | |
require('repl').start('> ', process.stdin, @eval) | |
eval: (cmd, callback) => | |
console.log 'I am the eval function' | |
callback null, 'Result' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment