X-Git-Url: https://pwan.org/git/?p=tech-radar.git;a=blobdiff_plain;f=gulpfile.js;h=509a7301ddfd3ef115c555e2bded2744c6f30555;hp=884422b622cfde3306a4519f7b4e4c6cc396d261;hb=00e75b3dd3d8b1c07046ef8685a9aff976aa41e0;hpb=3cd044c7edd4b73fac124a43fcdccb3a00f5811e diff --git a/gulpfile.js b/gulpfile.js index 884422b..509a730 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -7,7 +7,8 @@ var gulp = require('gulp') , uglify = require('gulp-uglify') , clean = require('gulp-clean') , header = require('gulp-header') - , files; + , files + , paths; banner = [ @@ -18,6 +19,10 @@ banner = [ '' ].join('\n'); +paths = { + DEPS: ['bower_components/chance/chance.js', 'bower_components/d3/d3.min.js'] +}; + files = { LIB: 'bower_components/d3/*.min.js', NS: 'src/namespaces.js', @@ -53,7 +58,31 @@ gulp.task('compress', function() { .pipe(gulp.dest('./dist/')) }); +gulp.task('deps', function () { + gulp.src(paths.DEPS.concat('./dist/**/*.*')) + .pipe(gulp.dest('./examples')); +}); + gulp.task('dist', ['clean', 'concat', 'compress', 'sass']); +gulp.task('examples', ['clean', 'concat', 'compress', 'sass', 'deps']); + +gulp.task('gh-pages', function () { + var ghpages = require('gh-pages') + , path = require('path') + , options = {}; + + options.logger = console.log.bind(this); + + function callback(err) { + if (err) { + console.error('Error publishing to gh-pages', err); + } else { + console.log('Successfully published to gh-pages'); + } + } + + ghpages.publish(path.join(__dirname, './examples'), options, callback); +}); gulp.task('test', function (){ var karma;