This regular expression makes assumptions about the spec's require_path. Instead I think the gem_spec lookup should happen and it should be used to make the comparison to the caller's path.