<commit_before>module Kernel
  def new_method_missing(name, *args, &block)
    private_method = false
    instance_variable = false
    private_methods.each do |meth|
      private_method = true if meth == name
    end
    instance_variable = true if instance_variable_defined?("@#{name}".to_sym)
    if private_method
      send(name, *args, &block)
    elsif instance_variable
      self.class.class_eval do
        attr_reader name.to_sym
      end
      send(name, *args, &block)
    else
      old_method_missing(name, *args, &block) 
    end
  end
  alias_method :old_method_missing, :method_missing
  alias_method :method_missing, :new_method_missing

  #private
  #def this_tests(subject, &block)
    #test_context = Attest::TestContext.new(subject, block)
    #test_context.execute
  #end
end<commit_msg>added methods to kernel to find the name of the current method and the called method<commit_after>module Kernel
  def new_method_missing(name, *args, &block)
    private_method = false
    instance_variable = false
    private_methods.each do |meth|
      private_method = true if meth == name
    end
    instance_variable = true if instance_variable_defined?("@#{name}".to_sym)
    if private_method
      send(name, *args, &block)
    elsif instance_variable
      self.class.class_eval do
        attr_reader name.to_sym
      end
      send(name, *args, &block)
    else
      old_method_missing(name, *args, &block) 
    end
  end
  alias_method :old_method_missing, :method_missing
  alias_method :method_missing, :new_method_missing

  #private
  #def this_tests(subject, &block)
    #test_context = Attest::TestContext.new(subject, block)
    #test_context.execute
  #end
  private
  def current_method
    caller[0][/`([^']*)'/, 1]
  end
  def calling_method
    caller[1][/`([^']*)'/, 1]
  end
end
{'fraction_non_alphanumeric': 0.09665019220208676, 'fraction_numerical': 0.002196595277320154, 'mean_word_length': 3.543640897755611, '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': '97555', 'n_tokens_mistral': 593, 'n_tokens_neox': 588, 'n_words': 145}