<commit_before>/*
 * grunt-ractive-parse
 * https://github.com/alisonailea/grunt-extjsractive-parse
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

'use strict';
var Ractive = require('ractive'),
    chalk = require('chalk'),
    path = require('path');

module.exports = function (grunt) {
  var desc = 'pre-parse Ractive templates for use in MVC projects';
  
  grunt.registerMultiTask('ractive_parse', desc, make);

  function make(){
      this.files.forEach(function(file){
          var templates = file.src.map(parse);
          grunt.file.write(file.dest,
              'Ext.define("Savanna.components.templates", {\n' + templates.join(',\n') + '\n});');
      });
  }

  function parse(template){
      var name = path.basename(template, '.html'),
          html = grunt.file.read(template),
          parsed = Ractive.parse(html);

      grunt.log.writeln(chalk.cyan(name) + '.html parsed.');

      return  '\t' + name + ': ' + JSON.stringify(parsed);
  }
};<commit_msg>bug fix<commit_after>/*
 * grunt-ractive-parse
 * https://github.com/alisonailea/grunt-extjsractive-parse
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

'use strict';
var Ractive = require('ractive'),
    chalk = require('chalk'),
    path = require('path');

module.exports = function (grunt) {
  var desc = 'pre-parse Ractive templates for use in MVC projects';
  
  grunt.registerMultiTask('ractive_parse', desc, make);

  function make(){
      this.files.forEach(function(file){
          var templates = file.src.map(parse);
          grunt.file.write(file.dest,
              'Ext.define("Savanna.components.templates.templates.templates", {\n' + templates.join(',\n') + '\n});');
      });
  }

  function parse(template){
      var name = path.basename(template, '.html'),
          html = grunt.file.read(template),
          parsed = Ractive.parse(html);

      grunt.log.writeln(chalk.cyan(name) + '.html parsed.');

      return  '\t' + name + ': ' + JSON.stringify(parsed);
  }
};
{'fraction_non_alphanumeric': 0.16897233201581027, 'fraction_numerical': 0.003952569169960474, 'mean_word_length': 2.9705882352941178, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6905108', 'n_tokens_mistral': 668, 'n_tokens_neox': 641, 'n_words': 131}