gausby/rebelle — pull request #9 by gausby (2014-08-26 21:55:47+00:00)
Title: Added a concept of .rebellerc.js files

- When rebelle initialize it will look for `.rebellerc.js` files in the following places:
1. The resolved folder, if the session was started in a folder, or subfolder of a node module. (ie. the folder the package.json resides)
2. Then it will look in the users home dir. (ie. ~/.rebellerc.js)
3. If neither 1 or 2 is found rebelle will continue with the default settings defined in the code.

- the `print`-function is now referenced in global scope. This is done to make it accessible from `.rebellerc.js`-files.

- Added a helper function that load rc files. These are plain CommonJS javascript module files and are required, and executed, before node modules and other javascript files are required into rebelle. The module should be a function and it will get the repl-session object passed as an argument. This makes it possible to alter the repl config and add functionality like so:
```js
module.exports = function(session) {
// ignore undefined return statements
session.ignoreUndefined = false;

// add a .hello-command
session.commands['.hello'] = {
help : 'Show the hello, world! message',
action : function() {
print('Hello, world!');
}
};

// add something to the session context
session.context.something = 'something';

// change the prompt to a $ sign
session.prompt = '$ ';
}
```
Notice that `print` is available to the `.rebellerc.js` files.