var fs = require('fs');

module.exports = function (grunt) {
  grunt.registerTask('templates', function () {
    var templates = fs.readdirSync('templates').map(function (fileName) {
      return fs.readFileSync('templates/' + fileName, 'utf8');
    });
    fs.writeFileSync('gen/templates.json', JSON.stringify(templates));
  });
};

@@ -16,16 +16,43 @@
 e('fs');
+%0Avar _ = require('lodash');
 %0A%0Amodule
@@ -213,14 +213,62 @@
     
-return
+var name = fileName.split('.')%5B0%5D;%0A      return %5Bname,
  fs.
@@ -312,16 +312,17 @@
  'utf8')
+%5D
 ;%0A    %7D)
@@ -381,16 +381,28 @@
 ringify(
+_.zipObject(
 template
@@ -404,16 +404,17 @@
 plates))
+)
 ;%0A  %7D);%0A

fix templates task