<commit_before>
module Rib; end
module Rib::Plugin
  def self.included mod
    mod.send(:include, Rib)

    class << mod
      attr_accessor :disabled

      def enable
        self.disabled = false
        if block_given? then yield else enabled? end
      end

      def disable
        self.disabled = true
        if block_given? then yield else enabled? end
      end

      def enabled?
        !disabled
      end

      def disabled?
        !!disabled
      end
    end

    snake_name = mod.name[/::\w+$/].tr(':', ''). # remove namespaces
                     gsub(/([A-Z][a-z]*)/, '\\1_').downcase[0..-2]

    code = (%w[enable disable].map{ |meth|<commit_msg>plugin.rb: the old way to remove namespace has problem for names w/o it<commit_after>
module Rib; end
module Rib::Plugin
  def self.included mod
    mod.send(:include, Rib)

    class << mod
      attr_accessor :disabled

      def enable
        self.disabled = false
        if block_given? then yield else enabled? end
      end

      def disable
        self.disabled = true
        if block_given? then yield else enabled? end
      end

      def enabled?
        !disabled
      end

      def disabled?
        !!disabled
      end
    end

    snake_name = mod.name.sub(/(\w+::)+?(\w+)$/, '\2').
      gsub(/([A-Z][a-z]*)/, '\\1_').downcase[0..-2]

    code = (%w[enable disable].map{ |meth|
{'fraction_non_alphanumeric': 0.12536443148688048, 'fraction_numerical': 0.00510204081632653, 'mean_word_length': 1.9027484143763214, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4693437', 'n_tokens_mistral': 447, 'n_tokens_neox': 418, 'n_words': 126}