stringparser / runtime

a runtime interface
4 stars 1 forks source link

Run commands on demand #1

Closed stringparser closed 10 years ago

stringparser commented 10 years ago

At the moment is possible to run commands defined. It would be also helpful to consume them on demand based on instance's events or common ground like onStartup event, which is already implemented.

For example, could do

var runtime = require('gulp-runtime');

runtime.onStartup(function(){
  this.run(<command1> + <command2> + ...);
})

At the moment is possible to do

runtime.startup(function(){
   this.setPrompt(' > custom prompt');
   this.prompt()
})
stringparser commented 10 years ago

There have been changes in this direction. A method was added to the Runtime.prototype named wire. Admits only one argument and should be a string. Whatever you write there is like if you wrote it on the terminal.

stringparser commented 10 years ago

This method could be the main entry point for the runtime. Still thinking of it, but makes sense.

stringparser commented 10 years ago

Yep, this is working at the moment.