<commit_before>require 'erb'
require 'fileutils'
class FilesGenerator
  def initialize(template_path, file_name, path)
    @template_path = template_path
    @file_name = file_name
    @path = path
    @template = File.read(File.join(template_path, "#{file_name}.erb"))
  end

  def generate
    @rendered = ERB.new(@template).result
    create_folder unless Dir.exist?(@path)
    File.open(File.join(@path, @file_name), 'w') do |f|
      f.write(@rendered)
    end
  end

  def create_folder
    FileUtils.mkdir(@path)
  end
end<commit_msg>get informations and bind with ERB templates<commit_after>require 'erb'
require 'fileutils'
class FilesGenerator
  attr_accessor :infos
  def initialize(template_path, file_name, path, infos)
    @template_path = template_path
    @file_name = file_name
    @path = path
    @infos = infos
    @template = File.read(File.join(template_path, "#{file_name}.erb"))
  end

  def generate
    @rendered = ERB.new(@template).result(binding)
    create_folder unless Dir.exist?(@path)
    File.open(File.join(@path, @file_name), 'w') do |f|
      f.write(@rendered)
    end
  end

  def create_folder
    FileUtils.mkdir(@path)
  end
end
{'fraction_non_alphanumeric': 0.11784799316823227, 'fraction_numerical': 0.0, 'mean_word_length': 3.903765690376569, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '2761717', 'n_tokens_mistral': 404, 'n_tokens_neox': 393, 'n_words': 90}