<commit_before>require "erb"
require "tilt"

module PaitinHana
  class BaseController
    attr_reader :request

    def initialize(env)
      @request ||= Rack::Request.new(env)
    end

    def params
      request.params
    end

    def redirect_to(path, status: 301)
      response([], status, "Location" => path)
    end

    def response(body, status = 200, headers = {})
      @response ||= Rack::Response.new(body, status, headers)
    end

    def get_response
      @response
    end

    def render(*args)
      response(render_template(*args))
    end

    def render_template(view_name, locals = {})
      locals[:title] = view_name<commit_msg>chore (controller): update base controller<commit_after>require "erb"
require "tilt"

module PaitinHana
  class BaseController
    attr_reader :request

    def initialize(env)
      @request = Rack::Request.new(env)
    end

    def params
      request.params
    end

    def redirect_to(path, status: 301)
      response([], status, "Location" => path)
    end

    def response(body, status = 200, headers = {})
      @response ||= Rack::Response.new(body, status, headers)
    end

    def get_response
      @response
    end

    def render(*args)
      response(render_template(*args))
    end

    def render_template(view_name, locals = {})
      locals[:title] = view_name
{'fraction_non_alphanumeric': 0.1081282624906786, 'fraction_numerical': 0.008948545861297539, 'mean_word_length': 2.889855072463768, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7300744', 'n_tokens_mistral': 429, 'n_tokens_neox': 408, 'n_words': 105}