<commit_before>require 'template/helper/base'
require 'template/helper/info'

class Template::Runner::Base
  include Template::Helper::Base
  include Template::Helper::Info

  attr_accessor :build, :filename

  def initialize(_filename, _build)
    self.filename = _filename
    self.build = _build
    @output_filename = filename.gsub(/(\.erb)$/, '')
    @content = File.read(filename)
  end

  # TODO: Use Forwardable
  def root; build.root; end

  def build_path
    build.__path__
  end

  def __path__
    File.dirname filename
  end
  
  def document
    build.document_struct
  end

  def o
    @locals
  end

  def append_to_output(str)
    @erbout << str
  end

  def __render__(locals = {})
    @locals = OpenStruct.new(locals)
    ERB.new(@content, nil, nil, "@erbout").result(binding)
  end
<commit_msg>Add reader to content for Template::Runner::Base<commit_after>require 'template/helper/base'
require 'template/helper/info'

class Template::Runner::Base
  include Template::Helper::Base
  include Template::Helper::Info

  attr_accessor :build, :content, :filename

  def initialize(_filename, _build)
    self.filename = _filename
    self.build = _build
    self.content = File.read(filename)
    @output_filename = filename.gsub(/(\.erb)$/, '')
  end

  # TODO: Use Forwardable
  def root; build.root; end

  def build_path
    build.__path__
  end

  def __path__
    File.dirname filename
  end
  
  def document
    build.document_struct
  end

  def o
    @locals
  end

  def append_to_output(str)
    @erbout << str
  end

  def __render__(locals = {})
    @locals = OpenStruct.new(locals)
    ERB.new(@content, nil, nil, "@erbout").result(binding)
  end

{'fraction_non_alphanumeric': 0.11078022632519356, 'fraction_numerical': 0.0, 'mean_word_length': 3.4210526315789473, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1752884', 'n_tokens_mistral': 566, 'n_tokens_neox': 549, 'n_words': 132}