/usr/lib/ruby/vendor_ruby/ffi-glib/list.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 | require 'ffi-glib/list_methods'
GLib.load_class :List
module GLib
# Overrides for GList, GLib's doubly linked list implementation.
class List
include ListMethods
def self.from_enumerable(type, arr)
arr.reduce(new type) { |lst, val| lst.append val }
end
def append(data)
self.class.wrap(element_type,
Lib.g_list_append(self, element_ptr_for(data)))
end
end
end
|