<commit_before>begin
  require 'v8'
rescue LoadError
  require 'rubygems'
  require 'v8'
end

module Node
  class NativesModule
    @libs = Dir["#{ENV['NODE_HOME']}/lib/*.js"].map do |native_js|
      attribute = File.basename(native_js, File.extname(native_js)).to_sym
      attr_reader attribute
      #define_method(attribute) do
      #  instance_variable_get("@#{attribute}")
      #end
      attribute
    end

    def self.libs
      @libs
    end

    def initialize
      for mod in NativesModule.libs
        lib = File.join(ENV['NODE_HOME'], 'lib', "#{mod}.js")
        if File.file?(lib)
          instance_variable_set("@#{mod}", File.read(lib))
        else
          raise LoadError, "no such node lib #{mod}"
        end
      end
    end
  end

  class Exports
  end

  class Process<commit_msg>We're DRY<commit_after>begin
  require 'v8'
rescue LoadError
  require 'rubygems'
  require 'v8'
end

module Node
  class NativesModule
    Dir["#{ENV['NODE_HOME']}/lib/*.js"].each do |native_js|
      attribute = File.basename(native_js, File.extname(native_js)).to_sym
      class_eval(<<-ATTR, __FILE__, __LINE__)
        def #{attribute}
          @#{attribute} ||= File.read('#{native_js}')
        end
      ATTR
    end
  end

  class Exports
  end

  class Process
{'fraction_non_alphanumeric': 0.12149532710280374, 'fraction_numerical': 0.003115264797507788, 'mean_word_length': 2.660968660968661, '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': '4174000', 'n_tokens_mistral': 435, 'n_tokens_neox': 429, 'n_words': 100}