module Tapioca::ConstantLocator
Registers a TracePoint immediately upon load to track points at which classes and modules are opened for definition. This is used to track correspondence between classes/modules and files, as this information isn't available in the ruby runtime without extra accounting.
Public Class Methods
files_for(klass)
click to toggle source
Returns the files in which this class or module was opened. Doesn't know about situations where the class was opened prior to +require+ing, or where metaprogramming was used via eval
, etc.
# File lib/tapioca/constant_locator.rb, line 28 def self.files_for(klass) name = String === klass ? klass : name_of(klass) files = @class_files[name] files || Set.new end