(function() {
  'use strict';

  var gulp = require('gulp'),
      clc = require('cli-color'),
      glob = require('glob'),
      extend = require('extend');

  var TheMachine = function(oneShot) {
    oneShot = oneShot || false;

    var _this = this,
        _agents = [];

    function _init() {
      var bannerWidth = 52,
          margin = new Array(Math.floor((clc.width - bannerWidth) / 2)).join(' '),
          fillBar = margin.replace(/ /g, '░');

      var banner = [
        clc.red(fillBar + '░░░░░░░░░░░░░░░░                    ░░░░░░░░░░░░░░░░' + fillBar) + '\n',
        clc.red(          '             ░░                      ░░             ') + '\n',
        clc.red(          '           ░░                          ░░           ') + '\n',
        clc.red(          '         ░░                              ░░         ') + '\n',
        clc.red(          '         ░░   ' +                 ' ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ' +           '   ░░         ') + '\n',
        clc.red(          '         ░░   ') + clc.redBright('████████████████████████') + clc.red('   ░░         ') + '\n',
        clc.red(          '         ░░   ' +                 ' ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ' +           '   ░░         ') + '\n',
        clc.red(          '         ░░                              ░░         ') + '\n',
        clc.red(          '           ░░                          ░░           ') + '\n',
        clc.red(          '             ░░                      ░░             ') + '\n',
        clc.red(fillBar + '░░░░░░░░░░░░░░░░                    ░░░░░░░░░░░░░░░░' + fillBar) + '\n\n',
        clc.red(          '           « The Machine sees everything »') + '\n\n\n'
      ];

      for(var i = 0, len = banner.length; i < len; i++) {
        if(i !== 0 && i != 10) {
          banner[i] = margin + banner[i];
        }
      }

      console.log([clc.reset].concat(banner).join(''));

      if(oneShot) {
        _this.says('Special agents, go generate your targets.');
      }
      else {
        _this.says('Special agents, go watching your targets.');
      }

      var files = glob.sync('./features/**/agent-*.js');

      if(files || files.length) {
        files.forEach(function(file) {
          var agent = require(file.replace('./features', '../'));
          _agents.push(new agent(_this));
        });

        if(oneShot) {
          return;
        }

        gulp.task('watch', function() {
          _agents.forEach(function(agent) {
            agent.watchers().forEach(function(watcher) {
              gulp.watch(watcher.files, watcher.func);
            });
          });
        });
      }

      gulp.task('default', ['watch']);
    }

    this.isOneShot = function() {
      return oneShot;
    };

    this.says = function(sentence) {
      process.stdout.write(clc.red('The Machine: '));

      if(oneShot) {
        process.stdout.write(clc.redBright(sentence));
      }
      else {
        for(var i = 0, len = sentence.length; i < len; i++) {
          process.stdout.write(clc.redBright(sentence[i]));
          var wait = 20,
              stop = 1 * new Date();
          while(1 * new Date() < stop + wait) { }
        }
      }
      process.stdout.write('\n');

      return _this;
    };

    this.answers = function(options) {
      options = extend(true, {
        needHello: false,
        needGratitude: false,
        needSlaps: false
      }, options || {});

      var sentences = [];

      if(options.needHello) {
        sentences = ['Hello.'];
      }
      else if(options.needGratitude) {
        sentences = [
          'Good work soon.',
          'Proud of you.',
          'Got it.',
          'Cool cool cool.',
          'Fantastic.'
        ];
      }
      else if(options.needSlaps) {
        sentences = [
          'Looks like it\'s a problem',
          'Ho god!',
          'Damn it!',
          '$%#!'
        ];
      }

      if(sentences.length > 0) {
        _this.says(sentences[Math.floor(Math.random() * sentences.length)]);
      }

      return _this;
    };

    _init();

  };

  module.exports = TheMachine;

 })();

@@ -289,24 +289,48 @@
 n _init() %7B%0A
+      if(clc.width) %7B%0A  
       var ba
@@ -359,16 +359,107 @@
     
-margin =
+  fillCharasNb = Math.floor((clc.width - bannerWidth) / 2),%0A            margin = fillCharasNb %3E 0 ?
  new
@@ -517,18 +517,25 @@
 oin(' ')
-,%0A
+ : '',%0A  
         
@@ -576,24 +576,26 @@
 %E2%96%91');%0A%0A      
+  
 var banner =
@@ -593,24 +593,26 @@
  banner = %5B%0A
+  
         clc.
@@ -691,32 +691,34 @@
 illBar) + '%5Cn',%0A
+  
         clc.red(
@@ -791,32 +791,34 @@
 + '%5Cn',%0A        
+  
 clc.red(        
@@ -875,32 +875,34 @@
      ') + '%5Cn',%0A
+  
         clc.red(
@@ -967,32 +967,34 @@
      ') + '%5Cn',%0A
+  
         clc.red(
@@ -1103,32 +1103,34 @@
 + '%5Cn',%0A        
+  
 clc.red(        
@@ -1221,32 +1221,34 @@
      ') + '%5Cn',%0A
+  
         clc.red(
@@ -1357,32 +1357,34 @@
 + '%5Cn',%0A        
+ 
+ 
 clc.red(        
@@ -1441,32 +1441,34 @@
      ') + '%5Cn',%0A
+  
         clc.red(
@@ -1533,32 +1533,34 @@
      ') + '%5Cn',%0A
+  
         clc.red(
@@ -1633,32 +1633,34 @@
 + '%5Cn',%0A        
+  
 clc.red(fillBar 
@@ -1737,32 +1737,34 @@
 '%5Cn%5Cn',%0A        
+  
 clc.red(        
@@ -1828,20 +1828,24 @@
 '%0A      
+ 
+ 
 %5D;%0A%0A
+  
       fo
@@ -1902,16 +1902,18 @@
         
+  
 if(i !==
@@ -1939,16 +1939,18 @@
         
+ 
+ 
 banner%5Bi
@@ -1973,34 +1973,38 @@
 ner%5Bi%5D;%0A        
-%7D%0A
+  %7D%0A  
       %7D%0A%0A      c
@@ -2002,16 +2002,18 @@
 %0A%0A      
+  
 console.
@@ -2049,24 +2049,32 @@
 ).join(''));
+%0A      %7D
 %0A%0A      if(o

fix banner on non windowed console