/*
 =============================================================
 = Foundation Utimate                                         =
 = http://github.com/relution-developments/foundation-remix  =
 = --------------------------------------------------------- =
 = Copyright (c) 2016 - Relution Developments Ltd            =
 = Licensed under the MIT license.                           =
 = @author JayDemitri                                        =
 =============================================================
 */
"use strict";

/*
 Libraries
 ---------
 */
var gulp        = require("gulp"),
    gutil       = require("gulp-util"),
    path        = require("path"),
    bs = require('browser-sync').create('Foundation Ultimate Server');

// @ToDo: SomeTodoooo


var start = function(){
    // Setup Notifications for the server
    bs.emitter.on("init", function () {
        gutil.log("Server is running!");
    });
    // @ToDo: Move to gulp-config
    bs.init({
        server: {
            baseDir: "./build/dev/"
        }
    });
    // Listen to change events on HTML and reload
    // Add more listeners to run tasks instead of just reload
    bs.watch("./build/dev/*.html").on("change", bs.reload);
    // Provide a callback to capture ALL events to CSS
    // files - then filter for 'change' and reload all
    // css files on the page.
    bs.watch("./build/dev/css/*.css", function (event, file) {
        if (event === "change") {
            bs.reload("*.css");
        }
    });
};
// Export our functions
module.exports = {start: start};