jspec.shell.js
This file
Path
spec/lib/jspec.shell.js
39 lines · 820 bytes · JavaScript
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 4d1bda0 point at it.
Removed Route#run(). Closes #188visionmediabefore adoption4d1bda0
lines 1–39why, one step back12// JSpec - Shell - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)34;(function(){5 6 var _quit = quit7 8 Shell = {9 10 // --- Global11 12 main: this,13 14 // --- Commands15 16 commands: {17 quit: ['Terminate the shell', function(){ _quit() }],18 exit: ['Terminate the shell', function(){ _quit() }],19 p: ['Inspect an object', function(o){ return o.toSource() }]20 },21 22 /**23 * Start the interactive shell.24 *25 * @api public26 */27 28 start : function() {29 for (var name in this.commands)30 if (this.commands.hasOwnProperty(name))31 this.commands[name][1].length ?32 this.main[name] = this.commands[name][1] :33 this.main.__defineGetter__(name, this.commands[name][1])34 }35 }36 37 Shell.start()38 39})()