<commit_before># encoding: utf-8

module Nanoc3

  # Nanoc3::Rule contains the processing information for a item.
  class Rule

    # The regex that determines which items this rule can be applied to. This
    # rule can be applied to items with a identifier matching this regex.
    attr_reader :identifier_regex

    # The name of the representation that will be compiled using this rule.
    attr_reader :rep_name

    # Creates a new item compilation rule with the given identifier regex, compiler
    # and block. The block will be called during compilation with the item rep
    # as its argument.
    def initialize(identifier_regex, rep_name, block)
      @identifier_regex = identifier_regex
      @rep_name         = rep_name.to_sym

      @block = block
    end

    # Returns true if this rule can be applied to the given item rep.
    def applicable_to?(item)
      item.identifier =~ @identifier_regex
    end

    # Applies this rule to the given item rep.
    def apply_to(rep)
      rule_context = Nanoc3::RuleContext.new(rep).instance_eval &@block
    end

  end

end
<commit_msg>removed useless "rule_context =" in #apply_to<commit_after># encoding: utf-8

module Nanoc3

  # Nanoc3::Rule contains the processing information for a item.
  class Rule

    # The regex that determines which items this rule can be applied to. This
    # rule can be applied to items with a identifier matching this regex.
    attr_reader :identifier_regex

    # The name of the representation that will be compiled using this rule.
    attr_reader :rep_name

    # Creates a new item compilation rule with the given identifier regex, compiler
    # and block. The block will be called during compilation with the item rep
    # as its argument.
    def initialize(identifier_regex, rep_name, block)
      @identifier_regex = identifier_regex
      @rep_name         = rep_name.to_sym

      @block = block
    end

    # Returns true if this rule can be applied to the given item rep.
    def applicable_to?(item)
      item.identifier =~ @identifier_regex
    end

    # Applies this rule to the given item rep.
    def apply_to(rep)
      Nanoc3::RuleContext.new(rep).instance_eval &@block
    end

  end

end

{'fraction_non_alphanumeric': 0.05286940804338003, 'fraction_numerical': 0.0036150022593764122, 'mean_word_length': 3.010869565217391, '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': '7185260', 'n_tokens_mistral': 613, 'n_tokens_neox': 593, 'n_words': 261}