<commit_before>module ResourceThis # :nodoc:
  def self.included(base)
    base.extend(ClassMethods)
  end

  module ClassMethods
    def resource_this(options = {})
      options.assert_valid_keys(:class_name, :will_paginate, :sort_method)

      singular_name         = options[:class_name].downcase.singularize || controller_name.singularize
      class_name            = options[:class_name] || singular_name.camelize
      plural_name           = singular_name.pluralize
      will_paginate_index   = options[:class_name] || false

      module_eval <<-"end_eval", __FILE__, __LINE__

        def index
          if will_paginate_index
            instance_variable_set("@#{plural_name}", class_name.paginate(:page => params[:page]))
          else
            instance_variable_set("@#{plural_name}", class_name.find(:all))
          end
          #TODO: add sorting customizable by subclassed controllers
          respond_to do |format|
            format.html<commit_msg>whoops<commit_after>module ResourceThis # :nodoc:
  def self.included(base)
    base.extend(ClassMethods)
  end

  module ClassMethods
    def resource_this(options = {})
      options.assert_valid_keys(:class_name, :will_paginate, :sort_method)

      singular_name         = controller_name.singularize
      singular_name         = options[:class_name].downcase.singularize unless options[:class_name].nil?
      class_name            = options[:class_name] || singular_name.camelize
      plural_name           = singular_name.pluralize
      will_paginate_index   = options[:class_name] || false

      module_eval <<-"end_eval", __FILE__, __LINE__

        def index
          if will_paginate_index
            instance_variable_set("@#{plural_name}", class_name.paginate(:page => params[:page]))
          else
            instance_variable_set("@#{plural_name}", class_name.find(:all))
          end
          #TODO: add sorting customizable by subclassed controllers
          respond_to do |format|
            format.html
{'fraction_non_alphanumeric': 0.09339294585196224, 'fraction_numerical': 0.0, 'mean_word_length': 2.8508604206500956, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2089439', 'n_tokens_mistral': 579, 'n_tokens_neox': 564, 'n_words': 104}