build/updates/builder.js
function (cb) {
            var self = this,
                info = self.options.external;

            if (!info) {
                cb();
                return;
            }
            if (!info.merge) {
                info.merge = 'mix';
            }
            if (!info.data) {
                Y.log('External config found but no data path defined, skipping import.', 'warn', 'builder');
                cb();
                return;
            }
            if (!Y.Lang.isArray(info.data)) {
                info.data = [info.data];
            }
            Y.log('Importing external documentation data.', 'info', 'builder');

            var stack = new Y.Parallel();
            info.data.forEach(function (i) {
                var base;
                if (i.match(/^https?:\/\//)) {
                    base = i.replace('data.json', '');
                    Y.use('io-base', stack.add(function () {
                        Y.log('Fetching: ' + i, 'info', 'builder');
                        Y.io(i, {
                            on: {
                                complete: stack.add(function (id, e) {
                                    Y.log('Received: ' + i, 'info', 'builder');
                                    var data = JSON.parse(e.responseText);
                                    data.base = base;
                                    //self.options.externalData = Y.mix(self.options.externalData || {}, data);
                                    if (!self.options.externalData) {
                                        self.options.externalData = [];
                                    }
                                    self.options.externalData.push(data);
                                })
                            }
                        });
                    }));
                } else {
                    base = path.dirname(path.resolve(i));
                    var data = Y.Files.getJSON(i);
                    data.base = base;
                    //self.options.externalData = Y.mix(self.options.externalData || {}, data);
                    if (!self.options.externalData) {
                        self.options.externalData = [];
                    }
                    self.options.externalData.push(data);
                }
            });

            stack.done(function () {
                Y.log('Finished fetching remote data', 'info', 'builder');
                self._mixExternal();
                cb();
            });
        }
function (cb) {
            var self = this,
                info = self.options.external;

            if (!info) {
                cb();
                return;
            }
            if (!info.merge) {
                info.merge = 'mix';
            }
            if (!info.data) {
                Y.log('External config found but no data path defined, skipping import.', 'warn', 'builder');
                cb();
                return;
            }
            if (!Y.Lang.isArray(info.data)) {
                info.data = [info.data];
            }
            Y.log('Importing external documentation data.', 'info', 'builder');

            var stack = new Y.Parallel();
            info.data.forEach(function (i) {
                var base;
                if (i.match(/^https?:\/\//)) {
                    base = i.replace('data.json', '');
                    Y.use('io-base', stack.add(function () {
                        Y.log('Fetching: ' + i, 'info', 'builder');
                        Y.io(i, {
                            on: {
                                complete: stack.add(function (id, e) {
                                    Y.log('Received: ' + i, 'info', 'builder');
                                    var data = JSON.parse(e.responseText);
                                    data.base = base;
                                    //self.options.externalData = Y.mix(self.options.externalData || {}, data);
                                    if (!self.options.externalData) {
                                        self.options.externalData = [];
                                    }
                                    self.options.externalData.push(data);
                                })
                            }
                        });
                    }));
                } else {
                    base = path.dirname(path.resolve(i));
                    var data = Y.Files.getJSON(i);
                    data.base = base;
                    //self.options.externalData = Y.mix(self.options.externalData || {}, data);
                    if (!self.options.externalData) {
                        self.options.externalData = [];
                    }
                    self.options.externalData.push(data);
                }
            });

            stack.done(function () {
                Y.log('Finished fetching remote data', 'info', 'builder');
                self._mixExternal();
                cb();
            });
        }
function ( cb ) { var self = this , info = self . options . external ; if ( ! info ) { cb ( ) ; return ; } if ( ! info . merge ) { info . merge = 'mix' ; } if ( ! info . data ) { Y . log ( 'External config found but no data path defined, skipping import.' , 'warn' , 'builder' ) ; cb ( ) ; return ; } if ( ! Y . Lang . isArray ( info . data ) ) { info . data = [ info . data ] ; } Y . log ( 'Importing external documentation data.' , 'info' , 'builder' ) ; var stack = new Y . Parallel ( ) ; info . data . forEach ( function ( i ) { var base ; if ( i . match ( / ^https?:\/\/ / ) ) { base = i . replace ( 'data.json' , '' ) ; Y . use ( 'io-base' , stack . add ( function ( ) { Y . log ( 'Fetching: ' + i , 'info' , 'builder' ) ; Y . io ( i , { on : { complete : stack . add ( function ( id , e ) { Y . log ( 'Received: ' + i , 'info' , 'builder' ) ; var data = JSON . parse ( e . responseText ) ; data . base = base ; //self.options.externalData = Y.mix(self.options.externalData || {}, data); if ( ! self . options . externalData ) { self . options . externalData = [ ] ; } self . options . externalData . push ( data ) ; } ) } } ) ; } ) ) ; } else { base = path . dirname ( path . resolve ( i ) ) ; var data = Y . Files . getJSON ( i ) ; data . base = base ; //self.options.externalData = Y.mix(self.options.externalData || {}, data); if ( ! self . options . externalData ) { self . options . externalData = [ ] ; } self . options . externalData . push ( data ) ; } } ) ; stack . done ( function ( ) { Y . log ( 'Finished fetching remote data' , 'info' , 'builder' ) ; self . _mixExternal ( ) ; cb ( ) ; } ) ; }
Fetches the remote data and fires the callback when it's all complete
@method mixExternal
@param {Callback} cb The callback to execute when complete
@async
Fetches the remote data and fires the callback when it s all complete