<commit_before>/**
 * @fileOverview tests.js Gives testing code for the Chrome Extension.
 * It is currently being used to develope new functionality, but test
 * cases will be added for complete code coverage. It recently changed
 * to the Jasmine JS testing library, but full integration is not complete.
 * Notably, the testing style is not following Jasmine's conventions on
 * "wait."
 **/

describe("Extension", function() {

  beforeEach(function() {
    //pass
  });

  /**
   * Tests modal button functionality. This is a naively implemented
   * test case. Future versions should more gracefully handle Chrome's
   * callbacks. This example indicates that every function may need to
   * support a callback parameter in order to support asynchronous testing.
   */
  it("should change the modal button", function() {

    //Get all the windows so we can get a tab
    chrome.windows.getAll({"populate" : true},
      function(windows){

        // Get a valid Tab
        var tab = null;
        for (var i = 0; i < windows.length; i++) {
          if(windows[i].tabs.length > 0) {
            tab = windows[i].tabs[0];
          }
        }

        // Get the current setting of the badge text
        // so we can flip it.
        chrome.browserAction.getBadgeText({},
          function(currentText) {

            // We define a callback for the function we are testing so we can
            // check the results without needing to use setTimeout
            function testingCallback() {
              if (currentText === "off") {
                chrome.browserAction.getBadgeText({},
                  function(currentText) {
                    expect(currentText).toEqual("on");
                  }
                );
              } else if(currentText === "on") {
                chrome.browserAction.getBadgeText({},
                  function(currentText) {
                    expect(currentText).toEqual("off");
                  }
                );
              } else {
                expect("false").toEqual("true");
              }

              // Attempt to toggle the modal button back to its prior state
              modalButtonCallback(tab);
            }

            // Now that we have setup the test, it is time to check the
            modalButtonCallback(tab, testingCallback);
          }
        );
      }
    );
  });
});
describe ("First Run Suite", function() {

    /*
     * Test the function that gets the running privly version
     */
    it("tests getPrivlyVersion", function() {
        var output = getPrivlyVersion();
        expect(output).toMatch(/\d+\.\d+\.\d+/);
    });

    /*
     * Test the function that gets the version in local storage
     */
    it("tests getStoredVersion", function() {
        var output = getStoredVersion();
        expect(output).toEqual(localStorage["version"]);
    });

    /*
     * Test the function that updates local storage with the running version
     */
    it("tests update_version", function() {
        var existing = getStoredVersion();
        var modified = existing + "99";
        update_version(modified);
        expect(getStoredVersion()).toEqual(modified);
        update_version(existing);
    });

    /*
     * Test the function that launches the first_run.html page
     */
    it("tests firstrun function", function(){
      //Get the url of the first_run.html
      var page = chrome.extension.getURL("pages/first_run.html");
      var Window = 0;
      //Look at all windows
      chrome.windows.getAll({populate:true},function(window_list){
        var count_before = 0;
        var nope = 0;
        for (var i = 0; i < window_list.length; i++){
          //return all tabs in each window that match the first_run url
          chrome.tabs.query({windowId:parseInt(window_list[i].id,10),url:page},function(tab){
            count_before+=1
          });
          waits(500);
          //if on the last window
         if (i === window_list.length-1){
            //load new window
            firstrun();
            var count_after = 0;
            //Look at all windows
            chrome.windows.getAll({populate:true},function(win_list){
              for(var i = 0; i < win_list.length; i++){
                //return all tabs in each window that match the first_run url
                chrome.tabs.query({windowId:parseInt(win_list[i].id,10),url:page},function(tab){
                  count_after+=1;
                });
                waits(500);
                if ( i === win_list.length-1){
                    expect(count_after).toEqual(count_before+1);
                }
              }
            });
          }
        }
      });
    });

    /*
     * Test the function that launches the first_run.html page when not updated or new
     */
    it("should not open firstrun html when not new or updated", function() {
      var page = chrome.extension.getURL("pages/first_run.html");
      var stored = getStoredVersion();
      var running = getPrivlyVersion();
      var tabs_before = 0;
      chrome.windows.getAll({populate:true},function(win_list){
        for(var i = 0; i < win_list.length; i++){
          chrome.tabs.query({windowId:parseInt(win_list[i].id,10),url:page},function(tab){
            tabs_before+= tab.length;
          });
          waits(500);
          if (i === win_list.length-1 && stored === running){
            run_firstrun();
            var tabs_after = 0;
            chrome.windows.getAll({populate:true},function(wind_list){
              for (var i = 0; i < wind_list.length; i++){
                chrome.tabs.query({windowId:parseInt(wind_list[i].id,10),url:page},function(tab){
                  tabs_after += tab.length;
                });
                waits(500);
                if (i === wind_list.length-1){
                  expect(tabs_after).toEqual(tabs_before);
                }
              }
            });
          }
        }
      });
    });

    /*
     * Test the function that launches the first_run.html page when new
     */
    it("should open firstrun html when new", function() {
      var page = chrome.extension.getURL("pages/first_run.html");
      var stored = getStoredVersion();
      var running = getPrivlyVersion();
      var tabs_before = 0;
      chrome.windows.getAll({populate:true},function(win_list){
        for(var i = 0; i < win_list.length; i++){
          chrome.tabs.query({windowId:parseInt(win_list[i].id,10),url:page},function(tab){
            tabs_before+= tab.length;
          });
          waits(500);
          if (i === win_list.length-1){
            update_version(null);
            run_firstrun();
            update_version(stored);
            var tabs_after = 0;
            chrome.windows.getAll({populate:true},function(wind_list){
              for (var i = 0; i < wind_list.length; i++){
                chrome.tabs.query({windowId:parseInt(wind_list[i].id,10),url:page},function(tab){
                  tabs_after += tab.length;
                });
                waits(500);
                if (i === wind_list.length-1){
                  expect(tabs_after).toEqual(tabs_before+1);
                }
              }
            });
          }
        }
      });
    });

    /*
     * Test the function that launches the first_run.html page when updated
     */
    it("should open firstrun html when updated", function() {
      var page = chrome.extension.getURL("pages/first_run.html");
      var stored = getStoredVersion();
      var running = getPrivlyVersion();
      var tabs_before = 0;
      chrome.windows.getAll({populate:true},function(win_list){
        for(var i = 0; i < win_list.length; i++){
          chrome.tabs.query({windowId:parseInt(win_list[i].id,10),url:page},function(tab){
            tabs_before+= tab.length;
          });
          waits(500);
          if (i === win_list.length-1){
            //modify version in local storage
            update_version(stored+"99");
            run_firstrun();
            //reset version to original
            update_version(stored);
            var tabs_after = 0;
            chrome.windows.getAll({populate:true},function(wind_list){
              for (var i = 0; i < wind_list.length; i++){
                chrome.tabs.query({windowId:parseInt(wind_list[i].id,10),url:page},function(tab){
                  tabs_after += tab.length;
                });
                waits(500);
                if (i === wind_list.length-1){
                  expect(tabs_after).toEqual(tabs_before+1);
                }
              }
            });
          }
        }
      });
    });
});

(function() {
  var jasmineEnv = jasmine.getEnv();
  jasmineEnv.updateInterval = 1000;

  var htmlReporter = new jasmine.HtmlReporter();

  jasmineEnv.addReporter(htmlReporter);

  jasmineEnv.specFilter = function(spec) {
    return htmlReporter.specFilter(spec);
  };

  var currentWindowOnload = window.onload;

  window.onload = function() {
    if (currentWindowOnload) {
      currentWindowOnload();
    }
    execJasmine();
  };

  function execJasmine() {
    jasmineEnv.execute();
  }
})();
<commit_msg>Redirect test output to console<commit_after>/**
 * @fileOverview tests.js Gives testing code for the Chrome Extension.
 * It is currently being used to develope new functionality, but test
 * cases will be added for complete code coverage. It recently changed
 * to the Jasmine JS testing library, but full integration is not complete.
 * Notably, the testing style is not following Jasmine's conventions on
 * "wait."
 **/

describe("Extension", function() {

  beforeEach(function() {
    //pass
  });

  /**
   * Tests modal button functionality. This is a naively implemented
   * test case. Future versions should more gracefully handle Chrome's
   * callbacks. This example indicates that every function may need to
   * support a callback parameter in order to support asynchronous testing.
   */
  it("should change the modal button", function() {

    //Get all the windows so we can get a tab
    chrome.windows.getAll({"populate" : true},
      function(windows){

        // Get a valid Tab
        var tab = null;
        for (var i = 0; i < windows.length; i++) {
          if(windows[i].tabs.length > 0) {
            tab = windows[i].tabs[0];
          }
        }

        // Get the current setting of the badge text
        // so we can flip it.
        chrome.browserAction.getBadgeText({},
          function(currentText) {

            // We define a callback for the function we are testing so we can
            // check the results without needing to use setTimeout
            function testingCallback() {
              if (currentText === "off") {
                chrome.browserAction.getBadgeText({},
                  function(currentText) {
                    expect(currentText).toEqual("on");
                  }
                );
              } else if(currentText === "on") {
                chrome.browserAction.getBadgeText({},
                  function(currentText) {
                    expect(currentText).toEqual("off");
                  }
                );
              } else {
                expect("false").toEqual("true");
              }

              // Attempt to toggle the modal button back to its prior state
              modalButtonCallback(tab);
            }

            // Now that we have setup the test, it is time to check the
            modalButtonCallback(tab, testingCallback);
          }
        );
      }
    );
  });
});
describe ("First Run Suite", function() {

    /*
     * Test the function that gets the running privly version
     */
    it("tests getPrivlyVersion", function() {
        var output = getPrivlyVersion();
        expect(output).toMatch(/\d+\.\d+\.\d+/);
    });

    /*
     * Test the function that gets the version in local storage
     */
    it("tests getStoredVersion", function() {
        var output = getStoredVersion();
        expect(output).toEqual(localStorage["version"]);
    });

    /*
     * Test the function that updates local storage with the running version
     */
    it("tests update_version", function() {
        var existing = getStoredVersion();
        var modified = existing + "99";
        update_version(modified);
        expect(getStoredVersion()).toEqual(modified);
        update_version(existing);
    });

    /*
     * Test the function that launches the first_run.html page
     */
    it("tests firstrun function", function(){
      //Get the url of the first_run.html
      var page = chrome.extension.getURL("pages/first_run.html");
      var Window = 0;
      //Look at all windows
      chrome.windows.getAll({populate:true},function(window_list){
        var count_before = 0;
        var nope = 0;
        for (var i = 0; i < window_list.length; i++){
          //return all tabs in each window that match the first_run url
          chrome.tabs.query({windowId:parseInt(window_list[i].id,10),url:page},function(tab){
            count_before+=1
          });
          waits(500);
          //if on the last window
         if (i === window_list.length-1){
            //load new window
            firstrun();
            var count_after = 0;
            //Look at all windows
            chrome.windows.getAll({populate:true},function(win_list){
              for(var i = 0; i < win_list.length; i++){
                //return all tabs in each window that match the first_run url
                chrome.tabs.query({windowId:parseInt(win_list[i].id,10),url:page},function(tab){
                  count_after+=1;
                });
                waits(500);
                if ( i === win_list.length-1){
                    expect(count_after).toEqual(count_before+1);
                }
              }
            });
          }
        }
      });
    });

    /*
     * Test the function that launches the first_run.html page when not updated or new
     */
    it("should not open firstrun html when not new or updated", function() {
      var page = chrome.extension.getURL("pages/first_run.html");
      var stored = getStoredVersion();
      var running = getPrivlyVersion();
      var tabs_before = 0;
      chrome.windows.getAll({populate:true},function(win_list){
        for(var i = 0; i < win_list.length; i++){
          chrome.tabs.query({windowId:parseInt(win_list[i].id,10),url:page},function(tab){
            tabs_before+= tab.length;
          });
          waits(500);
          if (i === win_list.length-1 && stored === running){
            run_firstrun();
            var tabs_after = 0;
            chrome.windows.getAll({populate:true},function(wind_list){
              for (var i = 0; i < wind_list.length; i++){
                chrome.tabs.query({windowId:parseInt(wind_list[i].id,10),url:page},function(tab){
                  tabs_after += tab.length;
                });
                waits(500);
                if (i === wind_list.length-1){
                  expect(tabs_after).toEqual(tabs_before);
                }
              }
            });
          }
        }
      });
    });

    /*
     * Test the function that launches the first_run.html page when new
     */
    it("should open firstrun html when new", function() {
      var page = chrome.extension.getURL("pages/first_run.html");
      var stored = getStoredVersion();
      var running = getPrivlyVersion();
      var tabs_before = 0;
      chrome.windows.getAll({populate:true},function(win_list){
        for(var i = 0; i < win_list.length; i++){
          chrome.tabs.query({windowId:parseInt(win_list[i].id,10),url:page},function(tab){
            tabs_before+= tab.length;
          });
          waits(500);
          if (i === win_list.length-1){
            update_version(null);
            run_firstrun();
            update_version(stored);
            var tabs_after = 0;
            chrome.windows.getAll({populate:true},function(wind_list){
              for (var i = 0; i < wind_list.length; i++){
                chrome.tabs.query({windowId:parseInt(wind_list[i].id,10),url:page},function(tab){
                  tabs_after += tab.length;
                });
                waits(500);
                if (i === wind_list.length-1){
                  expect(tabs_after).toEqual(tabs_before+1);
                }
              }
            });
          }
        }
      });
    });

    /*
     * Test the function that launches the first_run.html page when updated
     */
    it("should open firstrun html when updated", function() {
      var page = chrome.extension.getURL("pages/first_run.html");
      var stored = getStoredVersion();
      var running = getPrivlyVersion();
      var tabs_before = 0;
      chrome.windows.getAll({populate:true},function(win_list){
        for(var i = 0; i < win_list.length; i++){
          chrome.tabs.query({windowId:parseInt(win_list[i].id,10),url:page},function(tab){
            tabs_before+= tab.length;
          });
          waits(500);
          if (i === win_list.length-1){
            //modify version in local storage
            update_version(stored+"99");
            run_firstrun();
            //reset version to original
            update_version(stored);
            var tabs_after = 0;
            chrome.windows.getAll({populate:true},function(wind_list){
              for (var i = 0; i < wind_list.length; i++){
                chrome.tabs.query({windowId:parseInt(wind_list[i].id,10),url:page},function(tab){
                  tabs_after += tab.length;
                });
                waits(500);
                if (i === wind_list.length-1){
                  expect(tabs_after).toEqual(tabs_before+1);
                }
              }
            });
          }
        }
      });
    });
});

(function() {
  jasmine.getEnv().addReporter(new jasmine.ConsoleReporter());
  var jasmineEnv = jasmine.getEnv();
  jasmineEnv.updateInterval = 1000;

  var htmlReporter = new jasmine.HtmlReporter();

  //jasmineEnv.addReporter(htmlReporter);

  jasmineEnv.specFilter = function(spec) {
    return htmlReporter.specFilter(spec);
  };

  var currentWindowOnload = window.onload;

  window.onload = function() {
    if (currentWindowOnload) {
      currentWindowOnload();
    }
    execJasmine();
  };

  function execJasmine() {
    jasmineEnv.execute();
  }
})();
<|endoftext|>


<commit_before>module.exports = function(grunt){
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    connect: {
      options: {
        port: 9000,
        hostname: '127.0.0.1',
        livereload: 35729
      },

      server: {
        options: {
          open: true,
          index: 'index.html',
          maxAge: 300000
        }
      }
    },

    uglify: {
	  	options: {
	  		stripBanners: true,
	  		banner: '/*! <%=pkg.name%>-<%=pkg.version%>.js <%= grunt.template.today("yyyy-mm-dd") %> */\n'
	  	},
	  	build: {
	  		src: 'js/test.js',
	  		dest: 'build/<%=pkg.name%>-<%=pkg.version%>.min.js'
	  	}
	},

	jshint: {
		build: [ 'gruntfile.js' , 'js/*.js' ],
		options: {
			jshintrc: '.jshintrc'
		}
	},

	less: {
    	options: {
            compress: false,
            yuicompress: false,
            ieCompat:true,
        },
	    files: {
	    	"css/style.css": "css/style.less"
	    }

    },

	watch: {
		// build: {
		// 	files: ['css/*.css','js/*.js'],
		// 	tasks: ['jshint','uglify'],
		// 	options:{spawn:false}
		// },
		livereload: {
	        options: {
	          livereload: '<%=connect.options.livereload%>'  //监听前面声明的端口  35729
	        },

	        files: [  //下面文件的改变就会实时刷新网页
	          '*.html',
	          'css/{,*/}*.css',
	          'js/{,*/}*.js',
	          'template/*.html',
	          'simplePage/*.html'
	        ]
	    }
	}
  });

  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-contrib-less');

  grunt.registerTask('lessc',['less']);
  grunt.registerTask('default',['jshint','watch']);
  grunt.registerTask('serve',['connect:server','watch']);

};<commit_msg>update<commit_after>module.exports = function(grunt){
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    connect: {
      options: {
        port: 9000,
        hostname: 'localhost',
        livereload: 35729
      },

      server: {
        options: {
          open: true,
          index: 'index.html',
          maxAge: 300000
        }
      }
    },

    uglify: {
	  	options: {
	  		stripBanners: true,
	  		banner: '/*! <%=pkg.name%>-<%=pkg.version%>.js <%= grunt.template.today("yyyy-mm-dd") %> */\n'
	  	},
	  	build: {
	  		src: 'js/test.js',
	  		dest: 'build/<%=pkg.name%>-<%=pkg.version%>.min.js'
	  	}
	},

	jshint: {
		build: [ 'gruntfile.js' , 'js/*.js' ],
		options: {
			jshintrc: '.jshintrc'
		}
	},

	less: {
    	options: {
            compress: false,
            yuicompress: false,
            ieCompat:true,
        },
	    files: {
	    	"css/style.css": "css/style.less"
	    }

    },

	watch: {
		// build: {
		// 	files: ['css/*.css','js/*.js'],
		// 	tasks: ['jshint','uglify'],
		// 	options:{spawn:false}
		// },
		livereload: {
	        options: {
	          livereload: '<%=connect.options.livereload%>'  //监听前面声明的端口  35729
	        },

	        files: [  //下面文件的改变就会实时刷新网页
	          '*.html',
	          'css/{,*/}*.css',
	          'js/{,*/}*.js',
	          'template/*.html',
	          'simplePage/*.html',
	          'simplePage/*.css'
	        ]
	    }
	}
  });

  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-contrib-less');

  grunt.registerTask('lessc',['less']);
  grunt.registerTask('default',['jshint','watch']);
  grunt.registerTask('serve',['connect:server','watch']);

};<|endoftext|>


<commit_before>'use strict';

import path from 'path';
import Logger from '../services/logger';
import InstallableItem from './installable-item';
import Platform from '../services/platform';
import Installer from './helpers/installer';
import globby from 'globby';
import fs from 'fs-extra';
import pify from 'pify';
import os from 'os';
import Util from './helpers/util';

class CDKInstall extends InstallableItem {
  constructor(installerDataSvc, targetFolderName, downloadUrl, fileName, sha256sum) {
    super(CDKInstall.KEY, downloadUrl, fileName, targetFolderName, installerDataSvc, true);
    this.sha256 = sha256sum;
    this.addOption('install', this.version, '', true);
  }

  static get KEY() {
    return 'cdk';
  }

  get minishiftExe() {
    return path.join(this.ocDir(), Platform.OS === 'win32' ? 'minishift.exe' : 'minishift');
  }

  ocDir() {
    return path.join(this.getTargetLocation(), 'bin');
  }

  installAfterRequirements(progress, success, failure) {
    progress.setStatus('Installing');
    let installer = new Installer(this.keyName, progress, success, failure);
    let ocExe;
    let ocExePattern = Platform.OS === 'win32' ? '/**/oc.exe' : '/**/oc';
    let home;
    let driverName = 'virtualbox';
    return Promise.resolve().then(()=> {
      if(this.downloadedFile.endsWith('.exe') || path.parse(this.downloadedFile).ext == '') {
        return installer.copyFile(this.downloadedFile, this.minishiftExe);
      }
      return Promise.reject('Cannot process downloaded cdk distribution');
    }).then(()=> {
      return Platform.makeFileExecutable(this.minishiftExe);
    }).then(()=> {
      let hv = this.installerDataSvc.getInstallable('hyperv');
      let xh = this.installerDataSvc.getInstallable('xhyve');
      if (hv && hv.hasOption('detected')) {
        driverName = 'hyperv';
        return Platform.getHypervAdminsGroupName().then((group)=>{
          installer.exec(
            `net localgroup "${group}" "%USERDOMAIN%\\%USERNAME%" /add`
          ).catch(()=>{});
        }).then(() => {
          return Util.writeFile(path.join(os.tmpdir(), 'rd-devsuite-vswitch.ps1'), this.createHypervSwitch());
        }).then(() => {
          return installer.exec(`powershell -ExecutionPolicy Bypass -File ${path.join(os.tmpdir(), 'rd-devsuite-vswitch.ps1')}`);
        });
      } else if (xh && xh.hasOption('detected')) {
        driverName = 'xhyve';
      }
    }).then(()=> {
      return installer.exec(
        'minishift stop', {env: this.createEnvironment()}
      ).catch(()=>{});
    }).then(()=> {
      return installer.exec(`minishift setup-cdk --force --default-vm-driver=${driverName}`, {env:this.createEnvironment()});
    }).then(()=> {
      return Platform.getUserHomePath();
    }).then((result)=> {
      home = Platform.ENV.MINISHIFT_HOME ? Platform.ENV.MINISHIFT_HOME : path.join(result, '.minishift');
      return globby(ocExePattern, {root: path.join(home, 'cache', 'oc')});
    }).then((files)=> {
      ocExe = files[0].replace(/\//g, path.sep);
    }).then(()=> {
      return Platform.makeFileExecutable(ocExe);
    }).then(()=> {
      return Platform.addToUserPath([this.minishiftExe]);
    }).then(() => {
      return Platform.addToUserPath([ocExe], 'User');
    }).then(()=> {
      return pify(fs.appendFile)(
        path.join(home, 'cdk'),
        `rhel.subscription.username=${this.installerDataSvc.username}`);
    }).then(()=> {
      installer.succeed(true);
    }).catch((error)=> {
      installer.fail(error);
    });
  }

  createEnvironment() {
    let vboxInstall = this.installerDataSvc.getInstallable('virtualbox');
    let cygwinInstall = this.installerDataSvc.getInstallable('cygwin');
    let env = Object.assign({}, Platform.ENV);
    let newPath = [];
    let oldPath = Platform.ENV[Platform.PATH];

    if(cygwinInstall) {
      newPath.push(cygwinInstall.getLocation());
    }

    newPath.push(this.ocDir());

    if(vboxInstall) {
      newPath.push(vboxInstall.getLocation());
    }

    if(oldPath.trim()) {
      newPath.push(oldPath);
    }

    env[Platform.PATH] = newPath.join(path.delimiter);
    Logger.info(this.keyName + ' - Set PATH environment variable to \'' + env[Platform.PATH] + '\'');
    return env;
  }

  isConfigurationValid() {
    let cygwin = this.installerDataSvc.getInstallable('cygwin');
    return this.isConfigured()
      && this.virtualizationIsConfigured()
      && (!cygwin || cygwin.isConfigured())
      || this.isSkipped();
  }

  virtualizationIsConfigured() {
    let virtualbox = this.installerDataSvc.getInstallable('virtualbox');
    let hyperv = this.installerDataSvc.getInstallable('hyperv');
    let xhyve = this.installerDataSvc.getInstallable('xhyve');
    return virtualbox && virtualbox.isConfigured()
      || (hyperv && hyperv.isConfigured() || this.selectedOption !== 'install')
      || (xhyve && xhyve.isConfigured() || this.selectedOption !== 'install');
  }

  createHypervSwitch() {
    let commands = [
      '$ErrorActionPreference = "Stop"',
      '$switchName = if ($env:HYPERV_VIRTUAL_SWITCH) {$env:HYPERV_VIRTUAL_SWITCH} else {"minishift-switch"}',
      'try { Get-VMSwitch -Name $switchName }',
      'catch { $adapterName;',
      '[array]$adapters = Get-NetAdapter -Physical | Where-Object { $_.status -eq "up" }',
      'foreach ($adapter in $adapters) {',
      '$adapterName = $adapter.Name',
      'if ($adapterName -like "ethernet*") { break } }',
      'New-VMSwitch -Name $switchName -NetAdapterName $adapterName',
      '[Environment]::SetEnvironmentVariable("HYPERV_VIRTUAL_SWITCH", $switchName, "User") }'
    ];
    return commands.join('\n');
  }
}

function fromJson({installerDataSvc, targetFolderName, downloadUrl, fileName, sha256sum}) {
  return new CDKInstall(installerDataSvc, targetFolderName, downloadUrl, fileName, sha256sum);
}

CDKInstall.convertor = {fromJson};

export default CDKInstall;
<commit_msg>When switch config fails log infor message and continue<commit_after>'use strict';

import path from 'path';
import Logger from '../services/logger';
import InstallableItem from './installable-item';
import Platform from '../services/platform';
import Installer from './helpers/installer';
import globby from 'globby';
import fs from 'fs-extra';
import pify from 'pify';
import os from 'os';
import Util from './helpers/util';

class CDKInstall extends InstallableItem {
  constructor(installerDataSvc, targetFolderName, downloadUrl, fileName, sha256sum) {
    super(CDKInstall.KEY, downloadUrl, fileName, targetFolderName, installerDataSvc, true);
    this.sha256 = sha256sum;
    this.addOption('install', this.version, '', true);
  }

  static get KEY() {
    return 'cdk';
  }

  get minishiftExe() {
    return path.join(this.ocDir(), Platform.OS === 'win32' ? 'minishift.exe' : 'minishift');
  }

  ocDir() {
    return path.join(this.getTargetLocation(), 'bin');
  }

  installAfterRequirements(progress, success, failure) {
    progress.setStatus('Installing');
    let installer = new Installer(this.keyName, progress, success, failure);
    let ocExe;
    let ocExePattern = Platform.OS === 'win32' ? '/**/oc.exe' : '/**/oc';
    let home;
    let driverName = 'virtualbox';
    return Promise.resolve().then(()=> {
      if(this.downloadedFile.endsWith('.exe') || path.parse(this.downloadedFile).ext == '') {
        return installer.copyFile(this.downloadedFile, this.minishiftExe);
      }
      return Promise.reject('Cannot process downloaded cdk distribution');
    }).then(()=> {
      return Platform.makeFileExecutable(this.minishiftExe);
    }).then(()=> {
      let hv = this.installerDataSvc.getInstallable('hyperv');
      let xh = this.installerDataSvc.getInstallable('xhyve');
      if (hv && hv.hasOption('detected')) {
        driverName = 'hyperv';
        return Platform.getHypervAdminsGroupName().then((group)=>{
          installer.exec(
            `net localgroup "${group}" "%USERDOMAIN%\\%USERNAME%" /add`
          ).catch(()=>{});
        }).then(() => {
          return Util.writeFile(path.join(os.tmpdir(), 'rd-devsuite-vswitch.ps1'), this.createHypervSwitch());
        }).then(() => {
          return installer.exec(`powershell -ExecutionPolicy Bypass -File ${path.join(os.tmpdir(), 'rd-devsuite-vswitch.ps1')}`);
        }).catch(() => {
          Logger.info(this.keyName + ' - Could not configure HYPERV_VIRTUAL_SWITCH env variable, please do it manually before starting minishift');
        });
      } else if (xh && xh.hasOption('detected')) {
        driverName = 'xhyve';
      }
    }).then(()=> {
      return installer.exec(
        'minishift stop', {env: this.createEnvironment()}
      ).catch(()=>{});
    }).then(()=> {
      return installer.exec(`minishift setup-cdk --force --default-vm-driver=${driverName}`, {env:this.createEnvironment()});
    }).then(()=> {
      return Platform.getUserHomePath();
    }).then((result)=> {
      home = Platform.ENV.MINISHIFT_HOME ? Platform.ENV.MINISHIFT_HOME : path.join(result, '.minishift');
      return globby(ocExePattern, {root: path.join(home, 'cache', 'oc')});
    }).then((files)=> {
      ocExe = files[0].replace(/\//g, path.sep);
    }).then(()=> {
      return Platform.makeFileExecutable(ocExe);
    }).then(()=> {
      return Platform.addToUserPath([this.minishiftExe]);
    }).then(() => {
      return Platform.addToUserPath([ocExe], 'User');
    }).then(()=> {
      return pify(fs.appendFile)(
        path.join(home, 'cdk'),
        `rhel.subscription.username=${this.installerDataSvc.username}`);
    }).then(()=> {
      installer.succeed(true);
    }).catch((error)=> {
      installer.fail(error);
    });
  }

  createEnvironment() {
    let vboxInstall = this.installerDataSvc.getInstallable('virtualbox');
    let cygwinInstall = this.installerDataSvc.getInstallable('cygwin');
    let env = Object.assign({}, Platform.ENV);
    let newPath = [];
    let oldPath = Platform.ENV[Platform.PATH];

    if(cygwinInstall) {
      newPath.push(cygwinInstall.getLocation());
    }

    newPath.push(this.ocDir());

    if(vboxInstall) {
      newPath.push(vboxInstall.getLocation());
    }

    if(oldPath.trim()) {
      newPath.push(oldPath);
    }

    env[Platform.PATH] = newPath.join(path.delimiter);
    Logger.info(this.keyName + ' - Set PATH environment variable to \'' + env[Platform.PATH] + '\'');
    return env;
  }

  isConfigurationValid() {
    let cygwin = this.installerDataSvc.getInstallable('cygwin');
    return this.isConfigured()
      && this.virtualizationIsConfigured()
      && (!cygwin || cygwin.isConfigured())
      || this.isSkipped();
  }

  virtualizationIsConfigured() {
    let virtualbox = this.installerDataSvc.getInstallable('virtualbox');
    let hyperv = this.installerDataSvc.getInstallable('hyperv');
    let xhyve = this.installerDataSvc.getInstallable('xhyve');
    return virtualbox && virtualbox.isConfigured()
      || (hyperv && hyperv.isConfigured() || this.selectedOption !== 'install')
      || (xhyve && xhyve.isConfigured() || this.selectedOption !== 'install');
  }

  createHypervSwitch() {
    let commands = [
      '$ErrorActionPreference = "Stop"',
      '$switchName = if ($env:HYPERV_VIRTUAL_SWITCH) {$env:HYPERV_VIRTUAL_SWITCH} else {"minishift-switch"}',
      'try { Get-VMSwitch -Name $switchName }',
      'catch { $adapterName;',
      '[array]$adapters = Get-NetAdapter -Physical | Where-Object { $_.status -eq "up" }',
      'foreach ($adapter in $adapters) {',
      '$adapterName = $adapter.Name',
      'if ($adapterName -like "ethernet*") { break } }',
      'New-VMSwitch -Name $switchName -NetAdapterName $adapterName',
      '[Environment]::SetEnvironmentVariable("HYPERV_VIRTUAL_SWITCH", $switchName, "User") }'
    ];
    return commands.join('\n');
  }
}

function fromJson({installerDataSvc, targetFolderName, downloadUrl, fileName, sha256sum}) {
  return new CDKInstall(installerDataSvc, targetFolderName, downloadUrl, fileName, sha256sum);
}

CDKInstall.convertor = {fromJson};

export default CDKInstall;
<|endoftext|>


<commit_before>module.exports = function(grunt) {

  'use strict';

  require('time-grunt')(grunt);
  require('load-grunt-tasks')(grunt);

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    // CONFIGURABLE PATHS
    config: {
      source: 'source',
      dest: 'build'
    },

    // GENERAL TASKS

    jekyll: {
      options: {
        bundleExec: true,
        config: '_config.yml,_config_prod.yml'
      },
      dev: {
        options: {
          config: '_config.yml',
          src: '<%= config.source %>',
          dest: '<%= config.dest %>'
        }
      },
      prod: {
        options: {
          src: '<%= config.source %>',
          dest: '<%= config.dest %>'
        }
      },
      check: {
        options: {
          doctor: true
        }
      }
    },

    browserSync: {
      dev: {
        bsFiles: {
          src : [
            '<%= config.dest %>/*.html',
            '<%= config.dest %>/css/*.css',
            '<%= config.dest %>/js/*.js',
            '<%= config.source %>/img/**/*.{jpg,png,svg,gif}'
          ]
        },
        options: {
          watchTask: true,
          server: {
            baseDir: '<%= config.dest %>'
          }
        }
      }
    },

    watch: {
      sass: {
        files: '<%= config.source %>/_scss/**/*.scss',
        tasks: ['sass', 'postcss:dev', 'penthouse']
      },
      jekyll: {
        files: ['Gruntfile.js', '<%= config.source %>/**/*.{html,md,js}'],
        tasks: ['jekyll:dev']
      }
    },

    copy: {
      OptimizedWebfontLoading: {
        files: {
          '<%= config.source %>/_includes/fontloader.js': 'bower_components/OptimizedWebfontLoading/build/fontloader.js'
        }
      },
      loadCSS: {
        files: {
          '<%= config.source %>/_includes/loadCSS.js': 'bower_components/loadcss/loadCSS.js'
        }
      },
      jQuery: {
        files: {
          '<%= config.source %>/js/vendor/jquery.js': 'bower_components/jquery/dist/jquery.js'
        }
      },
      normalize: {
        files: {
          '<%= config.source %>/_scss/vendor/_normalize.scss': 'bower_components/normalize.css/normalize.css'
        }
      },
    },

    // USEMIN SECTION

    useminPrepare: {
      options: {
        dest: '<%= config.dest %>',
        // staging: '<%= config.source %>/_tmp'
      },
      html: '<%= config.dest %>/index.html'
    },

    usemin: {
      options: {
        assetsDirs: '<%= config.dest %>',
        /* async / defer for generated JS - https://github.com/yeoman/grunt-usemin/issues/391
        blockReplacements: {
          js: function (block){
            return '<script async src='' + block.dest + '' defer=defer><\/script>';
          }
        } */
      },
      html: ['<%= config.dest %>/**/*.html'],
      // css: ['<%= config.dest %>/css/**/*.css'],
    },

    concat: { },

    uglify: { },

    // STYLESHEET SECTION

    sass: {
      options: {
        // includePaths: ['some/other/path']
      },
      dist: {
        files: {
          '.tmp/css/style.css': '<%= config.source %>/_scss/style.scss'
        }
      }
    },

    postcss: {
      options: {
        map: false,
        processors: [
          require('autoprefixer-core')({browsers: 'last 2 versions, > 2%, ie >= 8, Firefox ESR, Opera 12.1'}),
          require('css-mqpacker')()
        ]
      },
      dev: {
        src: '.tmp/css/style.css',
        dest: '<%= config.dest %>/css/style.css'
      },
      prod: {
        src: '.tmp/concat/css/style.css'
      }
    },

    csscomb: {
      dist: {
        files: {
          '.tmp/concat/css/style.css': '.tmp/concat/css/style.css'
        }
      }
    },

    cssmin: {
      options: {
        shorthandCompacting: false,
        roundingPrecision: -1,
        // compatibility: 'ie8'
      }
    },

    penthouse: {
      dist: {
        outfile : '<%= config.source %>/_includes/critical.css',
        css : '.tmp/css/style.css',
        url : 'http://localhost:3000',
        width : 1280,
        height : 800
      }
    },

    // JAVASCRIPT SECTION

    modernizr: {
      dist: {
        'devFile' : 'bower_components/modernizr/modernizr.js',
        'outputFile' : '<%= config.dest %>/js/modernizr-custom.js',
        'uglify' : true,
        'parseFiles' : false,
        files: {
          src: [
            '<%= config.dest %>/js/**/*.js',
            '<%= config.dest %>/css/style.css',
            '<%= config.dest %>/*.html'
          ]
        }
      }
    },

    // HTML SECTION

    htmlmin: {
      dist: {
        options: {
          removeComments: true,
          collapseWhitespace: true,
          removeRedundantAttributes: true,
          keepClosingSlash: true,
          minifyCSS: true,
          minifyJS: true
        },
        files: [{
          expand: true,
          cwd: '<%= config.dest %>',
          src: '**/*.html',
          dest: '<%= config.dest %>'
        }]
      }
    },

    cacheBust: {
      options: {
        encoding: 'utf8',
        algorithm: 'md5',
        length: 8,
        deleteOriginals: true,
        // ignorePatterns: ['.png', '.jpg', '.ico'],
        baseDir: '<%= config.dest %>'
      },
      assets: {
        files: [{
            src: ['<%= config.dest %>/**/*.html']
        }]
      }
    },

    // CODE QUALITY SECTION

    scsslint: {
      options: {
        bundleExec: true,
        colorizeOutput: true,
        config: '.scss-lint.yml',
      },
      check: '<%= config.source %>/_scss/*.scss'
    },

    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      check: ['Gruntfile.js', '<%= config.source %>/js/*.js'],
    },

    devUpdate: {
      check: {
        options: {
          reportUpdated: false,
          updateType: 'prompt'
        }
      }
    }

  });

    grunt.registerTask('dev', [
      'sass',
      'jekyll:dev',
      'postcss:dev',
      'browserSync',
    	'watch'
    ]);

    grunt.registerTask('prod', [
      'sass',
      'jekyll:prod',
      'modernizr',
      'useminPrepare',
      'concat',
      'postcss:prod',
      'csscomb',
      'cssmin',
      'uglify',
      'usemin',
      'cacheBust',
      'htmlmin'
    ]);

    grunt.registerTask('check', [
      'devUpdate',
      'jekyll:check',
      'scsslint',
      'jshint'
    ]);

  };
<commit_msg>Updated cacheBust task which was deprecated<commit_after>module.exports = function(grunt) {

  'use strict';

  require('time-grunt')(grunt);
  require('load-grunt-tasks')(grunt);

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    // CONFIGURABLE PATHS
    config: {
      source: 'source',
      dest: 'build'
    },

    // GENERAL TASKS

    jekyll: {
      options: {
        bundleExec: true,
        config: '_config.yml,_config_prod.yml'
      },
      dev: {
        options: {
          config: '_config.yml',
          src: '<%= config.source %>',
          dest: '<%= config.dest %>'
        }
      },
      prod: {
        options: {
          src: '<%= config.source %>',
          dest: '<%= config.dest %>'
        }
      },
      check: {
        options: {
          doctor: true
        }
      }
    },

    browserSync: {
      dev: {
        bsFiles: {
          src : [
            '<%= config.dest %>/*.html',
            '<%= config.dest %>/css/*.css',
            '<%= config.dest %>/js/*.js',
            '<%= config.source %>/img/**/*.{jpg,png,svg,gif}'
          ]
        },
        options: {
          watchTask: true,
          server: {
            baseDir: '<%= config.dest %>'
          }
        }
      }
    },

    watch: {
      sass: {
        files: '<%= config.source %>/_scss/**/*.scss',
        tasks: ['sass', 'postcss:dev', 'penthouse']
      },
      jekyll: {
        files: ['Gruntfile.js', '<%= config.source %>/**/*.{html,md,js}'],
        tasks: ['jekyll:dev']
      }
    },

    copy: {
      OptimizedWebfontLoading: {
        files: {
          '<%= config.source %>/_includes/fontloader.js': 'bower_components/OptimizedWebfontLoading/build/fontloader.js'
        }
      },
      loadCSS: {
        files: {
          '<%= config.source %>/_includes/loadCSS.js': 'bower_components/loadcss/loadCSS.js'
        }
      },
      jQuery: {
        files: {
          '<%= config.source %>/js/vendor/jquery.js': 'bower_components/jquery/dist/jquery.js'
        }
      },
      normalize: {
        files: {
          '<%= config.source %>/_scss/vendor/_normalize.scss': 'bower_components/normalize.css/normalize.css'
        }
      },
    },

    // USEMIN SECTION

    useminPrepare: {
      options: {
        dest: '<%= config.dest %>',
        // staging: '<%= config.source %>/_tmp'
      },
      html: '<%= config.dest %>/index.html'
    },

    usemin: {
      options: {
        assetsDirs: '<%= config.dest %>',
        /* async / defer for generated JS - https://github.com/yeoman/grunt-usemin/issues/391
        blockReplacements: {
          js: function (block){
            return '<script async src='' + block.dest + '' defer=defer><\/script>';
          }
        } */
      },
      html: ['<%= config.dest %>/**/*.html'],
      // css: ['<%= config.dest %>/css/**/*.css'],
    },

    concat: { },

    uglify: { },

    // STYLESHEET SECTION

    sass: {
      options: {
        // includePaths: ['some/other/path']
      },
      dist: {
        files: {
          '.tmp/css/style.css': '<%= config.source %>/_scss/style.scss'
        }
      }
    },

    postcss: {
      options: {
        map: false,
        processors: [
          require('autoprefixer')({browsers: 'last 2 versions, > 2%, ie >= 8, Firefox ESR, Opera 12.1'}),
          require('css-mqpacker')()
        ]
      },
      dev: {
        src: '.tmp/css/style.css',
        dest: '<%= config.dest %>/css/style.css'
      },
      prod: {
        src: '.tmp/concat/css/style.css'
      }
    },

    csscomb: {
      dist: {
        files: {
          '.tmp/concat/css/style.css': '.tmp/concat/css/style.css'
        }
      }
    },

    cssmin: {
      options: {
        shorthandCompacting: false,
        roundingPrecision: -1,
        // compatibility: 'ie8'
      }
    },

    penthouse: {
      dist: {
        outfile : '<%= config.source %>/_includes/critical.css',
        css : '.tmp/css/style.css',
        url : 'http://localhost:3000',
        width : 1280,
        height : 800
      }
    },

    // JAVASCRIPT SECTION

    modernizr: {
      dist: {
        'devFile' : 'bower_components/modernizr/modernizr.js',
        'outputFile' : '<%= config.dest %>/js/modernizr-custom.js',
        'uglify' : true,
        'parseFiles' : false,
        files: {
          src: [
            '<%= config.dest %>/js/**/*.js',
            '<%= config.dest %>/css/style.css',
            '<%= config.dest %>/*.html'
          ]
        }
      }
    },

    // HTML SECTION

    htmlmin: {
      dist: {
        options: {
          removeComments: true,
          collapseWhitespace: true,
          removeRedundantAttributes: true,
          keepClosingSlash: true,
          minifyCSS: true,
          minifyJS: true
        },
        files: [{
          expand: true,
          cwd: '<%= config.dest %>',
          src: '**/*.html',
          dest: '<%= config.dest %>'
        }]
      }
    },

    cacheBust: {
      assets: {
        options: {
          length: 8,
          deleteOriginals: true,
          // ignorePatterns: ['.png', '.jpg', '.ico'],
          baseDir: '<%= config.dest %>',
          assets: ['css/*', 'js/*']
        },
        src: ['<%= config.dest %>/**/*.html']
      }
    },

    // CODE QUALITY SECTION

    scsslint: {
      options: {
        bundleExec: true,
        colorizeOutput: true,
        config: '.scss-lint.yml',
      },
      check: '<%= config.source %>/_scss/*.scss'
    },

    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      check: ['Gruntfile.js', '<%= config.source %>/js/*.js'],
    },

    devUpdate: {
      check: {
        options: {
          reportUpdated: false,
          updateType: 'prompt'
        }
      }
    }

  });

    grunt.registerTask('dev', [
      'sass',
      'jekyll:dev',
      'postcss:dev',
      'browserSync',
    	'watch'
    ]);

    grunt.registerTask('prod', [
      'sass',
      'jekyll:prod',
      'modernizr',
      'useminPrepare',
      'concat',
      'postcss:prod',
      'csscomb',
      'cssmin',
      'uglify',
      'usemin',
      'cacheBust',
      'htmlmin'
    ]);

    grunt.registerTask('check', [
      'devUpdate',
      'jekyll:check',
      'scsslint',
      'jshint'
    ]);

  };
<|endoftext|>


<commit_before>'use strict';

var npmDest = 'dist';
var entryJS = 'src/js/app.js';

module.exports = function (grunt) {
  // Project configuration
  grunt.initConfig({

    pkg: grunt.file.readJSON('package.json'),

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            'dist/*',
            '!dist/.git*'
          ]
        }]
      },
      dev: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            'index.html',
            'landing.html',
            'fittable.js',
            'fittable.css',
            './img/'
          ]
        }]
      }
    },

    // Compiles Sass to CSS and generates necessary files if requested
    compass: {
      dev: {
        options: {
          sassDir: 'src/scss',
          cssDir: './',
          noLineComments: true
        }
      },
      dist: {
        options: {
          sassDir: 'src/scss',
          cssDir: 'dist/',
          noLineComments: true,
          outputStyle: 'compressed'
        }
      }
    },

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      compass: {
        files: ['src/scss/**/*.scss'],
        tasks: ['compass:dev', 'autoprefixer:dev']
      },
      browserify: {
        files: ['src/js/**/*.js'],
        tasks: ['browserify:dev']
      },
      copy: {
        files: ['src/*.html'],
        tasks: ['copy:dev']
      }
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 2 version', 'ie >= 8', 'Android 3'] // add Android 3 for Android 4.3- gradients
      },
      dev: {
        files: [{
          src: '*.css'
        }]
      },
      dist: {
        files: [{
          src: 'dist/*.css'
        }]
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '.',
          dest: 'dist',
          flatten: true,
          src: [
            'src/*.html'
          ]
        }]
      },
      distImgs: {
        files: [{
          expand: true,
          dot: true,
          cwd: '.',
          dest: 'dist/img',
          flatten: true,
          src: [
            'src/img/*'
          ]
        }]
      },
      npm: {
        files: [{
          expand: true,
          dest: npmDest,
          cwd: './src',
          src: [
            'lang/*'
          ]
        }]
      },
      dev: {
        files: [{
          expand: true,
          dot: true,
          cwd: '.',
          dest: './',
          flatten: true,
          src: [
            'src/index.html',
            'src/landing.html',
          ]
        }]
      },
      devImgs: {
        files: [{
          expand: true,
          dot: true,
          cwd: '.',
          dest: './img/',
          flatten: true,
          src: [
            'src/img/*'
          ]
        }]
      }
    },

    // Browserify
    browserify: {
      options: {
        transform: [ 'babelify' ],
        browserifyOptions: {
          debug: true,
          standalone: 'fittable'
        }
      },
      dev: {
        files: {
          './fittable.js': entryJS
        }
      },
      dist: {
        files: {
          'dist/fittable.js': entryJS
        }
      },
      min: {
        options: {
          transform: [ 'babelify' ],
          plugin: [ 'minifyify' ]
        },
        files: {
          'dist/fittable.min.js': entryJS
        }
      }
    },

    // Babel: Used for npm prepublishing, otherwise see browserify
    babel: {
      options: {
        sourceMap: false
      },
      npm: {
        files: [{
            expand: true,
            cwd: 'src/js',
            src: ['**/*.js'],
            dest: npmDest + '/js'
        }]
      }
    },

    // Uglify
    uglify: {
      dist: {
        files: {
          'dist/fittable.min.js': [ 'dist/react.js', 'dist/browser-polyfill.js', 'dist/fittable.js' ]
        }
      }
    }

  });

  // Load grunt tasks automatically
  require('load-grunt-tasks')(grunt);

  grunt.registerTask('default', [
    'clean:dev',
    'compass:dev',
    'autoprefixer:dev',
    'browserify:dev',
    'copy:dev',
    'copy:devImgs',
    'watch'
  ]);

  grunt.registerTask('build', [
    'clean:dist',
    'compass:dist',
    'autoprefixer:dist',
    'browserify:dist',
    'browserify:min',
    'copy:dist',
    'copy:distImgs'
  ]);

  grunt.registerTask('build:npm', [
    'build',
    'babel:npm',
    'copy:npm'
  ]);
};
<commit_msg>Grunt: simplify copy task<commit_after>'use strict';

var npmDest = 'dist';
var entryJS = 'src/js/app.js';

module.exports = function (grunt) {
  // Project configuration
  grunt.initConfig({

    pkg: grunt.file.readJSON('package.json'),

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            'dist/*',
            '!dist/.git*'
          ]
        }]
      },
      dev: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            'index.html',
            'landing.html',
            'fittable.js',
            'fittable.css',
            './img/'
          ]
        }]
      }
    },

    // Compiles Sass to CSS and generates necessary files if requested
    compass: {
      dev: {
        options: {
          sassDir: 'src/scss',
          cssDir: './',
          noLineComments: true
        }
      },
      dist: {
        options: {
          sassDir: 'src/scss',
          cssDir: 'dist/',
          noLineComments: true,
          outputStyle: 'compressed'
        }
      }
    },

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      compass: {
        files: ['src/scss/**/*.scss'],
        tasks: ['compass:dev', 'autoprefixer:dev']
      },
      browserify: {
        files: ['src/js/**/*.js'],
        tasks: ['browserify:dev']
      },
      copy: {
        files: ['src/*.html'],
        tasks: ['copy:dev']
      }
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 2 version', 'ie >= 8', 'Android 3'] // add Android 3 for Android 4.3- gradients
      },
      dev: {
        files: [{
          src: '*.css'
        }]
      },
      dist: {
        files: [{
          src: 'dist/*.css'
        }]
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          cwd: 'src/',
          dest: buildDest,
          flatten: false,
          src: [
            'index.html',
            'landing.html',
            'img/**',
          ]
        }]
      },
      npm: {
        files: [{
          expand: true,
          dest: npmDest,
          cwd: './src',
          src: [
            'lang/*'
          ]
        }]
      },
      dev: {
        files: [{
          expand: true,
          cwd: 'src/',
          dest: devDest,
          flatten: false,
          src: [
            'index.html',
            'landing.html',
            'img/**',
          ]
        }]
      },
    },

    // Browserify
    browserify: {
      options: {
        transform: [ 'babelify' ],
        browserifyOptions: {
          debug: true,
          standalone: 'fittable'
        }
      },
      dev: {
        files: {
          './fittable.js': entryJS
        }
      },
      dist: {
        files: {
          'dist/fittable.js': entryJS
        }
      },
      min: {
        options: {
          transform: [ 'babelify' ],
          plugin: [ 'minifyify' ]
        },
        files: {
          'dist/fittable.min.js': entryJS
        }
      }
    },

    // Babel: Used for npm prepublishing, otherwise see browserify
    babel: {
      options: {
        sourceMap: false
      },
      npm: {
        files: [{
            expand: true,
            cwd: 'src/js',
            src: ['**/*.js'],
            dest: npmDest + '/js'
        }]
      }
    },

    // Uglify
    uglify: {
      dist: {
        files: {
          'dist/fittable.min.js': [ 'dist/react.js', 'dist/browser-polyfill.js', 'dist/fittable.js' ]
        }
      }
    }

  });

  // Load grunt tasks automatically
  require('load-grunt-tasks')(grunt);

  grunt.registerTask('default', [
    'clean:dev',
    'compass:dev',
    'autoprefixer:dev',
    'browserify:dev',
    'copy:dev',
    'copy:devImgs',
    'watch'
  ]);

  grunt.registerTask('build', [
    'clean:dist',
    'compass:dist',
    'autoprefixer:dist',
    'browserify:dist',
    'browserify:min',
    'copy:dist',
    'copy:distImgs'
  ]);

  grunt.registerTask('build:npm', [
    'build',
    'babel:npm',
    'copy:npm'
  ]);
};
<|endoftext|>


<commit_before>const matchdep = require('matchdep');

const dist = {
  clean: [
    'dist/*',
    '!dist/.gitignore',
  ],
  comments: {
    src: ['dist/hlf-dom-extensions.{js,css}'],
  },
  concat: {
    files: {
      'dist/hlf-dom-extensions.css': ['dist/*.css'],
      'dist/hlf-dom-extensions.js': ['dist/*.js', '!dist/guard.js'],
    },
  },
  copy: {
    expand: true,
    src: [
      'src/**/*.{js,css}',
      '!src/**/field.{js,css}',
    ],
    dest: 'dist/',
    extDot: 'last',
    flatten: true,
  },
  registerTasks(grunt) {
    grunt.registerTask('dist', ['clean:dist', 'copy:dist', 'concat:dist', 'comments:dist']);
    // This task's optimized for speed, at cost of artifacts.
    grunt.registerTask('lazy-dist', ['newer:copy:dist']);
  },
};

const docs = (function() {
  const src = [
    'src/**/*.{js,css}',
    'tests/**/*.{js,css}',
    'docs/README.md',
  ];
  return {
    clean: [
      'docs/*/**',
      '!docs/.gitignore',
      '!docs/README.md',
    ],
    groc: {
      src: src,
      options: {
        index: 'docs/README.md',
        out: 'docs/',
      },
    },
    watch: {
      files: src,
      // Sadly groc needs to run with all the sources to build its ToC.
      tasks: ['docs'],
    },
    registerTasks(grunt) {
      grunt.registerTask('docs', ['clean:docs', 'groc:docs']);
    },
  };
}());

const lib = {
  clean: ['lib/*', '!lib/.gitignore'],
  copy: {
    files: [
      { src: 'node_modules/hlf-css/lib/modified/_normalize.scss', dest: 'lib/normalize.css' },
      { expand: true, flatten: true, src: 'node_modules/qunitjs/qunit/qunit.{css,js}', dest: 'lib/' },
      { src: 'node_modules/requirejs/require.js', dest: 'lib/require.js' },
    ]
  },
  registerTasks(grunt) {
    grunt.registerTask('lib', ['clean:lib', 'copy:lib']);
  },
};

const pages = {
  'gh-pages': {
    options: {
      base: 'gh-pages',
      add: true,
    },
    src: [
      '**',
      '!template.jst.html',
    ],
  },
  clean: [
    'gh-pages/*',
    '!gh-pages/.gitignore',
    '!gh-pages/template.jst.html',
  ],
  copy: {
    nonull: true,
    files: [
      {
        expand: true,
        src: [
          'dist/**/*',
          'docs/**/*',
          'lib/**/*',
          'tests/**/*',
          '!tests/**/*.{css,js}',
          'README.md',
        ],
        dest: 'gh-pages/',
      },
      {
        src: 'node_modules/merlot/template.jst.html',
        dest: 'gh-pages/',
      },
    ],
  },
  markdown: {
    options: {
      markdownOptions: {
        gfm: true,
        highlight: 'auto',
      },
      template: 'gh-pages/template.jst.html',
      templateContext: {
        githubAuthor: 'hlfcoding',
        githubPath: 'hlfcoding/hlf-dom-extensions',
        headline: 'HLF DOM Extensions',
        pageTitle: 'HLF DOM Extensions by hlfcoding',
        subHeadline: 'Custom UI',
      },
    },
    src: 'gh-pages/README.md',
    dest: 'gh-pages/index.html',
  },
  registerTasks(grunt) {
    grunt.registerTask('pages', [
      'dist',
      'docs',
      'clean:gh-pages',
      'copy:gh-pages',
      'markdown:gh-pages',
      'gh-pages:gh-pages',
    ]);
  },
};

const release = {
  bump: {
    options: {
      files: ['package.json'],
      commitFiles: ['.'],
      pushTo: 'origin',
    },
  },
};

module.exports = (grunt) => {
  config = {
    pkg: grunt.file.readJSON('package.json'),
    bump: release.bump,
    clean: {
      dist: dist.clean,
      docs: docs.clean,
      'gh-pages': pages.clean,
      lib: lib.clean,
    },
    comments: {
      dist: dist.comments,
    },
    concat: {
      dist: dist.concat,
    },
    copy: {
      dist: dist.copy,
      'gh-pages': pages.copy,
      lib: lib.copy,
    },
    'gh-pages': {
      'gh-pages': pages['gh-pages'],
    },
    groc: {
      docs: docs.groc,
    },
    markdown: {
      'gh-pages': pages.markdown,
    },
    watch: {},
  };
  if (!grunt.option('fast')) {
    config.watch.docs = docs.watch;
  }
  grunt.initConfig(config);

  matchdep.filterDev('grunt-*').forEach(plugin => grunt.loadNpmTasks(plugin));

  grunt.registerTask('default', ['lazy-dist', 'watch']);
  grunt.registerTask('install', ['lib', 'dist']);

  dist.registerTasks(grunt);
  docs.registerTasks(grunt);
  lib.registerTasks(grunt);
  pages.registerTasks(grunt);
};
<commit_msg>Fix Grunt pages task to be more idempotent.<commit_after>const matchdep = require('matchdep');

const dist = {
  clean: [
    'dist/*',
    '!dist/.gitignore',
  ],
  comments: {
    src: ['dist/hlf-dom-extensions.{js,css}'],
  },
  concat: {
    files: {
      'dist/hlf-dom-extensions.css': ['dist/*.css'],
      'dist/hlf-dom-extensions.js': ['dist/*.js', '!dist/guard.js'],
    },
  },
  copy: {
    expand: true,
    src: [
      'src/**/*.{js,css}',
      '!src/**/field.{js,css}',
    ],
    dest: 'dist/',
    extDot: 'last',
    flatten: true,
  },
  registerTasks(grunt) {
    grunt.registerTask('dist', ['clean:dist', 'copy:dist', 'concat:dist', 'comments:dist']);
    // This task's optimized for speed, at cost of artifacts.
    grunt.registerTask('lazy-dist', ['newer:copy:dist']);
  },
};

const docs = (function() {
  const src = [
    'src/**/*.{js,css}',
    'tests/**/*.{js,css}',
    'docs/README.md',
  ];
  return {
    clean: [
      'docs/*/**',
      '!docs/.gitignore',
      '!docs/README.md',
    ],
    groc: {
      src: src,
      options: {
        index: 'docs/README.md',
        out: 'docs/',
      },
    },
    watch: {
      files: src,
      // Sadly groc needs to run with all the sources to build its ToC.
      tasks: ['docs'],
    },
    registerTasks(grunt) {
      grunt.registerTask('docs', ['clean:docs', 'groc:docs']);
    },
  };
}());

const lib = {
  clean: ['lib/*', '!lib/.gitignore'],
  copy: {
    files: [
      { src: 'node_modules/hlf-css/lib/modified/_normalize.scss', dest: 'lib/normalize.css' },
      { expand: true, flatten: true, src: 'node_modules/qunitjs/qunit/qunit.{css,js}', dest: 'lib/' },
      { src: 'node_modules/requirejs/require.js', dest: 'lib/require.js' },
    ]
  },
  registerTasks(grunt) {
    grunt.registerTask('lib', ['clean:lib', 'copy:lib']);
  },
};

const pages = {
  'gh-pages': {
    options: {
      base: 'gh-pages',
    },
    src: [
      '**',
      '!template.jst.html',
    ],
  },
  clean: [
    'gh-pages/*',
    '!gh-pages/.gitignore',
    '!gh-pages/template.jst.html',
  ],
  copy: {
    nonull: true,
    files: [
      {
        expand: true,
        src: [
          'dist/**/*',
          'docs/**/*',
          'lib/**/*',
          'tests/**/*',
          '!tests/**/*.{css,js}',
          'README.md',
        ],
        dest: 'gh-pages/',
      },
      {
        expand: true,
        cwd: 'node_modules/merlot',
        src: [
          'images/*',
          'stylesheets/*.{css,map}',
          'template.jst.html',
        ],
        dest: 'gh-pages/',
        filter: 'isFile',
      },
    ],
  },
  markdown: {
    options: {
      markdownOptions: {
        gfm: true,
        highlight: 'auto',
      },
      template: 'gh-pages/template.jst.html',
      templateContext: {
        githubAuthor: 'hlfcoding',
        githubPath: 'hlfcoding/hlf-dom-extensions',
        headline: 'HLF DOM Extensions',
        pageTitle: 'HLF DOM Extensions by hlfcoding',
        subHeadline: 'Custom UI',
      },
    },
    src: 'gh-pages/README.md',
    dest: 'gh-pages/index.html',
  },
  registerTasks(grunt) {
    grunt.registerTask('pages', [
      'dist',
      'docs',
      'clean:gh-pages',
      'copy:gh-pages',
      'markdown:gh-pages',
      'gh-pages:gh-pages',
    ]);
  },
};

const release = {
  bump: {
    options: {
      files: ['package.json'],
      commitFiles: ['.'],
      pushTo: 'origin',
    },
  },
};

module.exports = (grunt) => {
  config = {
    pkg: grunt.file.readJSON('package.json'),
    bump: release.bump,
    clean: {
      dist: dist.clean,
      docs: docs.clean,
      'gh-pages': pages.clean,
      lib: lib.clean,
    },
    comments: {
      dist: dist.comments,
    },
    concat: {
      dist: dist.concat,
    },
    copy: {
      dist: dist.copy,
      'gh-pages': pages.copy,
      lib: lib.copy,
    },
    'gh-pages': {
      'gh-pages': pages['gh-pages'],
    },
    groc: {
      docs: docs.groc,
    },
    markdown: {
      'gh-pages': pages.markdown,
    },
    watch: {},
  };
  if (!grunt.option('fast')) {
    config.watch.docs = docs.watch;
  }
  grunt.initConfig(config);

  matchdep.filterDev('grunt-*').forEach(plugin => grunt.loadNpmTasks(plugin));

  grunt.registerTask('default', ['lazy-dist', 'watch']);
  grunt.registerTask('install', ['lib', 'dist']);

  dist.registerTasks(grunt);
  docs.registerTasks(grunt);
  lib.registerTasks(grunt);
  pages.registerTasks(grunt);
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {

    // Grunt Init
    grunt.initConfig({

        // ------------------------------------------------------
        // --
        // --   Meta
        // --
        // ------------------------------------------------------

        pkg: grunt.file.readJSON('package.json'),

        banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
                '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
                '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
                '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
                ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',

        // ------------------------------------------------------
        // --
        // --   Task Config
        // --
        // ------------------------------------------------------

        // Keep shizzle tight
        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },

            // Lint the gruntfile
            gruntfile: {
                src: 'Gruntfile.js'
            },

            // Project linting
            lib: {
                src: [ 'lib/**/*.js' ]
            }
        }

    });

    // ------------------------------------------------------
    // --
    // --   Load and register tasks
    // --
    // ------------------------------------------------------
    grunt.loadNpmTasks('grunt-contrib-jshint');

    // Default task.
    grunt.registerTask('default', 'lint');

};<commit_msg>Fixed up grunt file default task<commit_after>'use strict';

module.exports = function(grunt) {

    // Grunt Init
    grunt.initConfig({

        // ------------------------------------------------------
        // --
        // --   Meta
        // --
        // ------------------------------------------------------

        pkg: grunt.file.readJSON('package.json'),

        banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
                '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
                '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
                '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
                ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',

        // ------------------------------------------------------
        // --
        // --   Task Config
        // --
        // ------------------------------------------------------

        // Keep shizzle tight
        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },

            // Lint the gruntfile
            gruntfile: {
                src: 'Gruntfile.js'
            },

            // Project linting
            lib: {
                src: [ 'lib/**/*.js' ]
            }
        }

    });

    // ------------------------------------------------------
    // --
    // --   Load and register tasks
    // --
    // ------------------------------------------------------
    grunt.loadNpmTasks('grunt-contrib-jshint');

    // Default task.
    grunt.registerTask('default', 'jshint');

};<|endoftext|>


<commit_before>/*!
 * Prototype Gruntfile
 * @author Azin Asili
 */

'use strict';

/**
 * Livereload and connect variables
 */
var LIVERELOAD_PORT = 35729;
var lrSnippet = require('connect-livereload')({
  port: LIVERELOAD_PORT
});
var mountFolder = function (connect, dir) {
  return connect.static(require('path').resolve(dir));
};

/**
 * Grunt module
 */
module.exports = function (grunt) {

  /**
   * Dynamically load npm tasks
   */
  require('load-grunt-tasks')(grunt);

  /**
   * Grunt config
   */
  grunt.initConfig({

    pkg: grunt.file.readJSON('package.json'),

    /**
     * Set project info
     */
    project: {
      src   : 'src',
      app   : 'app',
      appjs : '<%= project.app %>/js/scripts.min.js',
      srcjs : '<%= project.src %>/js/scripts.js',
      css   : '<%= project.app %>/css/styles.min.css',
      scss  : '<%= project.src %>/scss/styles.scss'
    },

    /**
     * Concatenate JavaScript files
     * https://github.com/gruntjs/grunt-contrib-concat
     * Imports all .js files and appends project banner
     */
    concat: {
      dev: {
        files: {
          '<%= project.appjs %>' : '<%= project.srcjs %>'
        }
      }
    },

    /**
     * Compile Sass/SCSS files
     * https://github.com/gruntjs/grunt-contrib-sass
     * Compiles all Sass/SCSS files and appends project banner
     */
    sass: {
      dev: {
        files: {
          '<%= project.css %>' : '<%= project.scss %>'
        }
      }
    },

    /**
     * Autoprefixer
     * Adds vendor prefixes automatically
     * https://github.com/nDmitry/grunt-autoprefixer
     */
    autoprefixer: {
      options: {
        browsers: [
          'last 2 version'
        ]
      },
      dev: {
        files: {
          '<%= project.css %>' : '<%= project.css %>'
        }
      }
    },

    /**
     * Connect port/livereload
     * https://github.com/gruntjs/grunt-contrib-connect
     * Starts a local webserver and injects
     * livereload snippet
     */
    connect: {
      options: {
        port: 9000,
        hostname: '*'
      },
      livereload: {
        options: {
          middleware: function (connect) {
            return [lrSnippet, mountFolder(connect, 'demo')];
          }
        }
      }
    },

    /**
     * Opens the web server in the browser
     * https://github.com/jsoverson/grunt-open
     */
    open: {
      server: {
        path: 'http://localhost:<%= connect.options.port %>'
      }
    },

    /**
     * Runs tasks against changed watched files
     * https://github.com/gruntjs/grunt-contrib-watch
     * Watching development files and run concat/compile tasks
     * Livereload the browser once complete
     */
    watch: {
      livereload: {
        options: {
          livereload: LIVERELOAD_PORT
        },
        files: '<%= project.app %>/{,*/}*.html'
      }
    }

  });

  /**
   * Default task
   * Run `grunt` on the command line
   */
  grunt.registerTask('default', [
    'concat',
    'sass',
    'connect:livereload',
    'open',
    'watch'
  ]);

};
<commit_msg>removed sass sourcemaps from build<commit_after>/*!
 * Prototype Gruntfile
 * @author Azin Asili
 */

'use strict';

/**
 * Livereload and connect variables
 */
var LIVERELOAD_PORT = 35729;
var lrSnippet = require('connect-livereload')({
  port: LIVERELOAD_PORT
});
var mountFolder = function (connect, dir) {
  return connect.static(require('path').resolve(dir));
};

/**
 * Grunt module
 */
module.exports = function (grunt) {

  /**
   * Dynamically load npm tasks
   */
  require('load-grunt-tasks')(grunt);

  /**
   * Grunt config
   */
  grunt.initConfig({

    pkg: grunt.file.readJSON('package.json'),

    /**
     * Set project info
     */
    project: {
      src   : 'src',
      app   : 'app',
      appjs : '<%= project.app %>/js/scripts.min.js',
      srcjs : '<%= project.src %>/js/scripts.js',
      css   : '<%= project.app %>/css/styles.min.css',
      scss  : '<%= project.src %>/scss/styles.scss'
    },

    /**
     * Concatenate JavaScript files
     * https://github.com/gruntjs/grunt-contrib-concat
     * Imports all .js files and appends project banner
     */
    concat: {
      dev: {
        files: {
          '<%= project.appjs %>' : '<%= project.srcjs %>'
        }
      }
    },

    /**
     * Compile Sass/SCSS files
     * https://github.com/gruntjs/grunt-contrib-sass
     * Compiles all Sass/SCSS files and appends project banner
     */
    sass: {
      dev: {
        options: {
          sourcemap : 'none'
        },
        files: {
          '<%= project.css %>' : '<%= project.scss %>'
        }
      }
    },

    /**
     * Autoprefixer
     * Adds vendor prefixes automatically
     * https://github.com/nDmitry/grunt-autoprefixer
     */
    autoprefixer: {
      options: {
        browsers: [
          'last 2 version'
        ]
      },
      dev: {
        files: {
          '<%= project.css %>' : '<%= project.css %>'
        }
      }
    },

    /**
     * Connect port/livereload
     * https://github.com/gruntjs/grunt-contrib-connect
     * Starts a local webserver and injects
     * livereload snippet
     */
    connect: {
      options: {
        port: 9000,
        hostname: '*'
      },
      livereload: {
        options: {
          middleware: function (connect) {
            return [lrSnippet, mountFolder(connect, 'demo')];
          }
        }
      }
    },

    /**
     * Opens the web server in the browser
     * https://github.com/jsoverson/grunt-open
     */
    open: {
      server: {
        path: 'http://localhost:<%= connect.options.port %>'
      }
    },

    /**
     * Runs tasks against changed watched files
     * https://github.com/gruntjs/grunt-contrib-watch
     * Watching development files and run concat/compile tasks
     * Livereload the browser once complete
     */
    watch: {
      livereload: {
        options: {
          livereload: LIVERELOAD_PORT
        },
        files: '<%= project.app %>/{,*/}*.html'
      }
    }

  });

  /**
   * Default task
   * Run `grunt` on the command line
   */
  grunt.registerTask('default', [
    'concat',
    'sass',
    'connect:livereload',
    'open',
    'watch'
  ]);

};
<|endoftext|>


<commit_before>// JSHint settings
/* jshint camelcase: false, es3: false */

'use strict';

module.exports = function(grunt) {

	// Get devDependencies
	require('load-grunt-tasks')(grunt, {scope: 'devDependencies'});

	// Displays the execution time of grunt tasks
	require('time-grunt')(grunt);

	// Config
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		pkpCopy: grunt.file.readJSON('package.json'),

		// List available tasks
		availabletasks: {
			tasks: {
				options: {
					filter: 'include',
					tasks: [
						'default',
						'dev',
						'server',
						'watch',
						'build',
						'checkBuild',
						'plato',
						'jsdoc',
						'sync',
						'releasePatch',
						'releaseMinor',
						'releaseMajor',
						'lint'
					],
					descriptions: {
						'watch':
							'`grunt watch` run dev tasks whenever watched files change and ' +
							'Reloads the browser with »LiveReload« plugin.',
						'jsdoc':
							'`grunt jsdoc` generates source documentation using jsdoc.',
						'plato':
							'`grunt plato` generates static code analysis charts with plato.'
					},
					groups: {
						'Dev': ['default', 'dev', 'sync', 'server', 'watch','plato', 'jsdoc', 'lint'],
						'Production': ['build', 'checkBuild', 'releasePatch', 'releaseMinor', 'releaseMajor'],
					},
					sort: [
						'default',
						'dev',
						'sync',
						'plato',
						'jsdoc',
						'server',
						'watch',
						'build',
						'checkBuild',
						'releasePatch',
						'releaseMinor',
						'releaseMajor'
					]
				}
			}
		},

		// jsHint
		jshint: {
			options: {
				reporter: require('jshint-stylish'),
				jshintrc: '.jshintrc',
				ignores: ['assets/js/*.min.js']
			},
			all: [
				'Gruntfile.js',
				'assets/js/*.js'
			]
		},

		// uglify
		uglify: {
			options: {
				banner: '/*! <%= pkg.title %> - v<%= pkg.version %>\n' +
						' * m.kuehnel@micromata.de\n' +
						' * Copyright ©2014 Micromata GmbH\n' +
						' * <%= grunt.template.today("yyyy-mm-dd") %>\n' +
						' */'
			},
			dev : {
				options: {
					sourceMap: true,
				},
				files: [{
					expand: true,
					cwd: 'assets/js',
					src: ['**/*.js', '!**/*min.js'],
					dest: 'assets/js',
					ext: '.min.js',
					extDot: 'last'
				}]
			},
			dist : {
				options: {
					banner: '<%= uglify.options.banner %>\n',
					compress: { drop_console: true },
				},
				files: [{
					expand: true,
					cwd: 'assets/js',
					src: ['**/*.js', '!**/*min.js'],
					dest: 'dist/assets/js',
					ext: '.min.js',
					extDot: 'last'
				}]
			}
		},

		// less
		less: {
			dev: {
				options: {
					sourceMap: true,
					sourceMapFilename: "assets/css/index_raw.css.map",
					sourceMapURL: "index_raw.css.map",
					sourceMapRootpath: "../../"
				},
				files: {
					"assets/css/index_raw.css": "assets/less/index.less"
				}
			}
		},

		autoprefixer: {
			options: {
				browsers: [
					'> 1%',
					'last 3 version',
					'ie 8',
					'ie 9',
					'Firefox ESR',
					'Opera 12.1'
				],
				// diff: true, // or 'custom/path/to/file.css.patch',
				map: true
			},
			dev: {
				src: 'assets/css/index_raw.css',
				dest: 'assets/css/index.css'
			}
		},

		clean: {
			less: ['assets/css/index_raw.*'],
			js: ['assets/js/**/*min.js*'],
			dist: ['dist', 'server'],
			server: ['server'],
			temp: ['temp'],
		},

		// Local dev server
		connect: {
			dev: {
				options: {
					port: 9001,
					hostname: 'localhost',
					base: 'server',
					open: {
						 target: 'http://<%= connect.dev.options.hostname %>:' +
						 '<%= connect.dev.options.port %>',
					},
				}
			},
			sync: {
				options: {
					port: 9001,
					hostname: 'localhost',
					base: 'server'
				}
			},
			dist: {
				options: {
					port: 9002,
					hostname: 'localhost',
					base: 'dist',
					keepalive: true,
					open: {
						 target: 'http://<%= connect.dev.options.hostname %>:' +
						 '<%= connect.dist.options.port %>',
					},
				}
			}
		},

		uncss: {
			options: {
				ignoreSheets: [/fonts.googleapis/],
			},
			dist: {
				src: '*.html',
				dest: 'temp/index.css'
			}
		},

		cssmin: {
			dist: {
				options: {
					keepSpecialComments: 0,
					banner: '/*! <%= pkg.title %> - v<%= pkg.version %>\n' +
						' * m.kuehnel@micromata.de\n' +
						' * Copyright ©2014 Micromata GmbH\n' +
						' * <%= grunt.template.today("yyyy-mm-dd") %>\n' +
						' */'
				},
				files: {
					'dist/assets/css/index.uncss.min.css': ['temp/index.css'],
					'dist/assets/css/index.min.css': ['assets/css/index.css'],
				}
			}
		},

		imagemin: {
			dist: {
				options: {},
				files: [{
					expand: true, // Enable dynamic expansion
					cwd: 'assets/img', // Src matches are relative to this path
					src: ['**/*.{png,jpg,gif}'], // Actual patterns to match
					dest: 'dist/assets/img' // Destination path prefix
				}]
			}
		},

		processhtml: {
			dist: {
				files: [
					{
						expand: true,
						src: [
							'*.html'
						],
						dest: 'dist/'
					},
				]
			}
		},

		copy: {
			server: {
				expand: true,
				src: [
					'*.html',
					'assets/**/*',
					'libs/**/*',
				],
				dest: 'server/'
			},
			dist: {
				expand: true,
				src: [
					'*.html',
					'assets/css/*.css',
					'assets/fonts/**/*',
					'assets/img/**/*',
					'libs/**/*',
				],
				dest: 'dist/'
			}
		},

		jsdoc: {
			dist: {
				src: [
					'assets/js/**/*.js',
					'!assets/js/**/*.min.js',
					'test/**/*.js'
				],
				options: {
					destination: 'docs'
				}
			}
		},

		plato: {
			options: {
				 jshint: grunt.file.readJSON('.jshintrc')
			},
			dist: {
				files: {
					'reports/': [
						'assets/js/**/*.js',
						'!assets/js/**/*.min.js',
						'test/**/*.js'
					]
				}
			}
		},

		cacheBust: {
			options: {
				rename: false
			},
			files: {
				src: ['server/*.html']
			}
		},

		browserSync: {
			dev: {
				bsFiles: {
					src: [
						'assets/css/*.css',
						'assets/img/**/*.jpg',
						'assets/img/**/*.png',
						'assets/img/**/*.gif',
						'assets/js/**/*.js',
						'*.html'
					]
				},
				options: {
					proxy:	'<%= connect.dev.options.hostname %>:' +
							'<%= connect.dev.options.port %>',
					watchTask: true,
				}
			}
		},

		compress: {
			dist: {
				options: {
					archive: 'dist-v<%= pkg.version %>.zip'
				},
				files: [{
					src: ['dist/**'],
					dest: './'
				}]
			},
			src: {
				options: {
					archive: 'src-v<%= pkg.version %>.zip'
				},
				files: [
					{src: ['./*', '!./*.zip', '!./*.sublime*',], dest: './', filter: 'isFile'}, // includes files in path
					{src: ['assets/**', '!assets/css/**'], dest: './'}, // includes files in path and its subdirs
				]
			}
		},

		bump: {
			options: {
				files: ['package.json', 'bower.json'],
				updateConfigs: ['pkg'],
				// commit: false,
				commitMessage: 'Release v%VERSION%',
				commitFiles: ['package.json', 'bower.json', 'CHANGELOG.md'],
				// createTag: false,
				tagName: '%VERSION%',
				tagMessage: 'Version v%VERSION%',
				push: false,
				// pushTo: 'origin',
				// gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d'
			}
		},

		changelog: {
			release: {
				options: {
					after: '<%= pkpCopy.version %>',
					dest : 'CHANGELOG.md',
					insertType: 'prepend',
					template: '## Version <%= pkg.version %> ({{date}})\n\n{{> features}}',
					featureRegex: /^(.*)$/gim,
					partials: {
						features: '{{#if features}}{{#each features}}{{> feature}}{{/each}}{{else}}{{> empty}}{{/if}}\n',
						feature: '- {{{this}}}\n'
					}
				}
			}
		},

		htmllint: {
			options: {
				ignore: ['Bad value “X-UA-Compatible” for attribute “http-equiv” on XHTML element “meta”.']
			},
			all: ['*.html']
		},

		bootlint: {
			options: {
				stoponerror: true
			},
			files: ['*.html']
		},

		githooks: {
			options: {
				hashbang: '#!/bin/sh',
				template: 'node_modules/grunt-githooks/templates/shell.hb',
				startMarker: '## GRUNT-GITHOOKS START',
				endMarker: '## GRUNT-GITHOOKS END',
				command: 'PATH=' + process.env.PATH + ' grunt',
				args: '--no-color'
			},
			install: {
				'pre-commit': 'shell:bowerinstall'
			}
		},

		shell: {
			bowerinstall: {
				command: 'bower install'
			}
		},

		// watch
		watch: {
			options: {
				livereload: true
			},
			scripts: {
				files: ['assets/js/**/*.js'],
				tasks: ['newer:jshint', 'newer:uglify:dev', 'newer:copy:server'],
				options: {
					spawn: false
				}
			},
			gruntfile: {
				files: ['Gruntfile.js'],
				tasks: ['jshint'],
				options: {
					spawn: false
				}
			},
			css: {
				files: ['assets/less/**/*.less'],
				tasks: ['newer:less:dev', 'newer:autoprefixer', 'clean:less', 'newer:copy:server'],
				options: {
					spawn: false
				}
			},
			html: {
				files: ['*.html'],
				tasks: ['newer:htmllint', 'newer:bootlint', 'newer:copy:server'],
				options: {
					spawn: false,
				}
			},
			images: {
				files: ['assets/img/**/*.{png,jpg,gif}'],
				tasks: ['newer:copy:server'],
				options: {
					spawn: false,
				}
			}
		}

	});

	// List available Tasks
	grunt.registerTask('tasks',
		'`grunt tasks` shows all tasks which are registered for use.',
		['availabletasks']
	);

	// Lint files
	grunt.registerTask('lint',
		'`grunt lint` lints JavasScript (JSHint) and HTML files (validate and Bootlint)',
		[
			'htmllint',
			'bootlint',
			'jshint'
		]
	);

	/**
	 * A task for development
	 */
	grunt.registerTask('dev',
		'`grunt dev` will hint your files, build sources within the ' +
		'assets directory and generating docs / reports.',
		[
			'lint',
			'uglify:dev',
			'less:dev',
			'autoprefixer',
			'clean:less',
			'plato',
			'jsdoc',
		]
	);

	// Start dev server and watching files
	grunt.registerTask('server',
		'`grunt server` starts a local dev server and runs `grunt watch`',
		[
			'clean:server',
			'copy:server',
			'cacheBust',
			'connect:dev',
			'watch'
		]
	);

	// Start browser sync and watching files
	grunt.registerTask('sync',
		'`grunt sync` starts a local dev server, sync browsers and runs `grunt watch`',
		[
			'dev',
			'clean:server',
			'copy:server',
			'cacheBust',
			'connect:sync',
			'browserSync',
			'watch'
		]
	);

	// Default task
	grunt.registerTask(
		'default',
		'Default Task. Just type `grunt` for this one. Calls `grunt dev` first '+
		'and `grunt server` afterwards.',
		[
			'dev',
			'server'
		]
	);

	/**
	 * A task for your production ready build
	 */
	grunt.registerTask('build',
		'`grunt build` builds production ready sources to dist directory.', [
		'clean:dist',
		'lint',
		'uglify:dist',
		'less:dev',
		'autoprefixer',
		'clean:less',
		'uncss',
		'cssmin',
		'imagemin',
		'processhtml',
		'copy:dist',
		'clean:temp',
		'plato',
		'jsdoc'
	]);

	// Start server to check production build
	grunt.registerTask('checkBuild',
		'`grunt checkBuild` starts a local server to make it possible to check '+
		'the build in the browser.',
		['connect:dist']
	);

	// Relase tasks
	grunt.registerTask('releasePatch',
		'`grunt releasePatch` builds the current sources, bumps version number (0.0.1) and creates zip.files.',
		['bump-only:patch', 'build', 'clean:js', 'changelog', 'bump-commit', 'compress']
	);
	grunt.registerTask('releaseMinor',
		'`grunt releaseMinor` builds the current sources, bumps version number (0.1.0) and creates zip.files.',
		['bump-only:minor', 'build', 'clean:js', 'changelog', 'bump-commit', 'compress']
	);
	grunt.registerTask('releaseMajor',
		'`grunt releaseMajor` builds the current sources, bumps version number (1.0.0) and creates zip.files.',
		['bump-only:major', 'build', 'clean:js', 'changelog', 'bump-commit', 'compress']
	);

};
<commit_msg>Single quotes all over …<commit_after>// JSHint settings
/* jshint camelcase: false, es3: false */

'use strict';

module.exports = function(grunt) {

	// Get devDependencies
	require('load-grunt-tasks')(grunt, {scope: 'devDependencies'});

	// Displays the execution time of grunt tasks
	require('time-grunt')(grunt);

	// Config
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		pkpCopy: grunt.file.readJSON('package.json'),

		// List available tasks
		availabletasks: {
			tasks: {
				options: {
					filter: 'include',
					tasks: [
						'default',
						'dev',
						'server',
						'watch',
						'build',
						'checkBuild',
						'plato',
						'jsdoc',
						'sync',
						'releasePatch',
						'releaseMinor',
						'releaseMajor',
						'lint'
					],
					descriptions: {
						'watch':
							'`grunt watch` run dev tasks whenever watched files change and ' +
							'Reloads the browser with »LiveReload« plugin.',
						'jsdoc':
							'`grunt jsdoc` generates source documentation using jsdoc.',
						'plato':
							'`grunt plato` generates static code analysis charts with plato.'
					},
					groups: {
						'Dev': ['default', 'dev', 'sync', 'server', 'watch','plato', 'jsdoc', 'lint'],
						'Production': ['build', 'checkBuild', 'releasePatch', 'releaseMinor', 'releaseMajor'],
					},
					sort: [
						'default',
						'dev',
						'sync',
						'plato',
						'jsdoc',
						'server',
						'watch',
						'build',
						'checkBuild',
						'releasePatch',
						'releaseMinor',
						'releaseMajor'
					]
				}
			}
		},

		// jsHint
		jshint: {
			options: {
				reporter: require('jshint-stylish'),
				jshintrc: '.jshintrc',
				ignores: ['assets/js/*.min.js']
			},
			all: [
				'Gruntfile.js',
				'assets/js/*.js'
			]
		},

		// uglify
		uglify: {
			options: {
				banner: '/*! <%= pkg.title %> - v<%= pkg.version %>\n' +
						' * m.kuehnel@micromata.de\n' +
						' * Copyright ©2014 Micromata GmbH\n' +
						' * <%= grunt.template.today("yyyy-mm-dd") %>\n' +
						' */'
			},
			dev : {
				options: {
					sourceMap: true,
				},
				files: [{
					expand: true,
					cwd: 'assets/js',
					src: ['**/*.js', '!**/*min.js'],
					dest: 'assets/js',
					ext: '.min.js',
					extDot: 'last'
				}]
			},
			dist : {
				options: {
					banner: '<%= uglify.options.banner %>\n',
					compress: { drop_console: true },
				},
				files: [{
					expand: true,
					cwd: 'assets/js',
					src: ['**/*.js', '!**/*min.js'],
					dest: 'dist/assets/js',
					ext: '.min.js',
					extDot: 'last'
				}]
			}
		},

		// less
		less: {
			dev: {
				options: {
					sourceMap: true,
					sourceMapFilename: 'assets/css/index_raw.css.map',
					sourceMapURL: 'index_raw.css.map',
					sourceMapRootpath: '../../'
				},
				files: {
					'assets/css/index_raw.css': 'assets/less/index.less'
				}
			}
		},

		autoprefixer: {
			options: {
				browsers: [
					'> 1%',
					'last 3 version',
					'ie 8',
					'ie 9',
					'Firefox ESR',
					'Opera 12.1'
				],
				// diff: true, // or 'custom/path/to/file.css.patch',
				map: true
			},
			dev: {
				src: 'assets/css/index_raw.css',
				dest: 'assets/css/index.css'
			}
		},

		clean: {
			less: ['assets/css/index_raw.*'],
			js: ['assets/js/**/*min.js*'],
			dist: ['dist', 'server'],
			server: ['server'],
			temp: ['temp'],
		},

		// Local dev server
		connect: {
			dev: {
				options: {
					port: 9001,
					hostname: 'localhost',
					base: 'server',
					open: {
						 target: 'http://<%= connect.dev.options.hostname %>:' +
						 '<%= connect.dev.options.port %>',
					},
				}
			},
			sync: {
				options: {
					port: 9001,
					hostname: 'localhost',
					base: 'server'
				}
			},
			dist: {
				options: {
					port: 9002,
					hostname: 'localhost',
					base: 'dist',
					keepalive: true,
					open: {
						 target: 'http://<%= connect.dev.options.hostname %>:' +
						 '<%= connect.dist.options.port %>',
					},
				}
			}
		},

		uncss: {
			options: {
				ignoreSheets: [/fonts.googleapis/],
			},
			dist: {
				src: '*.html',
				dest: 'temp/index.css'
			}
		},

		cssmin: {
			dist: {
				options: {
					keepSpecialComments: 0,
					banner: '/*! <%= pkg.title %> - v<%= pkg.version %>\n' +
						' * m.kuehnel@micromata.de\n' +
						' * Copyright ©2014 Micromata GmbH\n' +
						' * <%= grunt.template.today("yyyy-mm-dd") %>\n' +
						' */'
				},
				files: {
					'dist/assets/css/index.uncss.min.css': ['temp/index.css'],
					'dist/assets/css/index.min.css': ['assets/css/index.css'],
				}
			}
		},

		imagemin: {
			dist: {
				options: {},
				files: [{
					expand: true, // Enable dynamic expansion
					cwd: 'assets/img', // Src matches are relative to this path
					src: ['**/*.{png,jpg,gif}'], // Actual patterns to match
					dest: 'dist/assets/img' // Destination path prefix
				}]
			}
		},

		processhtml: {
			dist: {
				files: [
					{
						expand: true,
						src: [
							'*.html'
						],
						dest: 'dist/'
					},
				]
			}
		},

		copy: {
			server: {
				expand: true,
				src: [
					'*.html',
					'assets/**/*',
					'libs/**/*',
				],
				dest: 'server/'
			},
			dist: {
				expand: true,
				src: [
					'*.html',
					'assets/css/*.css',
					'assets/fonts/**/*',
					'assets/img/**/*',
					'libs/**/*',
				],
				dest: 'dist/'
			}
		},

		jsdoc: {
			dist: {
				src: [
					'assets/js/**/*.js',
					'!assets/js/**/*.min.js',
					'test/**/*.js'
				],
				options: {
					destination: 'docs'
				}
			}
		},

		plato: {
			options: {
				 jshint: grunt.file.readJSON('.jshintrc')
			},
			dist: {
				files: {
					'reports/': [
						'assets/js/**/*.js',
						'!assets/js/**/*.min.js',
						'test/**/*.js'
					]
				}
			}
		},

		cacheBust: {
			options: {
				rename: false
			},
			files: {
				src: ['server/*.html']
			}
		},

		browserSync: {
			dev: {
				bsFiles: {
					src: [
						'assets/css/*.css',
						'assets/img/**/*.jpg',
						'assets/img/**/*.png',
						'assets/img/**/*.gif',
						'assets/js/**/*.js',
						'*.html'
					]
				},
				options: {
					proxy:	'<%= connect.dev.options.hostname %>:' +
							'<%= connect.dev.options.port %>',
					watchTask: true,
				}
			}
		},

		compress: {
			dist: {
				options: {
					archive: 'dist-v<%= pkg.version %>.zip'
				},
				files: [{
					src: ['dist/**'],
					dest: './'
				}]
			},
			src: {
				options: {
					archive: 'src-v<%= pkg.version %>.zip'
				},
				files: [
					{src: ['./*', '!./*.zip', '!./*.sublime*',], dest: './', filter: 'isFile'}, // includes files in path
					{src: ['assets/**', '!assets/css/**'], dest: './'}, // includes files in path and its subdirs
				]
			}
		},

		bump: {
			options: {
				files: ['package.json', 'bower.json'],
				updateConfigs: ['pkg'],
				// commit: false,
				commitMessage: 'Release v%VERSION%',
				commitFiles: ['package.json', 'bower.json', 'CHANGELOG.md'],
				// createTag: false,
				tagName: '%VERSION%',
				tagMessage: 'Version v%VERSION%',
				push: false,
				// pushTo: 'origin',
				// gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d'
			}
		},

		changelog: {
			release: {
				options: {
					after: '<%= pkpCopy.version %>',
					dest : 'CHANGELOG.md',
					insertType: 'prepend',
					template: '## Version <%= pkg.version %> ({{date}})\n\n{{> features}}',
					featureRegex: /^(.*)$/gim,
					partials: {
						features: '{{#if features}}{{#each features}}{{> feature}}{{/each}}{{else}}{{> empty}}{{/if}}\n',
						feature: '- {{{this}}}\n'
					}
				}
			}
		},

		htmllint: {
			options: {
				ignore: ['Bad value “X-UA-Compatible” for attribute “http-equiv” on XHTML element “meta”.']
			},
			all: ['*.html']
		},

		bootlint: {
			options: {
				stoponerror: true
			},
			files: ['*.html']
		},

		githooks: {
			options: {
				hashbang: '#!/bin/sh',
				template: 'node_modules/grunt-githooks/templates/shell.hb',
				startMarker: '## GRUNT-GITHOOKS START',
				endMarker: '## GRUNT-GITHOOKS END',
				command: 'PATH=' + process.env.PATH + ' grunt',
				args: '--no-color'
			},
			install: {
				'pre-commit': 'shell:bowerinstall'
			}
		},

		shell: {
			bowerinstall: {
				command: 'bower install'
			}
		},

		// watch
		watch: {
			options: {
				livereload: true
			},
			scripts: {
				files: ['assets/js/**/*.js'],
				tasks: ['newer:jshint', 'newer:uglify:dev', 'newer:copy:server'],
				options: {
					spawn: false
				}
			},
			gruntfile: {
				files: ['Gruntfile.js'],
				tasks: ['jshint'],
				options: {
					spawn: false
				}
			},
			css: {
				files: ['assets/less/**/*.less'],
				tasks: ['newer:less:dev', 'newer:autoprefixer', 'clean:less', 'newer:copy:server'],
				options: {
					spawn: false
				}
			},
			html: {
				files: ['*.html'],
				tasks: ['newer:htmllint', 'newer:bootlint', 'newer:copy:server'],
				options: {
					spawn: false,
				}
			},
			images: {
				files: ['assets/img/**/*.{png,jpg,gif}'],
				tasks: ['newer:copy:server'],
				options: {
					spawn: false,
				}
			}
		}

	});

	// List available Tasks
	grunt.registerTask('tasks',
		'`grunt tasks` shows all tasks which are registered for use.',
		['availabletasks']
	);

	// Lint files
	grunt.registerTask('lint',
		'`grunt lint` lints JavasScript (JSHint) and HTML files (validate and Bootlint)',
		[
			'htmllint',
			'bootlint',
			'jshint'
		]
	);

	/**
	 * A task for development
	 */
	grunt.registerTask('dev',
		'`grunt dev` will hint your files, build sources within the ' +
		'assets directory and generating docs / reports.',
		[
			'lint',
			'uglify:dev',
			'less:dev',
			'autoprefixer',
			'clean:less',
			'plato',
			'jsdoc',
		]
	);

	// Start dev server and watching files
	grunt.registerTask('server',
		'`grunt server` starts a local dev server and runs `grunt watch`',
		[
			'clean:server',
			'copy:server',
			'cacheBust',
			'connect:dev',
			'watch'
		]
	);

	// Start browser sync and watching files
	grunt.registerTask('sync',
		'`grunt sync` starts a local dev server, sync browsers and runs `grunt watch`',
		[
			'dev',
			'clean:server',
			'copy:server',
			'cacheBust',
			'connect:sync',
			'browserSync',
			'watch'
		]
	);

	// Default task
	grunt.registerTask(
		'default',
		'Default Task. Just type `grunt` for this one. Calls `grunt dev` first '+
		'and `grunt server` afterwards.',
		[
			'dev',
			'server'
		]
	);

	/**
	 * A task for your production ready build
	 */
	grunt.registerTask('build',
		'`grunt build` builds production ready sources to dist directory.', [
		'clean:dist',
		'lint',
		'uglify:dist',
		'less:dev',
		'autoprefixer',
		'clean:less',
		'uncss',
		'cssmin',
		'imagemin',
		'processhtml',
		'copy:dist',
		'clean:temp',
		'plato',
		'jsdoc'
	]);

	// Start server to check production build
	grunt.registerTask('checkBuild',
		'`grunt checkBuild` starts a local server to make it possible to check '+
		'the build in the browser.',
		['connect:dist']
	);

	// Relase tasks
	grunt.registerTask('releasePatch',
		'`grunt releasePatch` builds the current sources, bumps version number (0.0.1) and creates zip.files.',
		['bump-only:patch', 'build', 'clean:js', 'changelog', 'bump-commit', 'compress']
	);
	grunt.registerTask('releaseMinor',
		'`grunt releaseMinor` builds the current sources, bumps version number (0.1.0) and creates zip.files.',
		['bump-only:minor', 'build', 'clean:js', 'changelog', 'bump-commit', 'compress']
	);
	grunt.registerTask('releaseMajor',
		'`grunt releaseMajor` builds the current sources, bumps version number (1.0.0) and creates zip.files.',
		['bump-only:major', 'build', 'clean:js', 'changelog', 'bump-commit', 'compress']
	);

};
<|endoftext|>


<commit_before>#!/usr/bin/env node

/*!
 * sequomics® [v1.0.0]
 * ______________________________________________________________
 * Grunt, http://gruntjs.com/
 * The JavaScript Task Runner.
 * ______________________________________________________________
 * Architecture and Code Handcrafted by Prabhat Kumar.
 * Architectuur en Code handgemaakt door Prabhat Kumar.
 * @author    : Prabhat Kumar [http://prabhatkumar.org/]
 * @copyright : Sequømics Corporation [http://sequomics.com/]
 * ______________________________________________________________
 * @date      : 11-Jan-2016
 * @license   : Apache, version 2.0
 * @require   : Node.js®
 * @require   : NPM
 * ______________________________________________________________
 *
 * --/The Heart of Build System/-- of "sequomics®".
 * ______________________________________________________________
 */

// # Usage: $ node -v
// # Usage: $ npm -v

// =========================
// Grunt Module(s) Required.
// =========================
// main module.
// @require   : grunt
// @require   : grunt-cli
<commit_msg>Initial commit<commit_after>#!/usr/bin/env node

/*!
 * sequomics® [v1.0.0]
 * ______________________________________________________________
 * Grunt, http://gruntjs.com/
 * The JavaScript Task Runner.
 * ______________________________________________________________
 * Architecture and Code Handcrafted by Prabhat Kumar.
 * Architectuur en Code handgemaakt door Prabhat Kumar.
 * @author    : Prabhat Kumar [http://prabhatkumar.org/]
 * @copyright : Sequømics Corporation [http://sequomics.com/]
 * ______________________________________________________________
 * @date      : 11-Jan-2016
 * @license   : Apache, version 2.0
 * @require   : Node.js®
 * @require   : NPM
 * ______________________________________________________________
 *
 * --/The Heart of Build System/-- of "sequomics®".
 * ______________________________________________________________
 */

// # Usage: $ node -v
// # Usage: $ npm -v

// =========================
// Grunt Module(s) Required.
// =========================
// main module.
// @require   : grunt
// @require   : grunt-cli

// BUILD MODULE
// ============
// @require   : assemble
<|endoftext|>