diff --git a/extras/handler/legacy.js b/extras/handler/legacy.js index 03e8ae4..c67ab14 100644 --- a/extras/handler/legacy.js +++ b/extras/handler/legacy.js @@ -10,9 +10,9 @@ }); function resolve() { - var self = this, - deferred = self.deferred, - probe = settings[self.path] && settings[self.path].probe, + var self = this, + dfd = self.dfd, + probe = settings[self.path] && settings[self.path].probe, result; handlerModule.process(self); @@ -20,20 +20,33 @@ if(probe && (result = probe())) { provide(function() { return result; }); } else { - deferred.reject(new Failure('error probing', self.path)); + dfd.reject(new Failure('error probing', self.path)); } } function HandlerLegacy() {} HandlerLegacy.prototype = { - onPreProcess: function(dependency) { + onPreRequest: function(dependency) { var dependencies = settings[dependency.path] && settings[dependency.path].dependencies; + handlerModule.onPreRequest(dependency); + if(dependencies) { dependency.enqueue = demand.apply(null, dependencies); } }, + onPreProcess: function(dependency) { + var dependencies; + + if(!dependency.enqueue) { + dependencies = settings[dependency.path] && settings[dependency.path].dependencies; + + if(dependencies) { + dependency.enqueue = demand.apply(null, dependencies); + } + } + }, process: function(dependency) { var boundResolve = resolve.bind(dependency); @@ -44,7 +57,7 @@ .then( boundResolve, function() { - dependency.deferred.reject(new Failure('error resolving', dependency.path, arguments)); + dependency.dfd.reject(new Failure('error resolving', dependency.path, arguments)); } ) } diff --git a/extras/plugin/sri.js b/extras/plugin/sri.js index 65aaaca..383f5a5 100644 --- a/extras/plugin/sri.js +++ b/extras/plugin/sri.js @@ -599,7 +599,7 @@ if(options = isEnabled(dependency.path)) { if(hash(options.type, dependency.source) !== options.hash) { - dependency.deferred.reject(new Failure('error resolving (sri)', dependency.id)); + dependency.dfd.reject(new Failure('error resolving (sri)', dependency.id)); } } }); diff --git a/gulp/tasks/bump.js b/gulp/tasks/bump.js index c13a259..85822f6 100644 --- a/gulp/tasks/bump.js +++ b/gulp/tasks/bump.js @@ -1,6 +1,7 @@ var gulp = require('gulp'), plugins = require('gulp-load-plugins')(), config = require('../config'), + shared = require('../shared'), id = 'bump', task = config.tasks[id]; @@ -9,20 +10,20 @@ module.exports = gulp; gulp.task(id + ':patch', function() { return gulp.src(task.watch) .pipe(plugins.bump({ type: 'patch' })) - .pipe(plugins.chmod(0o644)) + .pipe(plugins.chmod(shared.rights)) .pipe(gulp.dest('./')); }); gulp.task(id + ':minor', function() { return gulp.src(task.watch) .pipe(plugins.bump({ type: 'minor' })) - .pipe(plugins.chmod(0o644)) + .pipe(plugins.chmod(shared.rights)) .pipe(gulp.dest('./')); }); gulp.task(id + ':major', function() { return gulp.src(task.watch) .pipe(plugins.bump({ type: 'major' })) - .pipe(plugins.chmod(0o644)) + .pipe(plugins.chmod(shared.rights)) .pipe(gulp.dest('./')); }); \ No newline at end of file