/usr/lib/ruby/vendor_ruby/introspection/receivers.rb is in ruby-introspection 0.0.3-1.
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 | require "metaclass"
module Introspection
module Receivers
class NullMetaclass
def ancestors
Array.new
end
end
class NullReceiver
def __metaclass__
NullMetaclass.new
end
def receivers
Array.new
end
end
def superklass
respond_to?(:superclass) ? superclass : NullReceiver.new
end
def local_receivers
receivers = []
receivers << __metaclass__ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.1.0')
receivers += __metaclass__.ancestors
receivers -= superklass.__metaclass__.ancestors
receivers
end
def receivers
local_receivers + superklass.receivers
end
end
end
class Object
include Introspection::Receivers
end
|