var through = require('through2');
var inflector = require('./inflector');
var rmExt = require('./rmExt');
var path = require('path');

module.exports = function (options) {
  return through.obj(function(chunk, _, next) {
    var inf = inflector(chunk, options.pods);

    if (!inf) {
      return next();
    }

    this.push({
      path: './' + (chunk.indexOf('.hbs') === -1 ? rmExt(chunk) : chunk),
      name: inf.name,
      cat: inf.cat,
      isTemplate: (inf.cat === 'template')
    });
    
    next();
  });
};

var through = require('through2');
var inflector = require('./inflector');
var rmExt = require('./rmExt');
var path = require('path');

module.exports = function (options) {
  return through.obj(function(chunk, _, next) {
    var inf = inflector(chunk, options.pods);

    if (!inf) {
      return next();
    }

    this.push({
      path: './' + (chunk.indexOf('.hbs') === -1 ? rmExt(chunk) : fixPathSep(chunk)),
      name: inf.name,
      cat: inf.cat
    });
    next();
  });
};

function fixPathSep(p) {  
  return path.sep === '\\' ? p.split(path.sep).join('/') : p;
}

Fix windows path seperator for templates
Fix windows path seperator for templates

`rmExt` contained code to fix path separators, but it wasn't being used for templates. This fixes the path separators specifically for templates.

Having this in two places isn't a great idea, but neither is fixing path separators in a function that claims it's only removing file extensions.