Adds files mtimes to all corresponding objects in `files`.

@param {Object} files
@param {Object} metalsmith
@param {Function} done
@api private
760716
function addAllMtimes(files, metalsmith, done) {

  var source = metalsmith.source();

  // File system will be accessed for each element so iterate in parallel.
  each(Object.keys(files), getAddMtime, done);


  /**
   * Gets mtime of given `file` and adds it to metadata.
   *
   * @param {String} file
   * @param {Function} done
   * @api private
   */

  function getAddMtime(file, done) {
    fs.stat(path.join(source, file), addMtime);


    /**
     * Adds `stats.mtime` of `file` to its metadata.
     *
     * @param {Error} err
     * @param {fs.Stats} stats
     * @api private
     */

    function addMtime(err, stats) {
      if (err) {
        // Skip elements of `files` that don't point to existing files.
        // This can happen if some other Metalsmith plugin does something
        // strange with `files`.
        if (err.code === 'ENOENT') {
          debug('file %s not found', file);
          return done();
        }
        return done(err);
      }

      debug('mtime of file %s is %s', file, stats.mtime);
      files[file].mtime = stats.mtime;
      done();
    }
  }
}
963037
public MultiFileResource add(File... files) {
		for (File file : files) {
			this.add(new FileResource(file));
		}
		return this;
	}
857154
function (ui, done) {

        var elems = ui.pluginManager.hook("elements");
        var bs    = ui.bs;

        if (!Object.keys(elems).length) {
            return done();
        }

        ui.setOption("clientFiles", Immutable.fromJS(elems));

        done(null, {
            instance: {
                enableElement:  require("./client-elements").enable(ui.clients, ui, bs),
                disableElement: require("./client-elements").disable(ui.clients, ui, bs),
                addElement:     require("./client-elements").addElement
            }
        });
    }
1255923
function(done) {
    this.async = true;
    var self = this;

    function finish(err, file) {
      var hasCallback = (typeof done === 'function');
      if (err && !hasCallback) return self.emit('error', err);
      if (err) return done(err);
      done(null, file);
    }

    if (this.data) {
      this.createFile(this.file, this.uri, this.file, this.data, finish).parse(finish);
    } else {
      this.resolve(this.file, this.cwd, function(err, file) {
        if (err) return finish(err);
        file.parse(finish);
      });
    }

    return this;
  }
830605
public void addClassesToCheck(Iterable<File> files) throws IOException {
    logger.info("Loading classes to check...");
    for (final File f : files) {
      addClassToCheck(f);
    }
  }
338972
function setFilesets(path, done) {
    var config = JSON.parse(fs.readFileSync(path, 'utf8'));

    /* jshint sub: true */
    var includeFiles = config['includeFiles'];
    var excludeFiles = config['excludeFiles'];
    var filterFiles = config['lintOnly'];
    /* jshint sub: false */

    if (filterFiles && !Array.isArray(filterFiles)) {
        filterFiles = [];
        console.log(chalk.yellow('invalid `lintOnly` set; ignoring'));
    }

    if (includeFiles && Array.isArray(includeFiles)) {
        filesets.include(includeFiles, filterFiles);
    } else {
        console.log(chalk.yellow('valid `includeFiles` not found in %s'), path);
    }

    if (excludeFiles && Array.isArray(includeFiles)) {
        filesets.exclude(excludeFiles);
    } else {
        console.log(chalk.yellow('valid `excludeFiles` not found in %s'), path);
    }

    done();
}
1361069
function() {
          return through.obj(function(file, encode, done){
            addBefore(file.path);
            this.push(file);
            done();
          });
        }
203563
function(dir, files){		
		fs.readdirSync(dir).forEach(function(file){
			try{
				var current = path.join(dir, file);
				var stat = fs.statSync(current);
				if (stat && stat.isDirectory()) {
					getAllFiles(current, files);
				}else {
				    files.push(current);
				}
			}catch(e){
				console.error(e);
			}
        });
	}
1306153
function(){
		STATIC_FILES.forEach(function(file){
			addFile(fs.createReadStream(__dirname + '/templates/' + file), { name: file });
		});
	}
677712
function inspect(options){
   options = normalize(options);

   return function(files, metalsmith, done) {

      if (options.disable)
      return done();

      //try {
         var bigJSObject = {};

         if (options.includeMetalsmith) {
            bigJSObject[options.includeMetalsmith] = metalsmith.metadata();
         }

         Object.keys(files).forEach(function(filePath){
            var inData = files[filePath];

            if (options.fileFilter(filePath, inData, metalsmith)) {
               var outData = {};
               Object.keys(inData).forEach(function(key) {
                  if (options.accept(key, inData)) {
                     outData[key] = inData[key];
                  }
               });

               if (!options.contentsAsBuffer && outData.contents)
               outData.contents = inData.contents.toString();

               bigJSObject[filePath] = outData;
            }

         });

         options.printfn(bigJSObject);
         done();

   //   }
   //   catch (err) {
   //      done(err);
   //   }
  };

/**
 * Normalize an `options` dictionary.
 *
 * @param {Object} options
 */

 function normalize(options){
    options = options || {};

    options.printfn = options.printfn || function(obj) {
      console.dir(obj, {colors: true});
    };

   if (!options.accept) {
      if (options.include) {
         options.accept = function(propKey) { return options.include.indexOf(propKey) >= 0; };
      }
      else if (options.exclude){
         options.accept = function(propKey) { return options.exclude.indexOf(propKey) < 0; };
      }
      else {
         options.accept = function() { return true; };
      }
   }

   options.fileFilter = fileFilter(options.filter);

   return options;
};


/* calculate file filter function */
function fileFilter(filter) {
  if (filter) {
     if (typeof filter === 'string') {
        var regex = new RegExp(filter);
        return function(filePath) { return regex.test(filePath); }
     }
     else if (filter instanceof RegExp)
        return function(filePath) { return filter.test(filePath); }
     else {   // must be a function itself
        return filter;
     }
   }
   else  // none, return "pass all"
      return function() { return true; };
}



}
1132604
function filterFile(file, done) {
      // Ensure it matches the extension.
      const correctExtention = path.extname(file) === opts.extname

      // Make sure it has defined files.
      const hasFiles = files[file].files
      done(null, correctExtention && hasFiles)
    }
564579
function plugin(options){
  options = options || {};
  var keys = options.keys || [];

  return function(files, metalsmith, done){
    setImmediate(done);
    var md = new MarkdownIt(options);
    Object.keys(files).forEach(function(file){
      if (!markdown(file)) return;
      var data = files[file];
      var dir = dirname(file);
      var html = basename(file, extname(file)) + '.html';
      if ('.' != dir) html = dir + '/' + html;

      var str = md.render(data.contents.toString());
      data.contents = new Buffer(str);
      keys.forEach(function(key) {
        data[key] = md.render(data[key]);
      });

      delete files[file];
      files[html] = data;
    });
  };
}
830596
function(){
		for(var i=0; i<DYNAMIC_FILES.length; i++) {
			addFile(dynamicFilesCompiled[i](options), { name: DYNAMIC_FILES[i] });
		}
	}
681133
function concatenateFile(file, done) {
      // Append the concat file itself to the end of the concatenation.
      files[file].files.push(file)

      // Make sure the output is defined.
      if (!Object.prototype.hasOwnProperty.call(files[file], 'output')) {
        // Output the file to the destination, without the ".concat".
        const dir = path.dirname(file)
        const filename = path.basename(file, opts.extname)
        const final = path.join(dir, filename)
        files[file].output = final
      }

      // Tell Metalsmith Concat plugin to concatinate the files.
      metalsmithConcat(files[file])(files, metalsmith, done)
    }
939368
function() {
      this.plugin('done', stats => {
        fs.writeFileSync(
          path.join(targetConfig.output.path, paths.appBuildAssetsJson()),
          `{"hash":"${stats.hash}"}`
        )
      })
    }
76759
function exec(files, options) {
    var self = this;
    files = files || ['.'];
    files = !Array.isArray(files) ? [files] : files;
    options = options || {};

    // If any version of --no-create is passed, change it to false.
    options.create = options.create === true ? false : options.create;

    // If --time is passed, ensure a valid param is called in
    // and map it to -a or -m, as this is the equivalent of these.
    // Throw an error if nothing valid passed.
    if (options.time) {
      var a = ['access', 'atime', 'use'];
      var m = ['modify', 'mtime'];
      var opt = a.indexOf(options.time) > -1 ? 'a' : m.indexOf(options.time) > -1 ? 'm' : undefined;
      if (!opt) {
        var error = 'touch: invalid argument "' + options.time + '" for "--time"\n' + 'Valid arguments are:\n' + '  - "atime", "access", "use"\n' + '  - "mtime", "modify"\n' + 'Try \'touch --help\' for more information.';
        // I think this is the stupidest thing
        // I've ever written.
        try {
          throw new Error(error);
        } catch (e) {
          return touch.error.call(self, e);
        }
      } else {
        options[opt] = true;
      }
    }

    try {
      var err = false;
      for (var i = 0; i < files.length; ++i) {
        try {
          touch.file(files[i], options);
        } catch (e) {
          err = e;
          break;
        }
      }
      if (err) {
        return touch.error.call(self, err);
      }
      return 0;
    } catch (e) {
      return touch.error.call(self, e);
    }
  }
932751
function(file, tasks, options) {
              /** skip if no tasks or checking Gruntfile */
              if (!tasks.length || file && file === 'Gruntfile.js') {
                return '';
              }

              var result = '* ' + file + ' (' + tasks.length + ')\n\n';

              /** iterate over tasks, add data */
              tasks.forEach(function(task) {
                result += '    [' + task.lineNumber + ' - ' +
                  task.priority + '] ' + task.line.trim() + '\n';

                result += '\n';
              });

              return result;
            }