diff --git a/Gruntfile.js b/Gruntfile.js index 325871a..fd4c365 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -16,10 +16,10 @@ module.exports = function(grunt) { }, copy: { - dist: { - files: { - 'tmp/doNotKillAlmond/': 'test/fixtures/*.js' - } + main: { + files: [ + {src: ['test/fixtures/*.js'], dest: 'tmp/doNotKillAlmond/', flatten: true, filter: 'isFile'}, // includes files in path + ] } }, @@ -34,7 +34,7 @@ module.exports = function(grunt) { }, rmCombined: { options: { - baseUrl: 'tmp/doNotKillAlmond', + baseUrl: 'tmp/doNotKillAlmond/test/fixtures', name: 'project', out: 'tmp/requirejs-killed.js', almond: true, @@ -104,58 +104,33 @@ module.exports = function(grunt) { // build all the projects from the ´examples´ folder // to run some tests against them grunt.registerTask('buildExampleProjects', function () { - var done = this.async(), - util = grunt.utils || grunt.util, - preparation = [false, false, false, false], - checkForPreparation = function () { - if (util._.all(preparation, util._.identity)) { - grunt.log.ok('all examples build'); - done(); - } - }; - - // build libglobal example - util.spawn({ - cmd: 'grunt', - args: ['build', '--force'], - opts: {cwd: 'examples/libglobal'} - }, function () { - grunt.log.writeln('> "libglobal" example build'); - preparation[0] = true; - checkForPreparation(); - }); - - // build libglobal-hybrid example - util.spawn({ - cmd: 'grunt', - args: ['build', '--force'], - opts: {cwd: 'examples/libglobal-hybrid'} - }, function () { - grunt.log.writeln('> "libglobal-hybrid" example build'); - preparation[3] = true; - checkForPreparation(); - }); + var done = this.async(); + var util = grunt.util; + var examples = 'libglobal libglobal-hybrid multipage multipage-shim'.split(' '); + var preparation = []; + + var checkForPreparation = function () { + if (util._.all(preparation, util._.identity)) { + grunt.log.ok('all examples build'); + done(); + } + }; - // build multipage example - util.spawn({ - cmd: 'grunt', - args: ['build', '--force'], - opts: {cwd: 'examples/multipage'} - }, function () { - grunt.log.writeln('> "multipage" example build'); - preparation[1] = true; - checkForPreparation(); + examples.forEach(function () { + preparation.push(false); }); - // build multipage-shim example - util.spawn({ - cmd: 'grunt', - args: ['build', '--force'], - opts: {cwd: 'examples/multipage-shim'} - }, function () { - grunt.log.writeln('> "multipage-shim" example build'); - preparation[2] = true; - checkForPreparation(); + // build examples + examples.forEach(function (example, idx) { + util.spawn({ + cmd: 'grunt', + args: ['build', '--force'], + opts: {cwd: 'examples/' + example} + }, function () { + grunt.log.writeln('> "' + example + '" example build'); + preparation[idx] = true; + checkForPreparation(); + }); }); }); @@ -172,5 +147,5 @@ module.exports = function(grunt) { grunt.registerTask('setUp', ['buildExampleProjects', 'copy', 'requirejs']); // Default task. - grunt.registerTask('default', ['setUp', 'jshint', 'nodeunit', 'clean']); + grunt.registerTask('default', ['setUp', 'jshint', 'nodeunit', 'qunit', 'clean']); }; diff --git a/examples/libglobal-hybrid/dist/principium.js b/examples/libglobal-hybrid/dist/principium.js index edfd552..faf05d0 100644 --- a/examples/libglobal-hybrid/dist/principium.js +++ b/examples/libglobal-hybrid/dist/principium.js @@ -1,9 +1,9 @@ //Copyright 2012, etc. /** - * almond 0.2.3 Copyright (c) 2011-2012, The Dojo Foundation All Rights Reserved. + * almond 0.2.5 Copyright (c) 2011-2012, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/almond for details */ -(function(e,t){typeof define=="function"&&define.amd?define(["jquery","underscore"],t):e.principium=t(e.$,e._)})(this,function(e,t){var n,r,i;return function(e){function d(e,t){return h.call(e,t)}function v(e,t){var n,r,i,s,o,u,a,f,c,h,p=t&&t.split("/"),d=l.map,v=d&&d["*"]||{};if(e&&e.charAt(0)===".")if(t){p=p.slice(0,p.length-1),e=p.concat(e.split("/"));for(f=0;f0&&(e.splice(f-1,2),f-=2)}}e=e.join("/")}else e.indexOf("./")===0&&(e=e.substring(2));if((p||v)&&d){n=e.split("/");for(f=n.length;f>0;f-=1){r=n.slice(0,f).join("/");if(p)for(c=p.length;c>0;c-=1){i=d[p.slice(0,c).join("/")];if(i){i=i[r];if(i){s=i,o=f;break}}}if(s)break;!u&&v&&v[r]&&(u=v[r],a=f)}!s&&u&&(s=u,o=a),s&&(n.splice(0,o,s),e=n.join("/"))}return e}function m(t,n){return function(){return s.apply(e,p.call(arguments,0).concat([t,n]))}}function g(e){return function(t){return v(t,e)}}function y(e){return function(t){a[e]=t}}function b(n){if(d(f,n)){var r=f[n];delete f[n],c[n]=!0,t.apply(e,r)}if(!d(a,n)&&!d(c,n))throw new Error("No "+n);return a[n]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e){return function(){return l&&l.config&&l.config[e]||{}}}var t,s,o,u,a={},f={},l={},c={},h=Object.prototype.hasOwnProperty,p=[].slice;o=function(e,t){var n,r=w(e),i=r[0];return e=r[1],i&&(i=v(i,t),n=b(i)),i?n&&n.normalize?e=n.normalize(e,g(t)):e=v(e,t):(e=v(e,t),r=w(e),i=r[0],e=r[1],i&&(n=b(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},u={require:function(e){return m(e)},exports:function(e){var t=a[e];return typeof t!="undefined"?t:a[e]={}},module:function(e){return{id:e,uri:"",exports:a[e],config:E(e)}}},t=function(t,n,r,i){var s,l,h,p,v,g=[],w;i=i||t;if(typeof r=="function"){n=!n.length&&r.length?["require","exports","module"]:n;for(v=0;v0&&(e.splice(f-1,2),f-=2)}}e=e.join("/")}else e.indexOf("./")===0&&(e=e.substring(2));if((p||v)&&d){n=e.split("/");for(f=n.length;f>0;f-=1){r=n.slice(0,f).join("/");if(p)for(c=p.length;c>0;c-=1){i=d[p.slice(0,c).join("/")];if(i){i=i[r];if(i){s=i,o=f;break}}}if(s)break;!u&&v&&v[r]&&(u=v[r],a=f)}!s&&u&&(s=u,o=a),s&&(n.splice(0,o,s),e=n.join("/"))}return e}function m(t,n){return function(){return s.apply(e,p.call(arguments,0).concat([t,n]))}}function g(e){return function(t){return v(t,e)}}function y(e){return function(t){a[e]=t}}function b(n){if(d(f,n)){var r=f[n];delete f[n],c[n]=!0,t.apply(e,r)}if(!d(a,n)&&!d(c,n))throw new Error("No "+n);return a[n]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e){return function(){return l&&l.config&&l.config[e]||{}}}var t,s,o,u,a={},f={},l={},c={},h=Object.prototype.hasOwnProperty,p=[].slice;o=function(e,t){var n,r=w(e),i=r[0];return e=r[1],i&&(i=v(i,t),n=b(i)),i?n&&n.normalize?e=n.normalize(e,g(t)):e=v(e,t):(e=v(e,t),r=w(e),i=r[0],e=r[1],i&&(n=b(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},u={require:function(e){return m(e)},exports:function(e){var t=a[e];return typeof t!="undefined"?t:a[e]={}},module:function(e){return{id:e,uri:"",exports:a[e],config:E(e)}}},t=function(t,n,r,i){var s,l,h,p,v,g=[],w;i=i||t;if(typeof r=="function"){n=!n.length&&r.length?["require","exports","module"]:n;for(v=0;v