<commit_before>require 'sidewalk/template_handlers/base'
require 'sidewalk/template_handlers/base_delegate'

require 'erb'

module Sidewalk
  module TemplateHandlers
    class ErbHandler < Base
      def initialize path
        super path
        @template = ERB::new(File.read(path))
        @template.filename = path
      end

      def render controller
        Delegate.new(@template, controller).render
      end

      # Class representing the controller to ERB.
      #
      # Using a delegate so we can add extra methods to the binding
      # without polluting the class - for example, most people expect an
      # ERB template to have access to ERB::Util#h
      class Delegate < BaseDelegate
        # Pull in '#html_escape' aka '#h
        include ERB::Util

        def initialize template, controller
          p [__FILE__, __LINE__]
          @template = template
          super controller
        end

        def render
          @template.result binding
        end
      end
    end
  end
end
<commit_msg>remove debugging p<commit_after>require 'sidewalk/template_handlers/base'
require 'sidewalk/template_handlers/base_delegate'

require 'erb'

module Sidewalk
  module TemplateHandlers
    class ErbHandler < Base
      def initialize path
        super path
        @template = ERB::new(File.read(path))
        @template.filename = path
      end

      def render controller
        Delegate.new(@template, controller).render
      end

      # Class representing the controller to ERB.
      #
      # Using a delegate so we can add extra methods to the binding
      # without polluting the class - for example, most people expect an
      # ERB template to have access to ERB::Util#h
      class Delegate < BaseDelegate
        # Pull in '#html_escape' aka '#h
        include ERB::Util

        def initialize template, controller
          @template = template
          super controller
        end

        def render
          @template.result binding
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.057692307692307696, 'fraction_numerical': 0.0, 'mean_word_length': 2.2003154574132493, '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': '665734', 'n_tokens_mistral': 535, 'n_tokens_neox': 515, 'n_words': 189}