<commit_before>require 'ejs'

module Sprockets
  # Template engine class for the EJS compiler. Depends on the `ejs` gem.
  #
  # For more infomation see:
  #
  #   https://github.com/sstephenson/ruby-ejs
  #
  module EjsTemplate
    # Compile template data with EJS compiler.
    #
    # Returns a JS function definition String. The result should be
    # assigned to a JS variable.
    #
    #     # => "function(obj){...}"
    #
    def self.call(input)
      ::EJS.compile(input[:data])
    end
  end
end<commit_msg>Cache ejs<commit_after>require 'ejs'

module Sprockets
  # Template engine class for the EJS compiler. Depends on the `ejs` gem.
  #
  # For more infomation see:
  #
  #   https://github.com/sstephenson/ruby-ejs
  #
  module EjsTemplate
    VERSION = '1'

    # Compile template data with EJS compiler.
    #
    # Returns a JS function definition String. The result should be
    # assigned to a JS variable.
    #
    #     # => "function(obj){...}"
    #
    def self.call(input)
      data = input[:data]
      key  = [VERSION, data]
      input[:cache].fetch(key) do
        ::EJS.compile(data)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.1099476439790576, 'fraction_numerical': 0.0008726003490401396, 'mean_word_length': 2.373529411764706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '7562779', 'n_tokens_mistral': 388, 'n_tokens_neox': 383, 'n_words': 112}