<commit_before># -*- coding: utf-8 -*-
require 'active_support'
require 'active_support/core_ext'

module Mrubin
  DEFINE_SPAN = 20

  class RClass
    def initialize(path)
      @path = path

      # Load a Ruby script
      load @path

      # Get klass from filename
      @klass = File.basename(@path, ".mrubin").classify.constantize

      # Collect singleton methods
      @singleton_methods = @klass.singleton_methods(false).map do |sym|
        RMethod.new(@klass.method(sym))
      end

      # Collect instance methods
      obj = @klass.new
      @instance_methods = @klass.instance_methods(false).map do |sym|
        RMethod.new(obj.method(sym))<commit_msg>Raise error if defined ...#initialize<commit_after># -*- coding: utf-8 -*-
require 'active_support'
require 'active_support/core_ext'

module Mrubin
  DEFINE_SPAN = 20

  class RClass
    def initialize(path)
      @path = path

      # Load a Ruby script
      load @path

      # Get klass from filename
      @klass = File.basename(@path, ".mrubin").classify.constantize

      # Collect singleton methods
      @singleton_methods = @klass.singleton_methods(false).map do |sym|
        RMethod.new(@klass.method(sym))
      end

      # Collect instance methods
      begin
        obj = @klass.new
      rescue ArgumentError => e
        raise e, "Can't define #{@klass}#initialize."
      end

      @instance_methods = @klass.instance_methods(false).map do |sym|
        RMethod.new(obj.method(sym))
{'fraction_non_alphanumeric': 0.10983050847457627, 'fraction_numerical': 0.004067796610169492, 'mean_word_length': 2.699248120300752, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '3472971', 'n_tokens_mistral': 457, 'n_tokens_neox': 448, 'n_words': 111}