diff --git a/Gruntfile.js b/Gruntfile.js index 65b6409..04de279 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -58,6 +58,39 @@ module.exports = function(grunt) { background: false, singleRun: true, browsers: ['PhantomJS'] + }, + ci: { + sauceLabs: { + testName: 'Bronson Unit Tests' + }, + singleRun: true, + customLaunchers: { + sl_chrome: { + base: 'SauceLabs', + browserName: 'chrome', + platform: 'Windows 7', + version: '35' + }, + sl_firefox: { + base: 'SauceLabs', + browserName: 'firefox', + version: '30' + }, + sl_ios_safari: { + base: 'SauceLabs', + browserName: 'iphone', + platform: 'OS X 10.9', + version: '7.1' + }, + sl_ie_11: { + base: 'SauceLabs', + browserName: 'internet explorer', + platform: 'Windows 8.1', + version: '11' + } + }, + browsers: ['sl_chrome', 'sl_firefox', 'sl_ie_11'], + reporters: ['dots', 'saucelabs'] } }, bump: { diff --git a/bower.json b/bower.json index 17b1506..13e5965 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "bronsonjs", - "version": "2.0.13", + "version": "2.0.14", "description": "AMD module framework for building large scale javascript applications", "homepage": "https://github.com/eclifford/bronson", "authors": [ diff --git a/bronson.js b/bronson.js index 109bc42..6cce1e6 100644 --- a/bronson.js +++ b/bronson.js @@ -20,7 +20,7 @@ 'use strict'; var Bronson = { - version: '2.0.13', + version: '2.0.14', settings: { options: { @@ -443,7 +443,7 @@ continue; var isObj = typeof source === 'object', - isArray = toString.call(source) == '[object Array]'; + isArray = Object.prototype.toString.call(source) == '[object Array]'; if(isArray) { dest = dest || []; diff --git a/bronson.min.js b/bronson.min.js index cb2da4d..d0d2ccf 100644 --- a/bronson.min.js +++ b/bronson.min.js @@ -1 +1 @@ -/*! bronsonjs - v2.0.13 - eclifford - 2014-07-03 */!function(a,b){"function"==typeof define&&define.amd?define([],function(){return a.Bronson=b(a)}):"undefined"!=typeof exports?module.exports=b(a):a.Bronson=b(a)}(this,function(){"use strict";var a={version:"2.0.13",settings:{options:{autoload:!0,autostart:!0,permissions:!1},success:function(){},error:function(){}},modules:{},events:{},publish:function(b){var c,d,e,f,g=/^[a-z]+((:[a-z]+){1})$/,h=b.toLowerCase(),i=[];if(!g.test(h))throw new Error("Bronson.publish: event name must be in format subscriber of channel:topic");if(i=h.split(":"),c=i[0],d=i[1],a.events[c]&&a.events[c][d]){e=a.events[c][d].slice(),f=[].slice.call(arguments,1);for(var j in e)e[j].callback.apply(e[j].context,f)}},subscribe:function(b,c,d){var e,f,g,h,i=/^[a-zA-Z0-9]+((:[a-zA-Z0-9]+){2})$/,j=b.toLowerCase();if(!i.test(j))throw new Error("Bronson.subscribe: event "+j+" must be in format subscriber or subscriber:channel:topic");if("undefined"!=typeof c&&null!==c&&"function"!=typeof c)throw new Error("Bronson.subscribe: callback must be a function");if(e=j.split(":"),f=e[0],g=e[1],h=e[2],this.settings.permissions&&!a.Permissions.validate(f,g))throw new Error("Bronson.subscribe: permissions do not allow this subscriber to listen to that channel");this.events[g]||(this.events[g]={}),this.events[g][h]=this.events[g][h]?this.events[g][h]:[],this.events[g][h].push({subscriber:f,context:d||this,callback:c})},unsubscribe:function(a){var b,c,d,e,f,g=/^[a-zA-Z0-9]+((:[a-zA-Z0-9]+){2})?$/,h=a.toLowerCase(),i=[];if(!g.test(h))throw new Error("Bronson.unsubscribe: event must be in format subscriber or subscriber:channel:topic");if(i=h.split(":"),b=i[0],c=i[1],d=i[2],1===i.length)for(c in this.events)for(d in this.events[c])for(e=this.events[c][d].length-1;e>=0;e--)this.events[c][d][e].subscriber===b&&this.events[c][d].splice(e,1);else for(e=this.events[c][d].length-1;e>=0;e--)f=this.events[c][d][e],f.subscriber===b&&this.events[c][d].splice(e,1)},load:function(b){if(!b)throw new Error("Bronson.load: must supply valid parameter modules");b instanceof Array||(b=[b]);for(var c=0;c - 2014-08-01 */!function(a,b){"function"==typeof define&&define.amd?define([],function(){return a.Bronson=b(a)}):"undefined"!=typeof exports?module.exports=b(a):a.Bronson=b(a)}(this,function(){"use strict";var a={version:"2.0.14",settings:{options:{autoload:!0,autostart:!0,permissions:!1},success:function(){},error:function(){}},modules:{},events:{},publish:function(b){var c,d,e,f,g=/^[a-z]+((:[a-z]+){1})$/,h=b.toLowerCase(),i=[];if(!g.test(h))throw new Error("Bronson.publish: event name must be in format subscriber of channel:topic");if(i=h.split(":"),c=i[0],d=i[1],a.events[c]&&a.events[c][d]){e=a.events[c][d].slice(),f=[].slice.call(arguments,1);for(var j in e)e[j].callback.apply(e[j].context,f)}},subscribe:function(b,c,d){var e,f,g,h,i=/^[a-zA-Z0-9]+((:[a-zA-Z0-9]+){2})$/,j=b.toLowerCase();if(!i.test(j))throw new Error("Bronson.subscribe: event "+j+" must be in format subscriber or subscriber:channel:topic");if("undefined"!=typeof c&&null!==c&&"function"!=typeof c)throw new Error("Bronson.subscribe: callback must be a function");if(e=j.split(":"),f=e[0],g=e[1],h=e[2],this.settings.permissions&&!a.Permissions.validate(f,g))throw new Error("Bronson.subscribe: permissions do not allow this subscriber to listen to that channel");this.events[g]||(this.events[g]={}),this.events[g][h]=this.events[g][h]?this.events[g][h]:[],this.events[g][h].push({subscriber:f,context:d||this,callback:c})},unsubscribe:function(a){var b,c,d,e,f,g=/^[a-zA-Z0-9]+((:[a-zA-Z0-9]+){2})?$/,h=a.toLowerCase(),i=[];if(!g.test(h))throw new Error("Bronson.unsubscribe: event must be in format subscriber or subscriber:channel:topic");if(i=h.split(":"),b=i[0],c=i[1],d=i[2],1===i.length)for(c in this.events)for(d in this.events[c])for(e=this.events[c][d].length-1;e>=0;e--)this.events[c][d][e].subscriber===b&&this.events[c][d].splice(e,1);else for(e=this.events[c][d].length-1;e>=0;e--)f=this.events[c][d][e],f.subscriber===b&&this.events[c][d].splice(e,1)},load:function(b){if(!b)throw new Error("Bronson.load: must supply valid parameter modules");b instanceof Array||(b=[b]);for(var c=0;c