/usr/lib/ruby/vendor_ruby/gir_ffi/builder_helper.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 | module GirFFI
# Set of helper methods used in the builders.
module BuilderHelper
def optionally_define_constant(parent, name)
if parent.const_defined? name, false
parent.const_get name
else
parent.const_set name, yield
end
end
def get_or_define_class(namespace, name, parent)
optionally_define_constant(namespace, name) { Class.new parent }
end
def get_or_define_module(parent, name)
optionally_define_constant(parent, name) { Module.new }
end
end
end
|