Example #1
0
    expandItemByFS: function(item) {

        var _this = this,
            tech = this.tech;

        return Q.step.apply(Q, tech.getContext().getLevels().map(function(level) {

            return function() {

                var path = tech.getPath(item.buildLevelPath(level));

                return tech.readContent(path, tech.getTechName())
                    .then(function(content) {
                        if(!content) return;
                        try {
                            _this.parse(VM.runInThisContext(content), item);
                        } catch(e) {
                            return Q.reject(path + '\n' + e.stack);
                        }
                    })

            }

        }))

    },
Example #2
0
 expandOnceByFS: function() {
     var newDeps = this.clone();
     return Q.step.apply(Q, this.map(function(item) {
             return function() {
                 return newDeps.expandItemByFS(item)
             }
         }))
         .then(function() { return newDeps })
 },