Shopify / constant_resolver

Resolve a partially qualified Ruby constant reference to the fully qualified name and the path of the file defining it.
MIT License
26 stars 10 forks source link

use Module.const_source_location to resolve constants #25

Closed exterm closed 2 years ago

exterm commented 2 years ago

If we could use Module.const_source_location to resolve constants,

Sadly, as this PR demonstrates, Module.const_source_location returns the first definition (according to load order) of a constant only, and that isn't always the correct one.