<commit_before># frozen_string_literal: true

module Ceres
  module Module
    def on_initialize(&block)
      if instance_variable_defined?(:@_on_initialize)
        raise ArgumentError, "multiple `on_initialize` blocks"
      end

      @_on_initialize = block
    end

    def on_include(&block)
      if instance_variable_defined?(:@_on_include)
        raise ArgumentError, "multiple `on_include` blocks"
      end

      @_on_include = block
    end

    def class_methods(&block)
      mod = if const_defined?(:ClassMethods, false)
        const_get(:ClassMethods)
      else
        const_set(:ClassMethods, ::Module.new)
      end

      mod.module_eval(&block)
    end

    def self.extended(base) #:nodoc:
      base.instance_variable_set(:@_module_dependencies, [])
    end

    def append_features(base) #:nodoc:
      add_features(base) { super }
    end

    def prepend_features(_) #:nodoc:
      raise NotImplementedError, "prepend is not implemented"
    end

    private def add_features(base) #:nodoc:
      if base.instance_variable_defined?(:@_module_dependencies)
        base.instance_variable_get(:@_module_dependencies) << self

        return false
      else
        return false if base < self
<commit_msg>These are actually private<commit_after># frozen_string_literal: true

module Ceres
  module Module
    def on_initialize(&block)
      if instance_variable_defined?(:@_on_initialize)
        raise ArgumentError, "multiple `on_initialize` blocks"
      end

      @_on_initialize = block
    end

    def on_include(&block)
      if instance_variable_defined?(:@_on_include)
        raise ArgumentError, "multiple `on_include` blocks"
      end

      @_on_include = block
    end

    def class_methods(&block)
      mod = if const_defined?(:ClassMethods, false)
        const_get(:ClassMethods)
      else
        const_set(:ClassMethods, ::Module.new)
      end

      mod.module_eval(&block)
    end

    def self.extended(base) #:nodoc:
      base.instance_variable_set(:@_module_dependencies, [])
    end

    private def append_features(base) #:nodoc:
      add_features(base) { super }
    end

    private def prepend_features(_) #:nodoc:
      raise NotImplementedError, "prepend is not implemented"
    end

    private def add_features(base) #:nodoc:
      if base.instance_variable_defined?(:@_module_dependencies)
        base.instance_variable_get(:@_module_dependencies) << self

        return false
      else
        return false if base < self

{'fraction_non_alphanumeric': 0.08643457382953182, 'fraction_numerical': 0.0, 'mean_word_length': 3.0192926045016075, 'pattern_counts': {'":': 0, '<': 9, '<?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': '2053924', 'n_tokens_mistral': 760, 'n_tokens_neox': 731, 'n_words': 171}