async.each(opts.sizes, function (size, cb) {
    var 
      imgStream = fs.createReadStream(imagePath),
      basename = path.basename(imagePath),
      sizeInText = lib.format('_{0}_', size),
      outputPath = path.join(opts.outputFolder, 
        sizeInText, 
        path.relative(opts.relativePath, imagePath)
      );

    mkdirp(path.dirname(outputPath), function (err) {
      if (err) {
        throw err;
      }

      gm(imgStream, basename)
        .resize(size, size, '%')
        .write(outputPath, function (err) {
          if (err) {
            throw err;
          }
          cb && cb();
        });

    });
  }, function () {
Example #2
0
      command: function ( file ) {
        var filesOrFolders = [ 'Gruntfile.js',
          'grunt-deps/config-loader.js',
          'grunt-deps/config/',
          'grunt-deps/tasks/',
          'frontend-app/'
        ];

        if ( file ) {
          filesOrFolders = [ file ];
        }

        return lib.format( 'node_modules/docco-husky/bin/generate {0}', filesOrFolders.join( ' ' ));
      }
  process : function (files, options) {
    var dfd = Deferred();
    var opts = {
      maxConcurrent : 25
    };

    lib.extend(opts, options);

    async.eachLimit(files, opts.maxConcurrent, function (file, cb) {
      doResize(file, opts).done(function () {
        dfd.notify({
          file : file
        });
        cb && cb();
      });
      
    }, function () {
      dfd.resolve();
    });

    return dfd.promise();
  }
Example #4
0
      command: function ( glob ) {

        if ( glob ) {
          return lib.format( 'node_modules/codepainter/bin/codepaint xform -j {0} "{1}"',
            'grunt-deps/codepainter.json', glob );
        }

        // ** sourceFilesGlobs**
        //
        // globs to point to all the source files in this project
        var sourceFilesGlobs = [
          'frontend-app/journal/**/*.js',
          'frontend-app/tests/**/*.js',
          'frontend-app/reader-refresh/**/*.js',
          'frontend-app/flashcards/**/*.js',
          'Gruntfile.js',
          'grunt-deps/**/*.js, !grunt-deps/pre-push.js'
        ];

        return sourceFilesGlobs.map(function ( glob ) {
          return lib.format( 'node_modules/codepainter/bin/codepaint xform -j {0} "{1}"',
            'grunt-deps/codepainter.json', glob );
        } ).join( ' && ' );
      }
Example #5
0
 return sourceFilesGlobs.map(function ( glob ) {
   return lib.format( 'node_modules/codepainter/bin/codepaint xform -j {0} "{1}"',
     'grunt-deps/codepainter.json', glob );
 } ).join( ' && ' );