{"size": 1931, "ext": "js", "max_stars_repo_path": "frontend/gulpfile.js", "max_stars_repo_name": "popen2/runny", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "frontend/gulpfile.js", "max_issues_repo_name": "popen2/runny", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "frontend/gulpfile.js", "max_forks_repo_name": "popen2/runny", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.1971830986, "max_line_length": 90, "alphanum_fraction": 0.5525634386}
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var ngAnnotate = require('gulp-ng-annotate');
var sass = require('gulp-sass');
var minifyCSS = require('gulp-minify-css');
var jade = require('gulp-jade');
var templateCache = require('gulp-angular-templatecache');

var dirs = {
    scripts:   'src/scripts',
    styles:    'src/styles',
    index:     'src/templates/index.jade',
    partials:  'src/templates/partials',
    resources: 'resources',
    dest:      '../static'
};

gulp.task('scripts', function() {
    gulp.src([dirs.scripts + '/**/*.module.js',
              dirs.scripts + '/**/*.js'])
        .pipe(ngAnnotate())
        .pipe(concat('runny.js'))
        .pipe(uglify())
        .pipe(gulp.dest(dirs.dest))
    ;
});

gulp.task('styles', function() {
    gulp.src([dirs.styles + '/runny.scss'])
        .pipe(sass())
        .pipe(minifyCSS())
        .pipe(gulp.dest(dirs.dest))
    ;
});

gulp.task('index', function() {
    gulp.src([dirs.index])
        .pipe(jade())
        .pipe(gulp.dest(dirs.dest))
    ;
});

gulp.task('partials', function() {
    gulp.src([dirs.partials + '/**/*.jade'])
        .pipe(jade())
        .pipe(templateCache({
            root: '/inline',
            module: 'runny.templates',
            standalone: true
        }))
        .pipe(gulp.dest(dirs.dest))
    ;
});

gulp.task('resources', function() {
    gulp.src([dirs.resources + '/**'])
        .pipe(gulp.dest(dirs.dest))
    ;
});

gulp.task('default', ['scripts', 'styles', 'index', 'partials', 'resources'], function() {
    gulp.watch([dirs.scripts + '/**'], ['scripts']);
    gulp.watch([dirs.styles + '/**'], ['styles']);
    gulp.watch([dirs.index], ['index']);
    gulp.watch([dirs.partials + '/**'], ['partials']);
    gulp.watch([dirs.resources + '/**'], ['resources']);
});

gulp.task('build', ['scripts', 'styles', 'index', 'partials', 'resources']);
