/usr/lib/ruby/vendor_ruby/gir_ffi/builders/base_type_builder.rb is in ruby-gir-ffi 0.9.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | require 'gir_ffi/builder_helper'
module GirFFI
# Base class for type builders.
class BaseTypeBuilder
include BuilderHelper
def initialize(info)
@info = info
@namespace = @info.namespace
@classname = @info.safe_name
end
def build_class
instantiate_class unless defined? @klass
@klass
end
def instantiate_class
setup_class unless already_set_up
end
attr_reader :info
private
def namespace_module
@namespace_module ||= Builder.build_module @namespace
end
def lib
@lib ||= namespace_module::Lib
end
def setup_constants
klass.const_set :GIR_INFO, info
klass.const_set :GIR_FFI_BUILDER, self
end
def already_set_up
klass.const_defined? :GIR_FFI_BUILDER, false
end
def gir
@gir ||= GObjectIntrospection::IRepository.default
end
end
end
|