<commit_before>require 'test_helper'
require 'uber/inheritable_included'

class InheritanceTest < MiniTest::Spec
  module Feature
    #extend Uber::InheritedIncluded

    def self.included(base)
      super # from uber?
      puts "selber"
      base.class_eval { extend ClassMethods }
    end

    module ClassMethods
      def feature; end
    end

  end

  module Extension
    include Feature

    def self.included(base)
puts base
      #base.class_eval do
        Feature.included(base)
      #end
    end

    # TODO: test overriding ::included
  end

  module Client
    include Extension
  end
<commit_msg>this works, but has globals (InheritIncludedTo module).<commit_after>require 'test_helper'
require 'uber/inheritable_included'

module InheritIncludedTo
  def self.call(base)
    base.class_eval do
      puts "addin included to #{base}"
      def self.included(b) #
        CODE_BLOCK.call(b)

        InheritIncludedTo.call(b)
      end
    end
  end
end

class InheritanceTest < MiniTest::Spec
  module Feature
    #extend Uber::InheritedIncluded

    ::CODE_BLOCK = lambda { |base| base.class_eval { extend ClassMethods } } # i want that to be executed at every include


    def self.included(base) #
      CODE_BLOCK.call(base)
      InheritIncludedTo.call(base)
    end

    module ClassMethods
      def feature; end
    end
  end

  module Extension
    include Feature

    # TODO: test overriding ::included
  end

  module Client
    include Extension
  end

{'fraction_non_alphanumeric': 0.06805929919137467, 'fraction_numerical': 0.0, 'mean_word_length': 2.827319587628866, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7555627', 'n_tokens_mistral': 476, 'n_tokens_neox': 443, 'n_words': 129}