<commit_before># rulers/lib/rulers/controller.rb
require "erubis"

module Rulers
  class Controller
    attr_reader :env

    def initialize env
      @env = env
    end

    def render(view_name, locals = {})
      filename = File.join "app", "views",
        "#{view_name}.html.erb"
      template = File.read filename
      eruby = Erubis::Eruby.new(template)
      eruby.result locals.merge(env: env)
    end
  end
end
<commit_msg>auto load controller into file path for views<commit_after># rulers/lib/rulers/controller.rb
require "erubis"

module Rulers
  class Controller
    attr_reader :env

    def initialize env
      @env = env
    end

    def controller_name
      klass = self.class
      klass = klass.to_s.gsub /Controller$/, ""
      Rulers.to_underscore klass
    end

    def render(view_name, locals = {})
      filename = File.join "app", "views",
        controller_name, "#{view_name}.html.erb"
      template = File.read filename
      eruby = Erubis::Eruby.new(template)
      eruby.result locals.merge(env: env)
    end
  end
end

{'fraction_non_alphanumeric': 0.10113421550094517, 'fraction_numerical': 0.0, 'mean_word_length': 2.6643598615916955, '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': '7286195', 'n_tokens_mistral': 356, 'n_tokens_neox': 352, 'n_words': 88}