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

  // load all grunt tasks
  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

  grunt.initConfig({
    open : {
      dev: {
        path: 'http://localhost:1919'
      }
    },

    connect: {
      server: {
        options: {
          port: 1919,
          base: 'demo_docs/build',
          livereload: true
        }
      }
    },

    compass: {
      build: {
        options: {
          config: 'compass.rb',
          environment: 'production',
          force: true
        }
      },
      dev: {
        options: {
          config: 'compass.rb',
          force: true
        }
      }
    },

    exec: {
      bower_update: {
        cmd: 'bower update'
      },
      build_sphinx: {
        cmd: 'sphinx-build demo_docs/source demo_docs/build'
      }
    },
    clean: {
      build: ["demo_docs/build"]
    },

    watch: {
      /* Compile sass changes into theme directory */
      sass: {
        files: ['sass/*.sass', 'bower_components/**/*.sass'],
        tasks: ['compass:dev']
      },
      /* Changes in theme dir rebuild sphinx */
      sphinx: {
        files: ['sphinx_rtd_theme/**/*', 'demo_docs/**/*.rst'],
        tasks: ['clean:build','exec:build_sphinx']
      },
      /* live-reload the demo_docs if sphinx re-builds */
      livereload: {
        files: ['demo_docs/build/**/*'],
        options: { livereload: true }
      }
    }

  });

  grunt.loadNpmTasks('grunt-exec');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-compass');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-open');

  grunt.registerTask('default', ['exec:bower_update','clean:build','compass:dev','exec:build_sphinx','connect','open','watch']);
  grunt.registerTask('build', ['exec:bower_update','clean:build','compass:build','exec:build_sphinx']);
}

<commit_msg>Watch .py files and rebuild when they change.<commit_after>module.exports = function(grunt) {

  // load all grunt tasks
  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

  grunt.initConfig({
    open : {
      dev: {
        path: 'http://localhost:1919'
      }
    },

    connect: {
      server: {
        options: {
          port: 1919,
          base: 'demo_docs/build',
          livereload: true
        }
      }
    },

    compass: {
      build: {
        options: {
          config: 'compass.rb',
          environment: 'production',
          force: true
        }
      },
      dev: {
        options: {
          config: 'compass.rb',
          force: true
        }
      }
    },

    exec: {
      bower_update: {
        cmd: 'bower update'
      },
      build_sphinx: {
        cmd: 'sphinx-build demo_docs/source demo_docs/build'
      }
    },
    clean: {
      build: ["demo_docs/build"]
    },

    watch: {
      /* Compile sass changes into theme directory */
      sass: {
        files: ['sass/*.sass', 'bower_components/**/*.sass'],
        tasks: ['compass:dev']
      },
      /* Changes in theme dir rebuild sphinx */
      sphinx: {
        files: ['sphinx_rtd_theme/**/*', 'demo_docs/**/*.rst', 'demo_docs/**/*.py'],
        tasks: ['clean:build','exec:build_sphinx']
      },
      /* live-reload the demo_docs if sphinx re-builds */
      livereload: {
        files: ['demo_docs/build/**/*'],
        options: { livereload: true }
      }
    }

  });

  grunt.loadNpmTasks('grunt-exec');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-compass');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-open');

  grunt.registerTask('default', ['exec:bower_update','clean:build','compass:dev','exec:build_sphinx','connect','open','watch']);
  grunt.registerTask('build', ['exec:bower_update','clean:build','compass:build','exec:build_sphinx']);
}

<|endoftext|>


<commit_before>//require('./driver-cec')
require('./driver-xbmc')
require('./driver-vera')<commit_msg>Uncomment cec driver require from drivers.js<commit_after>require('./driver-cec')
require('./driver-xbmc')
require('./driver-vera')
<|endoftext|>


<commit_before>/*global module, require*/
module.exports = function (grunt) {
    'use strict';
    var connect = require('connect');
    var gruntConfig = {};

    // convenience
    grunt.registerTask('default', 'lint test');
    grunt.registerTask('all', 'clean lint test coverage bundle test:ui');
    grunt.registerTask('ci', 'lint qunit:src');

    // clean
    grunt.loadNpmTasks('grunt-clean');
    gruntConfig.clean = {
        folder: 'output'
    };

    // lint
    gruntConfig.lint = {
        all: [
            'Gruntfile.js',
            'src/app/**/*.js',
            'src/test/stubs/**/*.js',
            'src/test/tests/**/*.js',
            'src/test/*.js'
            // Note: use this instead when grunt-0.4 is available
            // '!src/test/libs'
        ]
    };
    gruntConfig.jshint = {
        options: { bitwise: true, camelcase: true, curly: true, eqeqeq: true, forin: true, immed: true, indent: 4,
            latedef: true, newcap: true, noarg: true, noempty: true, nonew: true, plusplus: true, quotmark: true,
            regexp: true, undef: true, unused: true, strict: true, trailing: true
        }
    };

    // test
    gruntConfig.qunit = {
        src: ['src/test/index.html'],
        serve: ['http://localhost:8082/test/index.html'],
        ui: ['http://localhost:8083/test/uiTest.html']
    };
    grunt.loadNpmTasks('grunt-junit');

    // watch
    gruntConfig.watch = {
        scripts: {
            files: 'src/**/*.*',
            tasks: 'lint test'
        }
    };

    // coverage
    grunt.loadNpmTasks('grunt-qunit-cov');
    gruntConfig['qunit-cov'] = {
        test:
        {
            minimum: 1.0,
            baseDir: 'src',
            srcDir: 'src/app',
            depDirs: ['src/libs', 'src/test'],
            outDir: 'output/coverage',
            testFiles: ['src/test/index.html']
        }
    };
    grunt.registerTask('coverage', 'qunit-cov');

    // bundle
    grunt.loadNpmTasks('grunt-requirejs');
    gruntConfig.requirejs = {
        name: 'main',
        dir: 'output/optimized',
        appDir: 'src',
        baseUrl: 'app',
        paths: {
            jquery: '../libs/jquery',
            underscore: '../libs/lodash',
            backbone: '../libs/backbone',
            tpl: '../libs/plugins/tpl'
        },
        shim: {
            backbone: {
                deps: ['underscore', 'jquery'],
                exports: 'Backbone'
            }
        }
    };
    grunt.loadNpmTasks('grunt-contrib-copy');
    gruntConfig.copy = {
        bundle: {
            files: {
                'output/bundle/index.html': 'output/optimized/index.html',
                'output/bundle/app/css/index.css': 'output/optimized/app/css/index.css',
                'output/bundle/libs/require.js': 'output/optimized/libs/require.js',
                'output/bundle/app/config.js': 'output/optimized/app/config.js',
                'output/bundle/app/main.js': 'output/optimized/app/main.js'
            }
        }
    };
    grunt.registerTask('bundle', 'requirejs copy:bundle');

    // serve
    var serve = function (path, port) {
        // Note: using connect['static'], as jshint complains about connect.static, because static is a reserved word
        connect(connect['static'](path)).listen(port);
    };
    grunt.registerTask('serve:src', 'HTTP serve src on port 8080', function () {
        serve('src', 8080);
    });
    grunt.registerTask('serve:bundle', 'HTTP serve bundle on port 8081', function () {
        serve('output/bundle', 8081);
    });
    grunt.registerTask('serve:test', 'HTTP serve src on port 8082', function () {
        serve('src', 8082);
    });
    grunt.registerTask('serve:optimized', 'HTTP serve optimized on port 8082', function () {
        serve('output/optimized', 8083);
    });
    grunt.registerTask('wait', 'keep running until terminated', function () {
        /*var done = */
        this.async();
    });
    grunt.registerTask('test', 'junit:env serve:test qunit:serve');
    grunt.registerTask('test:ui', 'junit:env serve:optimized qunit:ui');

    // grunt
    grunt.initConfig(gruntConfig);

};<commit_msg>investigating teamcity lint error display<commit_after>/*global module, require*/
module.exports = function(grunt) {
    'use strict';
    var connect = require('connect');
    var gruntConfig = {};

    // convenience
    grunt.registerTask('default', 'lint test');
    grunt.registerTask('all', 'clean lint test coverage bundle test:ui');
    grunt.registerTask('ci', 'lint qunit:src');

    // clean
    grunt.loadNpmTasks('grunt-clean');
    gruntConfig.clean = {
        folder: 'output'
    };

    // lint
    gruntConfig.lint = {
        all: [
            'Gruntfile.js',
            'src/app/**/*.js',
            'src/test/stubs/**/*.js',
            'src/test/tests/**/*.js',
            'src/test/*.js'
            // Note: use this instead when grunt-0.4 is available
            // '!src/test/libs'
        ]
    };
    gruntConfig.jshint = {
        options: { bitwise: true, camelcase: true, curly: true, eqeqeq: true, forin: true, immed: true, indent: 4,
            latedef: true, newcap: true, noarg: true, noempty: true, nonew: true, plusplus: true, quotmark: true,
            regexp: true, undef: true, unused: true, strict: true, trailing: true
        }
    };

    // test
    gruntConfig.qunit = {
        src: ['src/test/index.html'],
        serve: ['http://localhost:8082/test/index.html'],
        ui: ['http://localhost:8083/test/uiTest.html']
    };
    grunt.loadNpmTasks('grunt-junit');

    // watch
    gruntConfig.watch = {
        scripts: {
            files: 'src/**/*.*',
            tasks: 'lint test'
        }
    };

    // coverage
    grunt.loadNpmTasks('grunt-qunit-cov');
    gruntConfig['qunit-cov'] = {
        test:
        {
            minimum: 1.0,
            baseDir: 'src',
            srcDir: 'src/app',
            depDirs: ['src/libs', 'src/test'],
            outDir: 'output/coverage',
            testFiles: ['src/test/index.html']
        }
    };
    grunt.registerTask('coverage', 'qunit-cov');

    // bundle
    grunt.loadNpmTasks('grunt-requirejs');
    gruntConfig.requirejs = {
        name: 'main',
        dir: 'output/optimized',
        appDir: 'src',
        baseUrl: 'app',
        paths: {
            jquery: '../libs/jquery',
            underscore: '../libs/lodash',
            backbone: '../libs/backbone',
            tpl: '../libs/plugins/tpl'
        },
        shim: {
            backbone: {
                deps: ['underscore', 'jquery'],
                exports: 'Backbone'
            }
        }
    };
    grunt.loadNpmTasks('grunt-contrib-copy');
    gruntConfig.copy = {
        bundle: {
            files: {
                'output/bundle/index.html': 'output/optimized/index.html',
                'output/bundle/app/css/index.css': 'output/optimized/app/css/index.css',
                'output/bundle/libs/require.js': 'output/optimized/libs/require.js',
                'output/bundle/app/config.js': 'output/optimized/app/config.js',
                'output/bundle/app/main.js': 'output/optimized/app/main.js'
            }
        }
    };
    grunt.registerTask('bundle', 'requirejs copy:bundle');

    // serve
    var serve = function (path, port) {
        // Note: using connect['static'], as jshint complains about connect.static, because static is a reserved word
        connect(connect['static'](path)).listen(port);
    };
    grunt.registerTask('serve:src', 'HTTP serve src on port 8080', function () {
        serve('src', 8080);
    });
    grunt.registerTask('serve:bundle', 'HTTP serve bundle on port 8081', function () {
        serve('output/bundle', 8081);
    });
    grunt.registerTask('serve:test', 'HTTP serve src on port 8082', function () {
        serve('src', 8082);
    });
    grunt.registerTask('serve:optimized', 'HTTP serve optimized on port 8082', function () {
        serve('output/optimized', 8083);
    });
    grunt.registerTask('wait', 'keep running until terminated', function () {
        /*var done = */
        this.async();
    });
    grunt.registerTask('test', 'junit:env serve:test qunit:serve');
    grunt.registerTask('test:ui', 'junit:env serve:optimized qunit:ui');

    // grunt
    grunt.initConfig(gruntConfig);

};<|endoftext|>


<commit_before>/* global require */
module.exports = function(grunt) {

	grunt.registerTask( 'build', require( './build/task' ) );

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

		/***********************
		* WATCH
		***********************/
		watch: {
			tasks: [ 'build' ],
			files: [ './src/**' ],
			options: { livereload: 5051 },
		}

	});

	// Load the plugin that provides the "uglify" task.
	grunt.loadNpmTasks('grunt-contrib-watch');

	// Default task(s).
	grunt.registerTask('default', ['watch']);

};<commit_msg>Added release task<commit_after>/* global require */
module.exports = function(grunt) {

	grunt.registerTask( 'build', require( './build/task' ) );

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

		/***********************
		* WATCH
		***********************/
		watch: {
			tasks: [ 'build' ],
			files: [ './src/**' ],
			options: { livereload: 5051 },
		},

		/***********************
		* WATCH
		***********************/
		release: {
			options: {
			tagName: 'v<%= version %>',
			github: {
				repo: 'hoxton-one/golden-layout',
				usernameVar: 'GITHUB_USERNAME',
				passwordVar: 'GITHUB_PASSWORD'
			}
		}
  	}

	});

	// Load the plugin that provides the "uglify" task.
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-release');

	// Default task(s).
	grunt.registerTask('default', ['watch']);

};<|endoftext|>


<commit_before>// ┌─────────────┐
// │ Gruntfile   │
// └─────────────┘
// Grunt wraps several tasks to ease development
// runs middleman, deploys the site, and tags new releases

// Javascript banner
var banner = '/* <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
                '*  <%= pkg.homepage %>\n' +
                '*  Copyright (c) <%= grunt.template.today("yyyy") %> Environmental Systems Research Institute, Inc.\n' +
                '*  Apache 2.0 License */\n';

var currentVersion = require('./package.json').version;

module.exports = function(grunt) {

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

    // Running a development server
    'http-server': {
      'dev': {
        root: 'docs/build',
        port: 8888,
        host: '0.0.0.0',
        cache: 0,
        showDir : true,
        autoIndex: true,
        ext: 'html',
        runInBackground: true
      }
    },

    // Rebuild site with Acetate
    'acetate': {
      build: {
        config: 'docs/acetate.conf.js'
      }
    },

    // Watch files
    'watch': {
      scripts: {
        files: ['lib/js/calcite-web.js'],
        tasks: [
          'concat:doc',
          'copy:doc',
          'jshint'
        ]
      },
      images: {
        files: ['lib/img/**/*'],
        tasks: [
          'newer:imagemin:doc',
          'copy:doc'
        ]
      },
      icons: {
        files: ['lib/img/icons/**/*.svg'],
        tasks: [
          'shell:icons'
        ]
      },
      libsass: {
        files: ['lib/sass/**/*', 'docs/source/assets/css/**/*'],
        tasks: [
          'sass:doc',
          'copy:doc'
        ]
      },
      docs: {
        files: ['docs/source/**'],
        tasks: [
          'acetate:build'
        ]
      }
    },

    // Check Javascript for errors
    'jshint': {
      all: ['lib/js/calcite-web.js']
    },

    // Build CSS files from SASS
    'sass': {

      options: {
        includePaths: ['lib/sass/', 'node_modules/patterns-color/scss']
      },

      expanded: {
        src: 'lib/sass/calcite-web.scss',
        dest: 'dist/css/calcite-web.css'
      },

      doc: {
        expand: true,
        cwd: 'docs/source/assets/css',
        src: ['**/*.scss'],
        dest: 'docs/build/assets/css',
        ext: '.css'
      },

      homepage: {
        files: {
          'docs/build/assets/css/homepage.css': 'docs/source/assets/css/homepage.scss'
        }
      }
    },

    // Create minified version of build css
    'cssmin': {
      target: {
        files: {
          'dist/css/calcite-web.min.css': ['dist/css/calcite-web.css']
        }
      }
    },

    // Build minified Javascript file to dist
    'uglify': {
      options: {
        mangle: false,
        banner: banner
      },
      dist: {
        files: {
          'dist/js/calcite-web.min.js': ['lib/js/calcite-web.js']
        }
      }
    },

    // Copy libsass files to dist, doc assets to build
    'copy': {
      libsass: {
        expand: true,
        cwd: 'lib/',
        src: ['sass/**/*'],
        dest: 'dist/'
      },
      doc: {
        expand: true,
        cwd: 'docs/source/',
        src: ['assets/img/**/*', 'assets/js/**/*'],
        dest: 'docs/build/'
      }
    },

    // Copy Javascript to dist and doc
    'concat': {
      options: {
        banner: banner
      },
      dist: {
        files: {
          'dist/js/calcite-web.js': 'lib/js/calcite-web.js'
        }
      },
      doc: {
        files: {
          'docs/source/assets/js/libs/calcite-web.js': 'lib/js/calcite-web.js'
        }
      }
    },

    // Optimize images and icons for dist and doc
    'imagemin': {
      dist: {
        files: [{
          expand: true,
          cwd: 'lib/',
          src: ['img/**/*.{png,jpg,svg,ico}'],
          dest: 'dist/'
        }]
      },
      doc: {
        files: [{
          expand: true,
          cwd: 'lib/',
          src: ['img/**/*.{png,jpg,svg,ico}'],
          dest: 'docs/source/assets/'
        }]
      }
    },

    // Make a zip file of the dist folder
    'compress': {
      main: {
        options: {
          archive: 'calcite-web.zip'
        },
        files: [
          {
            src: ['dist/**'],
            dest: './'
          },
        ]
      }
    },

    // Upload dist folder to s3
    'aws_s3': {
      options: {
        region: 'us-west-1',
        bucket: 'patterns.esri.com',
        endpoint: 'https://s3-us-west-1.amazonaws.com',
        access: 'public-read',
        gzip: true
      },
      production: {
        files: [
          // Manually set content type (plugin was setting incorrectly).
          {expand: true, cwd: 'dist/', src: ['**/*.js'],   dest: 'files/calcite-web/' + currentVersion + '/', params: {ContentType: 'application/javascript'}},
          {expand: true, cwd: 'dist/', src: ['**/*.css'],  dest: 'files/calcite-web/' + currentVersion + '/', params: {ContentType: 'text/css'}},
          {expand: true, cwd: 'dist/', src: ['**/*.svg'],  dest: 'files/calcite-web/' + currentVersion + '/', params: {ContentType: 'image/svg+xml'}},
          {expand: true, cwd: 'dist/', src: ['**/*.ico'],  dest: 'files/calcite-web/' + currentVersion + '/', params: {ContentType: 'image/x-icon'}},
          {expand: true, cwd: 'dist/', src: ['**/*.jpg'],  dest: 'files/calcite-web/' + currentVersion + '/', params: {ContentType: 'image/jpg'}},
          {expand: true, cwd: 'dist/', src: ['**/*.map'],  dest: 'files/calcite-web/' + currentVersion + '/', params: {ContentType: 'application/javascript'}},
          {expand: true, cwd: 'dist/', src: ['**/*.json'], dest: 'files/calcite-web/', params: {ContentType: 'application/javascript'}}
        ]
      }
    },

    // Ask for AWS ID and Key
    'prompt': {
      aws: {
        options: {
          questions: [
            {
              config: 'aws_s3.options.accessKeyId',
              type: 'input',
              message: 'AWS Access ID:'
            },
            {
              config: 'aws_s3.options.secretAccessKey',
              type: 'input',
              message: 'AWS Secret Access Key:'
            }
          ]
        }
      }
    },

    // bin scripts
    'shell': {
      guid: {
        command: 'bin/guid.js',    // Generate a unique id for a new section
      },
      deploy: {
        command: 'bin/deploy.js',  // Create a JSON record of current documentation
      },
      release: {
        command: 'bin/release.sh'  // Create GitHub release that includes dist
      },
      icons: {
        command: 'bin/icons.js'    // Create a sass file with all icons from icon folder
      }
    },

    // Deploy doc site to gh-pages
    'gh-pages': {
      options: {
        base: 'docs/build',
        repo: 'https://github.com/Esri/calcite-web.git'
      },
      src: ['**']
    },

    // Runs tasks concurrently, speeding up Grunt
    'concurrent': {
      prepublish: [
        'scss',
        'uglify',
        'copy',
        'concat:dist',
        'newer:imagemin:dist'
      ]
    }

  });

  // load all grunt modules
  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

  // ┌─────────────┐
  // │ Grunt tasks │
  // └─────────────┘

  // Build sass
  grunt.registerTask('scss', [
    'sass',
    'cssmin'
  ]);

  // Run a development environment
  grunt.registerTask('dev', [
    'acetate:build',
    'newer:imagemin:doc',
    'concat:doc',
    'sass:doc',
    'copy:doc',
    'http-server',
    'watch'
  ]);

  // Test calcite-web.js
  grunt.registerTask('test', [
    'jshint'
  ]);

  // Build a dist folder with all assets
  grunt.registerTask('prepublish', [
    'shell:icons',
    'concurrent:prepublish'
  ]);

  // Upload files to s3
  grunt.registerTask('s3', [
    'prepublish',
    'shell:deploy',
    'prompt:aws',
    'aws_s3'
  ]);

  // Build and deploy doc site to github pages
  grunt.registerTask('deploy', 'Deploy documentation to github pages', function(n) {
    if (grunt.option('message')) {
      grunt.config.set('gh-pages.options.message', grunt.option('message'));
    }
    grunt.task.run([
      'acetate:build',
      'newer:imagemin:doc',
      'concat:doc',
      'sass:doc',
      'copy:doc',
      'shell:deploy',
      'gh-pages'
    ]);
  });

  // Release a new version of the framework
  grunt.registerTask('release', [
    'prepublish',
    'shell:deploy',
    'compress',
    'shell:release',
    's3'
  ]);

  // Default task starts up a dev environment
  grunt.registerTask('default', ['prepublish', 'dev']);

};
<commit_msg>Ignore OSX cruft for archives<commit_after>// ┌─────────────┐
// │ Gruntfile   │
// └─────────────┘
// Grunt wraps several tasks to ease development
// runs middleman, deploys the site, and tags new releases

// Javascript banner
var banner = '/* <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
                '*  <%= pkg.homepage %>\n' +
                '*  Copyright (c) <%= grunt.template.today("yyyy") %> Environmental Systems Research Institute, Inc.\n' +
                '*  Apache 2.0 License */\n';

var currentVersion = require('./package.json').version;

module.exports = function(grunt) {

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

    // Running a development server
    'http-server': {
      'dev': {
        root: 'docs/build',
        port: 8888,
        host: '0.0.0.0',
        cache: 0,
        showDir : true,
        autoIndex: true,
        ext: 'html',
        runInBackground: true
      }
    },

    // Rebuild site with Acetate
    'acetate': {
      build: {
        config: 'docs/acetate.conf.js'
      }
    },

    // Watch files
    'watch': {
      scripts: {
        files: ['lib/js/calcite-web.js'],
        tasks: [
          'concat:doc',
          'copy:doc',
          'jshint'
        ]
      },
      images: {
        files: ['lib/img/**/*'],
        tasks: [
          'newer:imagemin:doc',
          'copy:doc'
        ]
      },
      icons: {
        files: ['lib/img/icons/**/*.svg'],
        tasks: [
          'shell:icons'
        ]
      },
      libsass: {
        files: ['lib/sass/**/*', 'docs/source/assets/css/**/*'],
        tasks: [
          'sass:doc',
          'copy:doc'
        ]
      },
      docs: {
        files: ['docs/source/**'],
        tasks: [
          'acetate:build'
        ]
      }
    },

    // Check Javascript for errors
    'jshint': {
      all: ['lib/js/calcite-web.js']
    },

    // Build CSS files from SASS
    'sass': {

      options: {
        includePaths: ['lib/sass/', 'node_modules/patterns-color/scss']
      },

      expanded: {
        src: 'lib/sass/calcite-web.scss',
        dest: 'dist/css/calcite-web.css'
      },

      doc: {
        expand: true,
        cwd: 'docs/source/assets/css',
        src: ['**/*.scss'],
        dest: 'docs/build/assets/css',
        ext: '.css'
      },

      homepage: {
        files: {
          'docs/build/assets/css/homepage.css': 'docs/source/assets/css/homepage.scss'
        }
      }
    },

    // Create minified version of build css
    'cssmin': {
      target: {
        files: {
          'dist/css/calcite-web.min.css': ['dist/css/calcite-web.css']
        }
      }
    },

    // Build minified Javascript file to dist
    'uglify': {
      options: {
        mangle: false,
        banner: banner
      },
      dist: {
        files: {
          'dist/js/calcite-web.min.js': ['lib/js/calcite-web.js']
        }
      }
    },

    // Copy libsass files to dist, doc assets to build
    'copy': {
      libsass: {
        expand: true,
        cwd: 'lib/',
        src: ['sass/**/*'],
        dest: 'dist/'
      },
      doc: {
        expand: true,
        cwd: 'docs/source/',
        src: ['assets/img/**/*', 'assets/js/**/*'],
        dest: 'docs/build/'
      }
    },

    // Copy Javascript to dist and doc
    'concat': {
      options: {
        banner: banner
      },
      dist: {
        files: {
          'dist/js/calcite-web.js': 'lib/js/calcite-web.js'
        }
      },
      doc: {
        files: {
          'docs/source/assets/js/libs/calcite-web.js': 'lib/js/calcite-web.js'
        }
      }
    },

    // Optimize images and icons for dist and doc
    'imagemin': {
      dist: {
        files: [{
          expand: true,
          cwd: 'lib/',
          src: ['img/**/*.{png,jpg,svg,ico}'],
          dest: 'dist/'
        }]
      },
      doc: {
        files: [{
          expand: true,
          cwd: 'lib/',
          src: ['img/**/*.{png,jpg,svg,ico}'],
          dest: 'docs/source/assets/'
        }]
      }
    },

    // Make a zip file of the dist folder
    'compress': {
      main: {
        options: {
          archive: 'calcite-web.zip'
        },
        files: [
          {
            src: ['dist/**', '!dist/__MACOSX'],
            dest: './'
          },
        ]
      }
    },

    // Upload dist folder to s3
    'aws_s3': {
      options: {
        region: 'us-west-1',
        bucket: 'patterns.esri.com',
        endpoint: 'https://s3-us-west-1.amazonaws.com',
        access: 'public-read',
        gzip: true
      },
      production: {
        files: [
          // Manually set content type (plugin was setting incorrectly).
          {expand: true, cwd: 'dist/', src: ['**/*.js'],   dest: 'files/calcite-web/' + currentVersion + '/', params: {ContentType: 'application/javascript'}},
          {expand: true, cwd: 'dist/', src: ['**/*.css'],  dest: 'files/calcite-web/' + currentVersion + '/', params: {ContentType: 'text/css'}},
          {expand: true, cwd: 'dist/', src: ['**/*.svg'],  dest: 'files/calcite-web/' + currentVersion + '/', params: {ContentType: 'image/svg+xml'}},
          {expand: true, cwd: 'dist/', src: ['**/*.ico'],  dest: 'files/calcite-web/' + currentVersion + '/', params: {ContentType: 'image/x-icon'}},
          {expand: true, cwd: 'dist/', src: ['**/*.jpg'],  dest: 'files/calcite-web/' + currentVersion + '/', params: {ContentType: 'image/jpg'}},
          {expand: true, cwd: 'dist/', src: ['**/*.map'],  dest: 'files/calcite-web/' + currentVersion + '/', params: {ContentType: 'application/javascript'}},
          {expand: true, cwd: 'dist/', src: ['**/*.json'], dest: 'files/calcite-web/', params: {ContentType: 'application/javascript'}}
        ]
      }
    },

    // Ask for AWS ID and Key
    'prompt': {
      aws: {
        options: {
          questions: [
            {
              config: 'aws_s3.options.accessKeyId',
              type: 'input',
              message: 'AWS Access ID:'
            },
            {
              config: 'aws_s3.options.secretAccessKey',
              type: 'input',
              message: 'AWS Secret Access Key:'
            }
          ]
        }
      }
    },

    // bin scripts
    'shell': {
      guid: {
        command: 'bin/guid.js',    // Generate a unique id for a new section
      },
      deploy: {
        command: 'bin/deploy.js',  // Create a JSON record of current documentation
      },
      release: {
        command: 'bin/release.sh'  // Create GitHub release that includes dist
      },
      icons: {
        command: 'bin/icons.js'    // Create a sass file with all icons from icon folder
      }
    },

    // Deploy doc site to gh-pages
    'gh-pages': {
      options: {
        base: 'docs/build',
        repo: 'https://github.com/Esri/calcite-web.git'
      },
      src: ['**']
    },

    // Runs tasks concurrently, speeding up Grunt
    'concurrent': {
      prepublish: [
        'scss',
        'uglify',
        'copy',
        'concat:dist',
        'newer:imagemin:dist'
      ]
    }

  });

  // load all grunt modules
  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

  // ┌─────────────┐
  // │ Grunt tasks │
  // └─────────────┘

  // Build sass
  grunt.registerTask('scss', [
    'sass',
    'cssmin'
  ]);

  // Run a development environment
  grunt.registerTask('dev', [
    'acetate:build',
    'newer:imagemin:doc',
    'concat:doc',
    'sass:doc',
    'copy:doc',
    'http-server',
    'watch'
  ]);

  // Test calcite-web.js
  grunt.registerTask('test', [
    'jshint'
  ]);

  // Build a dist folder with all assets
  grunt.registerTask('prepublish', [
    'shell:icons',
    'concurrent:prepublish'
  ]);

  // Upload files to s3
  grunt.registerTask('s3', [
    'prepublish',
    'shell:deploy',
    'prompt:aws',
    'aws_s3'
  ]);

  // Build and deploy doc site to github pages
  grunt.registerTask('deploy', 'Deploy documentation to github pages', function(n) {
    if (grunt.option('message')) {
      grunt.config.set('gh-pages.options.message', grunt.option('message'));
    }
    grunt.task.run([
      'acetate:build',
      'newer:imagemin:doc',
      'concat:doc',
      'sass:doc',
      'copy:doc',
      'shell:deploy',
      'gh-pages'
    ]);
  });

  // Release a new version of the framework
  grunt.registerTask('release', [
    'prepublish',
    'shell:deploy',
    'compress',
    'shell:release',
    's3'
  ]);

  // Default task starts up a dev environment
  grunt.registerTask('default', ['prepublish', 'dev']);

};
<|endoftext|>


<commit_before>'use strict';

angular.module('dropbox', [])
  .factory('Dropbox', function ($q, $http, $window, DropboxClientId, DropboxRedirectUri) {

    /**
     * Credentials
     */

    var oauth = {};

    /**
     * Dropbox API Servers
     */

    var authServer = 'https://www.dropbox.com'
      , apiServer  = 'https://api.dropbox.com'
      , fileServer = 'https://api-content.dropbox.com';

    /**
     * API Method URLs
     */

    var urls = {
      // Authentication.
      authorize:           authServer + '/1/oauth2/authorize',
      token:               apiServer  + '/1/oauth2/token',
      signOut:             apiServer  + '/1/unlink_access_token',

      // Accounts.
      accountInfo:         apiServer  + '/1/account/info',

      // Files and metadata.
      getFile:             fileServer + '/1/files/auto/',
      postFile:            fileServer + '/1/files/auto/',
      putFile:             fileServer + '/1/files_put/auto/',
      metadata:            apiServer  + '/1/metadata/auto/',
      delta:               apiServer  + '/1/delta',
      revisions:           apiServer  + '/1/revisions/auto/',
      restore:             apiServer  + '/1/restore/auto/',
      search:              apiServer  + '/1/search/auto/',
      shares:              apiServer  + '/1/shares/auto',
      media:               apiServer  + '/1/media/auto',
      copyRef:             apiServer  + '/1/copy_ref/auto',
      thumbnails:          fileServer + '/1/thumbnails/auto',
      chunkedUpload:       fileServer + '/1/chunked_upload',
      commitChunkedUpload: fileServer + '/1/commit_chunked_upload/auto',

      // File operations.
      fileopsCopy:         apiServer  + '/1/fileops/copy',
      fileopsCreateFolder: apiServer  + '/1/fileops/create_folder',
      fileopsDelete:       apiServer  + '/1/fileops/delete',
      fileopsMove:         apiServer  + '/1/fileops/move'
    };

    /**
     * OAuth 2.0 Signatures
     */

    function oauthHeader(options) {
      if (!options.headers) { options.headers = {}; }
      options.headers['Authorization'] = 'Bearer ' + oauth.access_token;
    }

    function oauthParams(options) {
      if (!options.params) { options.params = {}; }
      options.params.access_token = oauth.access_token;
    }

    /**
     * HTTP Request Helper
     */

    function request(config) {
      var deferred = $q.defer();

      oauthHeader(config);

      function success(response) {
        console.log(config, response.data);
        deferred.resolve(response.data);
      }

      function failure(fault) {
        console.log(config, fault);
        deferred.reject(fault);
      }

      $http(config).then(success, failure);
      return deferred.promise;
    }

    /**
     * HTTP GET Helper
     */

    function GET(url, params) {
      return request({
        method: 'GET',
        url: url,
        params: params
      });
    }

    /**
     * HTTP POST Helper
     */

    function POST(url, data, params) {
      return request({
        method: 'POST',
        url: url,
        data: data,
        params: params
      });
    }

    /**
     * Configure the authorize popup window
     * Adapted from dropbox-js
     */

    function popupSize(popupWidth, popupHeight) {
      var x0, y0, width, height, popupLeft, popupTop;

      // Metrics for the current browser window.
      x0 = $window.screenX || $window.screenLeft
      y0 = $window.screenY || $window.screenTop
      width = $window.outerWidth || $document.documentElement.clientWidth
      height = $window.outerHeight || $document.documentElement.clientHeight

      // Computed popup window metrics.
      popupLeft = Math.round(x0) + (width - popupWidth) / 2
      popupTop = Math.round(y0) + (height - popupHeight) / 2.5
      if (popupLeft < x0) { popupLeft = x0 }
      if (popupTop < y0) { popupTop = y0 }

      return 'width=' + popupWidth + ',height=' + popupHeight + ',' +
             'left=' + popupLeft + ',top=' + popupTop + ',' +
             'dialog=yes,dependent=yes,scrollbars=yes,location=yes';
    }

    /**
     * Parse credentials from Dropbox authorize callback
     * Adapted from dropbox-js
     */

    function queryParamsFromUrl(url) {
      var match = /^[^?#]+(\?([^\#]*))?(\#(.*))?$/.exec(url);
      if (!match) { return {}; }

      var query = match[2] || ''
        , fragment = match[4] || ''
        , fragmentOffset = fragment.indexOf('?')
        , params = {}
        ;

      if (fragmentOffset !== -1) {
        fragment = fragment.substring(fragmentOffset + 1);
      }

      var kvp = query.split('&').concat(fragment.split('&'));
      kvp.forEach(function (kv) {
        var offset = kv.indexOf('=');
        if (offset === -1) { return; }
        params[decodeURIComponent(kv.substring(0, offset))] =
               decodeURIComponent(kv.substring(offset + 1));
      });

      return params;
    }

    /**
     * Dropbox Service
     */

    return {

      urls: urls,                       // exposed for testing

      credentials: function () {
        return oauth;
      },

      authenticate: function () {
        var self = this
          , deferred = $q.defer()
          , redirectUri = DropboxRedirectUri
          , authUrl = urls.authorize
                    + '?client_id=' + DropboxClientId
                 // + '&state=' +
                    + '&response_type=token'
                    + '&redirect_uri=' + redirectUri

        function listener(event) {
          oauth = queryParamsFromUrl(event.data);
          self.oauth = oauth;
          deferred.resolve(oauth);
          console.log('Dropbox', self);
        }

        $window.addEventListener('message', listener, false);
        $window.open(authUrl,'_dropboxOauthSigninWindow', popupSize(700, 500));

        return deferred.promise;
      },

      isAuthenticated: function () {
        return (oauth.access_token) ? true : false
      },

      // signOut

      // signOff

      accountInfo: function () {
        return GET(urls.accountInfo);
      },

      userInfo: function () {
        return this.accountInfo();
      },

      readFile: function (path, params) {
        return GET(urls.getFile + path, params);
      },

      writeFile: function (path, content, params) {
        return request({
          method: 'POST',
          url: urls.putFile + path,
          data: content,
          headers: { 'Content-Type': undefined },
          transformRequest: angular.identity,
          params: params
        });
      },

      stat: function (path, params) {
        return GET(urls.metadata + path, params);
      },

      readdir: function (path, params) {
        var deferred = $q.defer();

        function success(stat) {
          var entries = stat.contents.map(function (entry) {
            return entry.path;
          });

          console.log('readdir of ' + path, entries);
          deferred.resolve();
        }

        function failure(fault) { deferred.reject(fault); }

        this.stat(path, params).then(success, failure);
        return deferred.promise;
      },

      metadata: function (path, params) {
        return this.stat(path, params);
      },

      // makeUrl

      history: function (path, params) {
        return GET(urls.revisions + path, params);
      },

      revisions: function (path, params) {
        return this.history(path, params);
      },

      thumbnailUrl: function (path, params) {
        return urls.thumbnails
             + path
             + '?format=jpeg&size=m&access_token='
             + oauth.access_token;
      },

      // readThumbnail

      revertFile: function (path, rev) {
        return POST(urls.restore + path, null, { rev: rev });
      },

      restore: function (path, rev) {
        return this.revertFile(path, rev);
      },

      findByName: function (path, pattern, params) {
        var params = params || {};
        params.query = pattern;

        return GET(urls.search + path, params);
      },

      search: function (path, pattern, params) {
        return this.findByName(path, pattern, params);
      },

      // makeCopyReference

      // copyRef

      // pullChanges

      // delta

      mkdir: function (path) {
        return POST(urls.fileopsCreateFolder, null, {
          root: 'auto',
          path: path
        });
      },

      remove: function (path) {
        return POST(urls.fileopsDelete, null, {
          root: 'auto',
          path: path
        });
      },

      unlink: function (path) {
        return this.remove(path);
      },

      delete: function (path) {
        return this.remove(path);
      },

      copy: function (from, to) {
        return POST(urls.fileopsCopy, null, {
          root: 'auto',
          to_path: to,
          from_path: from
        });
      },

      move: function (from, to) {
        return POST(urls.fileopsMove, null, {
          root: 'auto',
          to_path: to,
          from_path: from
        });
      },

      reset: function () {
        oauth = {};
      },

      setCredentials: function (credentials) {
        oauth = credentials;
      },

      // appHash

    };
  });
<commit_msg>define Dropbox service as a provider instead of factory<commit_after>'use strict';

angular.module('dropbox', [])

  .provider('Dropbox', function () {

    this.$get = [

      '$q',
      '$http',
      '$window',
      'DropboxClientId',
      'DropboxRedirectUri',

      function ($q, $http, $window, DropboxClientId, DropboxRedirectUri) {

        /**
         * Credentials
         */

        var oauth = {};

        /**
         * Dropbox API Servers
         */

        var authServer = 'https://www.dropbox.com'
          , apiServer  = 'https://api.dropbox.com'
          , fileServer = 'https://api-content.dropbox.com';

        /**
         * API Method URLs
         */

        var urls = {
          // Authentication.
          authorize:           authServer + '/1/oauth2/authorize',
          token:               apiServer  + '/1/oauth2/token',
          signOut:             apiServer  + '/1/unlink_access_token',

          // Accounts.
          accountInfo:         apiServer  + '/1/account/info',

          // Files and metadata.
          getFile:             fileServer + '/1/files/auto/',
          postFile:            fileServer + '/1/files/auto/',
          putFile:             fileServer + '/1/files_put/auto/',
          metadata:            apiServer  + '/1/metadata/auto/',
          delta:               apiServer  + '/1/delta',
          revisions:           apiServer  + '/1/revisions/auto/',
          restore:             apiServer  + '/1/restore/auto/',
          search:              apiServer  + '/1/search/auto/',
          shares:              apiServer  + '/1/shares/auto',
          media:               apiServer  + '/1/media/auto',
          copyRef:             apiServer  + '/1/copy_ref/auto',
          thumbnails:          fileServer + '/1/thumbnails/auto',
          chunkedUpload:       fileServer + '/1/chunked_upload',
          commitChunkedUpload: fileServer + '/1/commit_chunked_upload/auto',

          // File operations.
          fileopsCopy:         apiServer  + '/1/fileops/copy',
          fileopsCreateFolder: apiServer  + '/1/fileops/create_folder',
          fileopsDelete:       apiServer  + '/1/fileops/delete',
          fileopsMove:         apiServer  + '/1/fileops/move'
        };

        /**
         * OAuth 2.0 Signatures
         */

        function oauthHeader(options) {
          if (!options.headers) { options.headers = {}; }
          options.headers['Authorization'] = 'Bearer ' + oauth.access_token;
        }

        function oauthParams(options) {
          if (!options.params) { options.params = {}; }
          options.params.access_token = oauth.access_token;
        }

        /**
         * HTTP Request Helper
         */

        function request(config) {
          var deferred = $q.defer();

          oauthHeader(config);

          function success(response) {
            console.log(config, response.data);
            deferred.resolve(response.data);
          }

          function failure(fault) {
            console.log(config, fault);
            deferred.reject(fault);
          }

          $http(config).then(success, failure);
          return deferred.promise;
        }

        /**
         * HTTP GET Helper
         */

        function GET(url, params) {
          return request({
            method: 'GET',
            url: url,
            params: params
          });
        }

        /**
         * HTTP POST Helper
         */

        function POST(url, data, params) {
          return request({
            method: 'POST',
            url: url,
            data: data,
            params: params
          });
        }

        /**
         * Configure the authorize popup window
         * Adapted from dropbox-js
         */

        function popupSize(popupWidth, popupHeight) {
          var x0, y0, width, height, popupLeft, popupTop;

          // Metrics for the current browser window.
          x0 = $window.screenX || $window.screenLeft
          y0 = $window.screenY || $window.screenTop
          width = $window.outerWidth || $document.documentElement.clientWidth
          height = $window.outerHeight || $document.documentElement.clientHeight

          // Computed popup window metrics.
          popupLeft = Math.round(x0) + (width - popupWidth) / 2
          popupTop = Math.round(y0) + (height - popupHeight) / 2.5
          if (popupLeft < x0) { popupLeft = x0 }
          if (popupTop < y0) { popupTop = y0 }

          return 'width=' + popupWidth + ',height=' + popupHeight + ',' +
                 'left=' + popupLeft + ',top=' + popupTop + ',' +
                 'dialog=yes,dependent=yes,scrollbars=yes,location=yes';
        }

        /**
         * Parse credentials from Dropbox authorize callback
         * Adapted from dropbox-js
         */

        function queryParamsFromUrl(url) {
          var match = /^[^?#]+(\?([^\#]*))?(\#(.*))?$/.exec(url);
          if (!match) { return {}; }

          var query = match[2] || ''
            , fragment = match[4] || ''
            , fragmentOffset = fragment.indexOf('?')
            , params = {}
            ;

          if (fragmentOffset !== -1) {
            fragment = fragment.substring(fragmentOffset + 1);
          }

          var kvp = query.split('&').concat(fragment.split('&'));
          kvp.forEach(function (kv) {
            var offset = kv.indexOf('=');
            if (offset === -1) { return; }
            params[decodeURIComponent(kv.substring(0, offset))] =
                   decodeURIComponent(kv.substring(offset + 1));
          });

          return params;
        }

        /**
         * Dropbox Service
         */

        return {

          urls: urls,                       // exposed for testing

          credentials: function () {
            return oauth;
          },

          authenticate: function () {
            var self = this
              , deferred = $q.defer()
              , redirectUri = DropboxRedirectUri
              , authUrl = urls.authorize
                        + '?client_id=' + DropboxClientId
                     // + '&state=' +
                        + '&response_type=token'
                        + '&redirect_uri=' + redirectUri

            function listener(event) {
              oauth = queryParamsFromUrl(event.data);
              self.oauth = oauth;
              deferred.resolve(oauth);
              console.log('Dropbox', self);
            }

            $window.addEventListener('message', listener, false);
            $window.open(authUrl,'_dropboxOauthSigninWindow', popupSize(700, 500));

            return deferred.promise;
          },

          isAuthenticated: function () {
            return (oauth.access_token) ? true : false
          },

          // signOut

          // signOff

          accountInfo: function () {
            return GET(urls.accountInfo);
          },

          userInfo: function () {
            return this.accountInfo();
          },

          readFile: function (path, params) {
            return GET(urls.getFile + path, params);
          },

          writeFile: function (path, content, params) {
            return request({
              method: 'POST',
              url: urls.putFile + path,
              data: content,
              headers: { 'Content-Type': undefined },
              transformRequest: angular.identity,
              params: params
            });
          },

          stat: function (path, params) {
            return GET(urls.metadata + path, params);
          },

          readdir: function (path, params) {
            var deferred = $q.defer();

            function success(stat) {
              var entries = stat.contents.map(function (entry) {
                return entry.path;
              });

              console.log('readdir of ' + path, entries);
              deferred.resolve();
            }

            function failure(fault) { deferred.reject(fault); }

            this.stat(path, params).then(success, failure);
            return deferred.promise;
          },

          metadata: function (path, params) {
            return this.stat(path, params);
          },

          // makeUrl

          history: function (path, params) {
            return GET(urls.revisions + path, params);
          },

          revisions: function (path, params) {
            return this.history(path, params);
          },

          thumbnailUrl: function (path, params) {
            return urls.thumbnails
                 + path
                 + '?format=jpeg&size=m&access_token='
                 + oauth.access_token;
          },

          // readThumbnail

          revertFile: function (path, rev) {
            return POST(urls.restore + path, null, { rev: rev });
          },

          restore: function (path, rev) {
            return this.revertFile(path, rev);
          },

          findByName: function (path, pattern, params) {
            var params = params || {};
            params.query = pattern;

            return GET(urls.search + path, params);
          },

          search: function (path, pattern, params) {
            return this.findByName(path, pattern, params);
          },

          // makeCopyReference

          // copyRef

          // pullChanges

          // delta

          mkdir: function (path) {
            return POST(urls.fileopsCreateFolder, null, {
              root: 'auto',
              path: path
            });
          },

          remove: function (path) {
            return POST(urls.fileopsDelete, null, {
              root: 'auto',
              path: path
            });
          },

          unlink: function (path) {
            return this.remove(path);
          },

          delete: function (path) {
            return this.remove(path);
          },

          copy: function (from, to) {
            return POST(urls.fileopsCopy, null, {
              root: 'auto',
              to_path: to,
              from_path: from
            });
          },

          move: function (from, to) {
            return POST(urls.fileopsMove, null, {
              root: 'auto',
              to_path: to,
              from_path: from
            });
          },

          reset: function () {
            oauth = {};
          },

          setCredentials: function (credentials) {
            oauth = credentials;
          },

          // appHash

        };

      }];

  })

<|endoftext|>


<commit_before>// Tèsèvè - Gruntfile

var path = require( "path" ),
    execFile = require( "child_process" ).execFile,
    pkg = require( "./package.json" ),
    electron = require( "electron-prebuilt" );

var sAppName = "Teseve";

module.exports = function( grunt ) {

    require( "load-grunt-tasks" )( grunt );

    grunt.initConfig( {
        "IDENTITY": "Developer ID Application: flatLand!",
        "APPNAME": sAppName,

        // prepare build
        "copy": {
            "dev": {
                "files": [
                    {
                        "expand": true,
                        "cwd": ".",
                        "src": [
                            "package.json",
                            "app.js",
                            "app.html"
                        ],
                        "dest": "build/"
                    },
                    {
                        "expand": true,
                        "cwd": "assets/",
                        "src": [ "**/*" ],
                        "dest": "build/assets/"
                    },
                    {
                        "expand": true,
                        "cwd": "autoindexes/",
                        "src": [ "**/*" ],
                        "dest": "build/autoindexes/"
                    },
                    {
                        "expand": true,
                        "cwd": "css/",
                        "src": [ "**/*" ],
                        "dest": "build/css/"
                    },
                    {
                        "expand": true,
                        "cwd": "js/",
                        "src": [ "**/*" ],
                        "dest": "build/js/"
                    },
                    {
                        "expand": true,
                        "cwd": "views/",
                        "src": [ "**/*" ],
                        "dest": "build/views/"
                    },
                    {
                        "expand": true,
                        "cwd": "node_modules/",
                        "src": Object.keys( pkg.dependencies ).map( function( dep ) {
                            return dep + "/**/*";
                        } ),
                        "dest": "build/node_modules/"
                    }
                ]
            }
        },

        // electron
        "electron": {
            "windows": {
                "options": {
                    "name": sAppName,
                    "dir": "build/",
                    "out": "dist",
                    "version": pkg[ "electron-version" ],
                    "platform": "win32",
                    "arch": "x64",
                    "asar": true,
                    "icon": "./icon.ico"
                }
            },
            "osx": {
                "options": {
                    "name": sAppName,
                    "dir": "build/",
                    "out": "dist",
                    "version": pkg[ "electron-version" ],
                    "platform": "darwin",
                    "arch": "x64",
                    "asar": true,
                    "app-bundle-id": "com.flatland.app.teseve",
                    "app-version": pkg.version,
                    "icon": "./icon.icns"
                }
            }
        },

        // rcedit
        "rcedit": {
            "exes": {
                "files": [
                    {
                        "expand": true,
                        "cwd": "dist/" + sAppName + "-win32-x64",
                        "src": [ sAppName + ".exe" ]
                    }
                ],
                "options": {
                    "icon": "./icon.ico",
                    "file-version": pkg.version,
                    "product-version": pkg.version,
                    "version-string": {
                        "CompanyName": "flatLand!",
                        "ProductVersion": pkg.version,
                        "ProductName": sAppName,
                        "FileDescription": sAppName,
                        "InternalName": sAppName + ".exe",
                        "OriginalFilename": sAppName + ".exe",
                        "LegalCopyright": "Tèsèvè is free and unencumbered software released into the public domain, by flatLand!."
                    }
                }
            }
        },

        // shell
        "shell": {
            "electron": {
                "command": electron + " build",
                "options": {
                    "async": true,
                    "execOptions": {
                        "env": process.env
                    }
                }
            },
            "zip": {
                "command": "ditto -c -k --sequesterRsrc --keepParent dist/" + sAppName + "-darwin-x64/" + sAppName + ".app dist/" + sAppName + "-" + pkg.version + "-mac-x64.zip"
            }
        },

        // clean
        "clean": {
            "release": [
                "build/",
                "dist/"
            ]
        },

        // compress
        "compress": {
            "windows": {
                "options": {
                    "archive": "./dist/" + sAppName + "-" + pkg.version + "-win32-x64.zip",
                    "mode": "zip"
                },
                "files": [
                    {
                        "expand": true,
                        "dot": true,
                        "cwd": "./dist/" + sAppName + "-win32-x64",
                        "src": "**/*"
                    }
                ]
            },
        },

    } );

    grunt.registerTask( "default", [
        "newer:copy:dev",
        "shell:electron"
    ] );

    if( process.platform === "win32" ) {
        grunt.registerTask( "release", [
            "clean:release",
            "copy:dev",
            "electron:windows",
            "rcedit:exes",
            "compress"
        ] );
    } else {
        grunt.registerTask( "release", [
            "clean:release",
            "copy:dev",
            "electron:osx",
            "shell:zip"
        ] );
    }

    process.on( "SIGINT", function () {
        grunt.task.run( [ "shell:electron:kill" ] );
        process.exit( 1 );
    } );

};
<commit_msg>Fix build process<commit_after>// Tèsèvè - Gruntfile

var path = require( "path" ),
    execFile = require( "child_process" ).execFile,
    pkg = require( "./package.json" ),
    electron = require( "electron-prebuilt" );

var sAppName = "Teseve";

module.exports = function( grunt ) {

    require( "load-grunt-tasks" )( grunt );

    grunt.initConfig( {
        "IDENTITY": "Developer ID Application: flatLand!",
        "APPNAME": sAppName,

        // prepare build
        "copy": {
            "dev": {
                "files": [
                    {
                        "expand": true,
                        "cwd": ".",
                        "src": [
                            "package.json",
                            "app.js",
                            "app.html"
                        ],
                        "dest": "build/"
                    },
                    {
                        "expand": true,
                        "cwd": "assets/",
                        "src": [ "**/*" ],
                        "dest": "build/assets/"
                    },
                    {
                        "expand": true,
                        "cwd": "autoindexes/",
                        "src": [ "**/*" ],
                        "dest": "build/autoindexes/"
                    },
                    {
                        "expand": true,
                        "cwd": "css/",
                        "src": [ "**/*" ],
                        "dest": "build/css/"
                    },
                    {
                        "expand": true,
                        "cwd": "js/",
                        "src": [ "**/*" ],
                        "dest": "build/js/"
                    },
                    {
                        "expand": true,
                        "cwd": "views/",
                        "src": [ "**/*" ],
                        "dest": "build/views/"
                    }
                ]
            }
        },

        // electron
        "electron": {
            "windows": {
                "options": {
                    "name": sAppName,
                    "dir": "build/",
                    "out": "dist",
                    "version": pkg[ "electron-version" ],
                    "platform": "win32",
                    "arch": "x64",
                    "asar": true,
                    "icon": "./icon.ico"
                }
            },
            "osx": {
                "options": {
                    "name": sAppName,
                    "dir": "build/",
                    "out": "dist",
                    "version": pkg[ "electron-version" ],
                    "platform": "darwin",
                    "arch": "x64",
                    "asar": true,
                    "app-bundle-id": "com.flatland.app.teseve",
                    "app-version": pkg.version,
                    "icon": "./icon.icns"
                }
            }
        },

        // rcedit
        "rcedit": {
            "exes": {
                "files": [
                    {
                        "expand": true,
                        "cwd": "dist/" + sAppName + "-win32-x64",
                        "src": [ sAppName + ".exe" ]
                    }
                ],
                "options": {
                    "icon": "./icon.ico",
                    "file-version": pkg.version,
                    "product-version": pkg.version,
                    "version-string": {
                        "CompanyName": "flatLand!",
                        "ProductVersion": pkg.version,
                        "ProductName": sAppName,
                        "FileDescription": sAppName,
                        "InternalName": sAppName + ".exe",
                        "OriginalFilename": sAppName + ".exe",
                        "LegalCopyright": "Tèsèvè is free and unencumbered software released into the public domain, by flatLand!."
                    }
                }
            }
        },

        // shell
        "shell": {
            "electron": {
                "command": electron + " build",
                "options": {
                    "async": true,
                    "execOptions": {
                        "env": process.env
                    }
                }
            },
            "dependencies": {
                "command": "npm install --only=prod",
                "options": {
                    "async": true,
                    "execOptions": {
                        "cwd": __dirname + "/build",
                        "env": process.env
                    }
                }
            },
            "zip": {
                "command": "ditto -c -k --sequesterRsrc --keepParent dist/" + sAppName + "-darwin-x64/" + sAppName + ".app dist/" + sAppName + "-" + pkg.version + "-mac-x64.zip"
            }
        },

        // clean
        "clean": {
            "release": [
                "build/",
                "dist/"
            ]
        },

        // compress
        "compress": {
            "windows": {
                "options": {
                    "archive": "./dist/" + sAppName + "-" + pkg.version + "-win32-x64.zip",
                    "mode": "zip"
                },
                "files": [
                    {
                        "expand": true,
                        "dot": true,
                        "cwd": "./dist/" + sAppName + "-win32-x64",
                        "src": "**/*"
                    }
                ]
            },
        },

    } );

    grunt.registerTask( "default", [
        "newer:copy:dev",
        "shell:electron"
    ] );

    if( process.platform === "win32" ) {
        grunt.registerTask( "app", [
            "clean:release",
            "copy:dev",
            "shell:dependencies",
            "electron:windows",
            "rcedit:exes"
        ] );

        grunt.registerTask( "release", [
            "clean:release",
            "copy:dev",
            "shell:dependencies",
            "electron:windows",
            "rcedit:exes",
            "compress"
        ] );
    } else {
        grunt.registerTask( "app", [
            "clean:release",
            "copy:dev",
            "shell:dependencies",
            "electron:osx"
        ] );

        grunt.registerTask( "release", [
            "clean:release",
            "copy:dev",
            "shell:dependencies",
            "electron:osx",
            "shell:zip"
        ] );
    }

    process.on( "SIGINT", function () {
        grunt.task.run( [ "shell:electron:kill" ] );
        process.exit( 1 );
    } );

};
<|endoftext|>


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

  var path = require('path');

  function paths() {
    return require('./patternlab-config.json').paths;
  }

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    concat: {
      options: {
        stripBanners: true,
        banner: '/* \n * <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy") %> \n * \n * <%= pkg.author %>, and the web community.\n * Licensed under the <%= pkg.license %> license. \n * \n * Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice. \n *\n */\n\n'
      },
      patternlab: {
        src: './core/lib/patternlab.js',
        dest: './core/lib/patternlab.js'
      },
      object_factory: {
        src: './core/lib/object_factory.js',
        dest: './core/lib/object_factory.js'
      },
      lineage: {
        src: './core/lib/lineage_hunter.js',
        dest: './core/lib/lineage_hunter.js'
      },
      media_hunter: {
        src: './core/lib/media_hunter.js',
        dest: './core/lib/media_hunter.js'
      },
      patternlab_grunt: {
        src: './core/lib/patternlab_grunt.js',
        dest: './core/lib/patternlab_grunt.js'
      },
      patternlab_gulp: {
        src: './core/lib/patternlab_gulp.js',
        dest: './core/lib/patternlab_gulp.js'
      },
      parameter_hunter: {
        src: './core/lib/parameter_hunter.js',
        dest: './core/lib/parameter_hunter.js'
      },
      pattern_exporter: {
        src: './core/lib/pattern_exporter.js',
        dest: './core/lib/pattern_exporter.js'
      },
      pattern_assembler: {
        src: './core/lib/pattern_assembler.js',
        dest: './core/lib/pattern_assembler.js'
      },
      pseudopattern_hunter: {
        src: './core/lib/pseudopattern_hunter.js',
        dest: './core/lib/pseudopattern_hunter.js'
      },
      list_item_hunter: {
        src: './core/lib/list_item_hunter.js',
        dest: './core/lib/list_item_hunter.js'
      },
      style_modifier_hunter: {
        src: './core/lib/style_modifier_hunter.js',
        dest: './core/lib/style_modifier_hunter.js'
      }
    },
    copy: {
      main: {
        files: [{
          expand: true,
          cwd: path.resolve(paths().source.js),
          src: '*.js',
          dest: path.resolve(paths().public.js)
        }, {
          expand: true,
          cwd: path.resolve(paths().source.css),
          src: '*.css',
          dest: path.resolve(paths().public.css)
        }, {
          expand: true,
          cwd: path.resolve(paths().source.images),
          src: ['**/*.png', '**/*.jpg', '**/*.gif', '**/*.jpeg'],
          dest: path.resolve(paths().public.images)
        }, {
          expand: true,
          cwd: path.resolve(paths().source.fonts),
          src: '*',
          dest: path.resolve(paths().public.fonts)
        }, {
          expand: true,
          cwd: path.resolve(paths().source.data),
          src: 'annotations.js',
          dest: path.resolve(paths().public.data)
        }]
      },
      styleguide: {
        files: [{
          expand: true,
          cwd: path.resolve(paths().source.styleguide),
          src: ['*.*', '**/*.*'],
          dest: path.resolve(paths().public.styleguide)
        }]
      }
    },
    watch: {
      all: {
        files: [
          path.resolve(paths().source.css + '**/*.scss'),
          path.resolve(paths().source.css + '**/*.css'),
          path.resolve(paths().source.styleguide + 'css/*.css'),
          path.resolve(paths().source.patterns + '**/*.mustache'),
          path.resolve(paths().source.patterns + '**/*.json'),
          path.resolve(paths().source.fonts + '/*'),
          path.resolve(paths().source.images + '/*'),
          path.resolve(paths().source.data + '*.json'),
          path.resolve(paths().source.js + '/*.js')
        ],
        tasks: ['default', 'bsReload:css']
      }
    },
    nodeunit: {
      all: ['test/*_tests.js']
    },
    browserSync: {
      dev: {
        options: {
          server: path.resolve(paths().public.root),
          watchTask: true,
          watchOptions: {
            ignoreInitial: true,
            ignored: '*.html'
          },
          snippetOptions: {
            // Ignore all HTML files within the templates folder
            blacklist: ['/index.html', '/', '/?*']
          },
          plugins: [{
            module: 'bs-html-injector',
            options: {
              files: [path.resolve(paths().public.root + '/index.html'), path.resolve(paths().public.styleguide + '/styleguide.html')]
            }
          }],
          notify: {
            styles: [
              'display: none',
              'padding: 15px',
              'font-family: sans-serif',
              'position: fixed',
              'font-size: 1em',
              'z-index: 9999',
              'bottom: 0px',
              'right: 0px',
              'border-top-left-radius: 5px',
              'background-color: #1B2032',
              'opacity: 0.4',
              'margin: 0',
              'color: white',
              'text-align: center'
            ]
          }
        }
      }
    },
    eslint: {
      options: {
        configFile: './.eslintrc'
      },
      target: ['./core/lib/*']
    },
    bsReload: {
      css: path.resolve(paths().public.root + '**/*.css')
    },
    sass: {
      options: {
        sourceMap: true
      },
      dist: {
        files: {
          'source/css/style.css': 'source/css/style.scss'
        }
      }
    }
  });

  // load all grunt tasks
  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
  // grunt.loadNpmTasks('grunt-sass');
  //load the patternlab task
  grunt.task.loadTasks('./core/lib/');

  grunt.registerTask('default', ['patternlab', 'sass', 'copy:main', 'copy:styleguide']);

  // travis CI task
  grunt.registerTask('travis', ['nodeunit', 'eslint', 'patternlab']);

  grunt.registerTask('serve', ['patternlab', 'sass', 'copy:main', 'copy:styleguide', 'browserSync', 'watch:all']);

  grunt.registerTask('build', ['nodeunit', 'eslint', 'concat']);

};<commit_msg>Stop watching css files as causing double reload<commit_after>module.exports = function(grunt) {

  var path = require('path');

  function paths() {
    return require('./patternlab-config.json').paths;
  }

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    concat: {
      options: {
        stripBanners: true,
        banner: '/* \n * <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy") %> \n * \n * <%= pkg.author %>, and the web community.\n * Licensed under the <%= pkg.license %> license. \n * \n * Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice. \n *\n */\n\n'
      },
      patternlab: {
        src: './core/lib/patternlab.js',
        dest: './core/lib/patternlab.js'
      },
      object_factory: {
        src: './core/lib/object_factory.js',
        dest: './core/lib/object_factory.js'
      },
      lineage: {
        src: './core/lib/lineage_hunter.js',
        dest: './core/lib/lineage_hunter.js'
      },
      media_hunter: {
        src: './core/lib/media_hunter.js',
        dest: './core/lib/media_hunter.js'
      },
      patternlab_grunt: {
        src: './core/lib/patternlab_grunt.js',
        dest: './core/lib/patternlab_grunt.js'
      },
      patternlab_gulp: {
        src: './core/lib/patternlab_gulp.js',
        dest: './core/lib/patternlab_gulp.js'
      },
      parameter_hunter: {
        src: './core/lib/parameter_hunter.js',
        dest: './core/lib/parameter_hunter.js'
      },
      pattern_exporter: {
        src: './core/lib/pattern_exporter.js',
        dest: './core/lib/pattern_exporter.js'
      },
      pattern_assembler: {
        src: './core/lib/pattern_assembler.js',
        dest: './core/lib/pattern_assembler.js'
      },
      pseudopattern_hunter: {
        src: './core/lib/pseudopattern_hunter.js',
        dest: './core/lib/pseudopattern_hunter.js'
      },
      list_item_hunter: {
        src: './core/lib/list_item_hunter.js',
        dest: './core/lib/list_item_hunter.js'
      },
      style_modifier_hunter: {
        src: './core/lib/style_modifier_hunter.js',
        dest: './core/lib/style_modifier_hunter.js'
      }
    },
    copy: {
      main: {
        files: [{
          expand: true,
          cwd: path.resolve(paths().source.js),
          src: '*.js',
          dest: path.resolve(paths().public.js)
        }, {
          expand: true,
          cwd: path.resolve(paths().source.css),
          src: '*.css',
          dest: path.resolve(paths().public.css)
        }, {
          expand: true,
          cwd: path.resolve(paths().source.images),
          src: ['**/*.png', '**/*.jpg', '**/*.gif', '**/*.jpeg'],
          dest: path.resolve(paths().public.images)
        }, {
          expand: true,
          cwd: path.resolve(paths().source.fonts),
          src: '*',
          dest: path.resolve(paths().public.fonts)
        }, {
          expand: true,
          cwd: path.resolve(paths().source.data),
          src: 'annotations.js',
          dest: path.resolve(paths().public.data)
        }]
      },
      styleguide: {
        files: [{
          expand: true,
          cwd: path.resolve(paths().source.styleguide),
          src: ['*.*', '**/*.*'],
          dest: path.resolve(paths().public.styleguide)
        }]
      }
    },
    watch: {
      all: {
        files: [
          path.resolve(paths().source.css + '**/*.scss'),
          path.resolve(paths().source.styleguide + 'css/*.css'),
          path.resolve(paths().source.patterns + '**/*.mustache'),
          path.resolve(paths().source.patterns + '**/*.json'),
          path.resolve(paths().source.fonts + '/*'),
          path.resolve(paths().source.images + '/*'),
          path.resolve(paths().source.data + '*.json'),
          path.resolve(paths().source.js + '/*.js')
        ],
        tasks: ['default', 'bsReload:css']
      }
    },
    nodeunit: {
      all: ['test/*_tests.js']
    },
    browserSync: {
      dev: {
        options: {
          server: path.resolve(paths().public.root),
          watchTask: true,
          watchOptions: {
            ignoreInitial: true,
            ignored: '*.html'
          },
          snippetOptions: {
            // Ignore all HTML files within the templates folder
            blacklist: ['/index.html', '/', '/?*']
          },
          plugins: [{
            module: 'bs-html-injector',
            options: {
              files: [path.resolve(paths().public.root + '/index.html'), path.resolve(paths().public.styleguide + '/styleguide.html')]
            }
          }],
          notify: {
            styles: [
              'display: none',
              'padding: 15px',
              'font-family: sans-serif',
              'position: fixed',
              'font-size: 1em',
              'z-index: 9999',
              'bottom: 0px',
              'right: 0px',
              'border-top-left-radius: 5px',
              'background-color: #1B2032',
              'opacity: 0.4',
              'margin: 0',
              'color: white',
              'text-align: center'
            ]
          }
        }
      }
    },
    eslint: {
      options: {
        configFile: './.eslintrc'
      },
      target: ['./core/lib/*']
    },
    bsReload: {
      css: path.resolve(paths().public.root + '**/*.css')
    },
    sass: {
      options: {
        sourceMap: true
      },
      dist: {
        files: {
          'source/css/style.css': 'source/css/style.scss'
        }
      }
    }
  });

  // load all grunt tasks
  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
  // grunt.loadNpmTasks('grunt-sass');
  //load the patternlab task
  grunt.task.loadTasks('./core/lib/');

  grunt.registerTask('default', ['patternlab', 'sass', 'copy:main', 'copy:styleguide']);

  // travis CI task
  grunt.registerTask('travis', ['nodeunit', 'eslint', 'patternlab']);

  grunt.registerTask('serve', ['patternlab', 'sass', 'copy:main', 'copy:styleguide', 'browserSync', 'watch:all']);

  grunt.registerTask('build', ['nodeunit', 'eslint', 'concat']);

};<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        jshint: {
            allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'],
            options: {
                jshintrc: '.jshintrc',
            }
        },
        mochacli: {
            all: ['test/**/*.js'],
            options: {
                reporter: 'spec',
                ui: 'tdd'
            }
        },
        'mocha_istanbul': {
            coveralls: {
                src: [ 'test/lib', 'test/lib/utils' ],
                options: {
                    coverage: true,
                    legend: true,
                    check: {
                        lines: 97,
                        statements: 98
                    },
                    root: './lib',
                    reportFormats: ['lcov']
                }
            }
        }
    })

    grunt.event.on('coverage', function(lcov, done){
        require('coveralls').handleInput(lcov, function(error) {
            if (error) {
                console.log(error)
                return done(error)
            }
            done()
        })
    })

    // Load the plugins
    grunt.loadNpmTasks('grunt-contrib-jshint')
    grunt.loadNpmTasks('grunt-mocha-cli')
    grunt.loadNpmTasks('grunt-mocha-istanbul')

    // Configure tasks
    grunt.registerTask('coveralls', ['mocha_istanbul:coveralls'])
    grunt.registerTask('default', ['test'])

    grunt.registerTask('test', ['mochacli', 'jshint', 'coveralls'])
}
<commit_msg>100% coverage from the start, hell yeah!<commit_after>'use strict';

module.exports = function(grunt) {

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        jshint: {
            allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'],
            options: {
                jshintrc: '.jshintrc',
            }
        },
        mochacli: {
            all: ['test/**/*.js'],
            options: {
                reporter: 'spec',
                ui: 'tdd'
            }
        },
        'mocha_istanbul': {
            coveralls: {
                src: [ 'test/lib', 'test/lib/utils' ],
                options: {
                    coverage: true,
                    legend: true,
                    check: {
                        lines: 100,
                        statements: 100
                    },
                    root: './lib',
                    reportFormats: ['lcov']
                }
            }
        }
    })

    grunt.event.on('coverage', function(lcov, done){
        require('coveralls').handleInput(lcov, function(error) {
            if (error) {
                console.log(error)
                return done(error)
            }
            done()
        })
    })

    // Load the plugins
    grunt.loadNpmTasks('grunt-contrib-jshint')
    grunt.loadNpmTasks('grunt-mocha-cli')
    grunt.loadNpmTasks('grunt-mocha-istanbul')

    // Configure tasks
    grunt.registerTask('coveralls', ['mocha_istanbul:coveralls'])
    grunt.registerTask('default', ['test'])

    grunt.registerTask('test', ['mochacli', 'jshint', 'coveralls'])
}
<|endoftext|>


<commit_before>describe('Testing Core', function() {
  afterEach(function() {
    Core.stopAll();
  });
  it('Should create a new module', function() {
    Core.register('tweet', function() {});

    expect(Core.modules['tweet']).not.toBeUndefined();
  });

  it('Should start a new module');

  it('Should stop a new module');

  it('Should start all modules');

  it('Should stop all modules');

  it('Should throw an error when a module is not defined');

  it('Should trigger init when the module is started');

  it('Should trigger init from the modules that where started');

  it('Should trigger destroy when module is stoped');

  it('Should trigger destroy from the modules that where stoped');

  it('Should extend a different component into Core extensions');

  it('Should return the registered extension');
});
<commit_msg>update tests startin and stoping modules<commit_after>describe('Testing Core', function() {
  afterEach(function() {
    Core.stopAll();
    Core.modules = {};
  });
  it('Should create a new module', function() {
    Core.register('tweet', function() {});

    expect(Core.modules['tweet']).not.toBeUndefined();
  });

  it('Should start a new module', function() {
    Core.register('tweet', function() {});
    Core.start('tweet');

    expect(Core.modules.tweet.instance).not.toBeNull();
  });

  it('Should stop a new module', function() {
    Core.register('tweet', function() {});
    Core.start('tweet');
    Core.stop('tweet');

    expect(Core.modules.tweet.instance).toBeNull();
  });

  it('Should start all modules', function() {
    Core.register('tweet1', function() {});
    Core.register('tweet2', function() {});
    Core.register('tweet3', function() {});

    Core.startAll();

    expect(Core.modules.tweet1.instance).not.toBeNull();
    expect(Core.modules.tweet2.instance).not.toBeNull();
    expect(Core.modules.tweet3.instance).not.toBeNull();
  });

  it('Should stop all modules', function() {
    Core.register('tweet1', function() {});
    Core.register('tweet2', function() {});
    Core.register('tweet3', function() {});

    Core.startAll();
    Core.stopAll();

    expect(Core.modules.tweet1.instance).toBeNull();
    expect(Core.modules.tweet2.instance).toBeNull();
    expect(Core.modules.tweet3.instance).toBeNull();
  });

  it('Should throw an error when a module is not defined');

  it('Should trigger init when the module is started');

  it('Should trigger init from the modules that where started');

  it('Should trigger destroy when module is stoped');

  it('Should trigger destroy from the modules that where stoped');

  it('Should extend a different component into Core extensions');

  it('Should return the registered extension');
});
<|endoftext|>


<commit_before>/*global module:false*/
module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({

    pasteup: {
      version: grunt.file.readJSON('bower.json').version,
      dist: "build/artifacts"
    },

    copy: {
      dist: {
        files: [
          {src: ['js/lib/**'], dest: '<%= pasteup.dist %>/'},
          {src: ['i/**'], dest: '<%= pasteup.dist %>/<%= pasteup.version %>/'}
        ]
      }
    },

    less: {
      production: {
        files: {
          "<%= pasteup.dist %>/<%= pasteup.version %>/css/core.pasteup.min.css": "less/core.pasteup.less",
          "<%= pasteup.dist %>/<%= pasteup.version %>/css/layout.pasteup.min.css": "less/layout.pasteup.less",
          "<%= pasteup.dist %>/<%= pasteup.version %>/css/pasteup.min.css": "less/pasteup.less"
        },
        options: {
          compress: true
        }
      }
    },

    sass: {
      dist: {
        files: {
          "<%= pasteup.dist %>/<%= pasteup.version %>/css/responsive-layout.pasteup.min.css": "sass/layout/responsive-grid.scss"
        },
        options: {
          style: 'compressed'
        },
      }
    },

    requirejs: {
      compile: {
        options: {
          baseUrl: "js/modules",
          dir: "<%= pasteup.dist %>/<%= pasteup.version %>/js/modules",
          modules: [
            {
              name: "main"
            }
          ]
        }
      }
    },

    zip: {
      build: {
        cwd: 'build',
        src: ['<%= pasteup.dist %>/**'],
        dest: '<%= pasteup.dist %>.zip'
      }
    },

    watch: {
      scripts: {
        files: 'js/**/*.js',
        tasks: ['requirejs']
      },
      less: {
        files: 'less/**/*.less',
        tasks: ['less']
      },
      docs: {
        files: ['build/templates/*.html', 'docs/**/*.html'],
        tasks: ['docs']
      }
    }

  });

  // Register the default task which does the full build.
  grunt.registerTask('default', ['less', 'requirejs', 'copy', 'docs', 'server', 'watch']);
  grunt.registerTask('build', ['less', 'requirejs', 'copy', 'docs', 'zip']);

  // Load tasks.
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-contrib-sass');
  grunt.loadNpmTasks('grunt-contrib-requirejs');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-zip');
  grunt.loadTasks('build');

};
<commit_msg>Run Sass on default and build tasks.<commit_after>/*global module:false*/
module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({

    pasteup: {
      version: grunt.file.readJSON('bower.json').version,
      dist: "build/artifacts"
    },

    copy: {
      dist: {
        files: [
          {src: ['js/lib/**'], dest: '<%= pasteup.dist %>/'},
          {src: ['i/**'], dest: '<%= pasteup.dist %>/<%= pasteup.version %>/'}
        ]
      }
    },

    less: {
      production: {
        files: {
          "<%= pasteup.dist %>/<%= pasteup.version %>/css/core.pasteup.min.css": "less/core.pasteup.less",
          "<%= pasteup.dist %>/<%= pasteup.version %>/css/layout.pasteup.min.css": "less/layout.pasteup.less",
          "<%= pasteup.dist %>/<%= pasteup.version %>/css/pasteup.min.css": "less/pasteup.less"
        },
        options: {
          compress: true
        }
      }
    },

    sass: {
      dist: {
        files: {
          "<%= pasteup.dist %>/<%= pasteup.version %>/css/responsive-layout.pasteup.min.css": "sass/layout/responsive-grid.scss"
        },
        options: {
          style: 'compressed'
        },
      }
    },

    requirejs: {
      compile: {
        options: {
          baseUrl: "js/modules",
          dir: "<%= pasteup.dist %>/<%= pasteup.version %>/js/modules",
          modules: [
            {
              name: "main"
            }
          ]
        }
      }
    },

    zip: {
      build: {
        cwd: 'build',
        src: ['<%= pasteup.dist %>/**'],
        dest: '<%= pasteup.dist %>.zip'
      }
    },

    watch: {
      scripts: {
        files: 'js/**/*.js',
        tasks: ['requirejs']
      },
      less: {
        files: 'less/**/*.less',
        tasks: ['less']
      },
      docs: {
        files: ['build/templates/*.html', 'docs/**/*.html'],
        tasks: ['docs']
      }
    }

  });

  // Register the default task which does the full build.
  grunt.registerTask('default', ['less', 'sass', 'requirejs', 'copy', 'docs', 'server', 'watch']);
  grunt.registerTask('build', ['less', 'sass', 'requirejs', 'copy', 'docs', 'zip']);

  // Load tasks.
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-contrib-sass');
  grunt.loadNpmTasks('grunt-contrib-requirejs');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-zip');
  grunt.loadTasks('build');

};
<|endoftext|>


<commit_before>/*
 * grunt-contrib-compress
 * http://gruntjs.com/
 *
 * Copyright (c) 2012 Chris Talkington, contributors
 * Licensed under the MIT license.
 */

module.exports = function(grunt) {
  'use strict';

  // Project configuration.
  grunt.initConfig({
    jshint: {
      all: [
        'Gruntfile.js',
        'tasks/*.js',
        '<%= nodeunit.tests %>'
      ],
      options: {
        jshintrc: '.jshintrc'
      }
    },

    // Before generating any new files, remove any previously-created files.
    clean: {
      test: ['tmp']
    },

    test_vars: {
      name: 'grunt-contrib-compress',
      version: '0.1.0'
    },

    files: {
      compress_test: 'folder_one'
    },

    // Configuration to be run (and then tested).
    compress: {
      zip: {
        options: {
          archive: 'tmp/compress_test_files.zip'
        },
        files: [
          {expand: true, cwd: 'test/fixtures/', src: ['**/*']}
        ]
      },
      tar: {
        options: {
          archive: 'tmp/compress_test_files.tar'
        },
        files: [
          {expand: true, cwd: 'test/fixtures', src: ['**/*']}
        ]
      },
      tgz: {
        options: {
          archive: 'tmp/compress_test_files.tgz'
        },
        files: [
          {expand: true, cwd: 'test/fixtures', src: ['**/*']}
        ]
      },
      gzip: {
        expand: true,
        cwd: 'test/fixtures/',
        src: ['**/*.{css,html,js}'],
        dest: 'tmp/gzip/',
        options: {
          mode: 'gzip'
        }
      }
    },

    // Unit tests.
    nodeunit: {
      tests: ['test/*_test.js']
    }
  });

  // Actually load this plugin's task(s).
  grunt.loadTasks('tasks');

  // These plugins provide necessary tasks.
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-nodeunit');
  grunt.loadNpmTasks('grunt-contrib-internal');

  // Whenever the "test" task is run, first clean the "tmp" dir, then run this
  // plugin's task(s), then test the result.
  grunt.registerTask('test', ['clean', 'compress', 'nodeunit']);

  // By default, lint and run all tests.
  grunt.registerTask('default', ['jshint', 'test', 'build-contrib']);

};<commit_msg>Remove unused config in Gruntfile<commit_after>/*
 * grunt-contrib-compress
 * http://gruntjs.com/
 *
 * Copyright (c) 2012 Chris Talkington, contributors
 * Licensed under the MIT license.
 */

module.exports = function(grunt) {
  'use strict';

  // Project configuration.
  grunt.initConfig({
    jshint: {
      all: [
        'Gruntfile.js',
        'tasks/*.js',
        '<%= nodeunit.tests %>'
      ],
      options: {
        jshintrc: '.jshintrc'
      }
    },

    // Before generating any new files, remove any previously-created files.
    clean: {
      test: ['tmp']
    },

    // Configuration to be run (and then tested).
    compress: {
      zip: {
        options: {
          archive: 'tmp/compress_test_files.zip'
        },
        files: [
          {expand: true, cwd: 'test/fixtures/', src: ['**/*']}
        ]
      },
      tar: {
        options: {
          archive: 'tmp/compress_test_files.tar'
        },
        files: [
          {expand: true, cwd: 'test/fixtures', src: ['**/*']}
        ]
      },
      tgz: {
        options: {
          archive: 'tmp/compress_test_files.tgz'
        },
        files: [
          {expand: true, cwd: 'test/fixtures', src: ['**/*']}
        ]
      },
      gzip: {
        expand: true,
        cwd: 'test/fixtures/',
        src: ['**/*.{css,html,js}'],
        dest: 'tmp/gzip/',
        options: {
          mode: 'gzip'
        }
      }
    },

    // Unit tests.
    nodeunit: {
      tests: ['test/*_test.js']
    }
  });

  // Actually load this plugin's task(s).
  grunt.loadTasks('tasks');

  // These plugins provide necessary tasks.
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-nodeunit');
  grunt.loadNpmTasks('grunt-contrib-internal');

  // Whenever the "test" task is run, first clean the "tmp" dir, then run this
  // plugin's task(s), then test the result.
  grunt.registerTask('test', ['clean', 'compress', 'nodeunit']);

  // By default, lint and run all tests.
  grunt.registerTask('default', ['jshint', 'test', 'build-contrib']);

};<|endoftext|>