<commit_before>require 'ffi'

module GLib
  extend FFI::Library

  class GType
    extend FFI::Library
    ffi_lib "gobject-2.0"
    attach_function :g_type_init, [], :void
    def self.init; g_type_init; end
  end
end
module GObjectIntrospection
  extend FFI::Library

  ffi_lib "girepository-1.0"

  class Repository
    extend FFI::Library

    attach_function :g_irepository_get_default, [], :pointer

    def self.get_default
      @@singleton ||= Repository.new(g_irepository_get_default)
    end

    private

    def initialize(gobject)
      @gobj = gobject
    end
  end
end

GLib::GType.init

gir = GObjectIntrospection::Repository.get_default
p gir<commit_msg>Put FFI stuff in private modules.<commit_after>require 'ffi'

module GLib
  private
  module Lib
    extend FFI::Library
    ffi_lib "gobject-2.0"
    attach_function :g_type_init, [], :void
  end

  public
  class GType
    def self.init; Lib::g_type_init; end
  end
end
module GI
  private

  module Lib
    extend FFI::Library
    ffi_lib "girepository-1.0"
    attach_function :g_irepository_get_default, [], :pointer
  end

  public

  class Repository

    def self.get_default
      @@singleton ||= Repository.new(Lib::g_irepository_get_default)
    end

    private

    def initialize(gobject)
      @gobj = gobject
    end
  end
end

GLib::GType.init

gir = GI::Repository.get_default
p gir
{'fraction_non_alphanumeric': 0.08236151603498543, 'fraction_numerical': 0.0058309037900874635, 'mean_word_length': 3.331230283911672, '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': '2036637', 'n_tokens_mistral': 495, 'n_tokens_neox': 482, 'n_words': 114}