diff --git a/lib/pry-doc/pry_ext/method_info.rb b/lib/pry-doc/pry_ext/method_info.rb index 22f5d586..72817692 100644 --- a/lib/pry-doc/pry_ext/method_info.rb +++ b/lib/pry-doc/pry_ext/method_info.rb @@ -115,7 +115,7 @@ def find_gem_dir(meth) host_source_location, _ = WrappedModule.new(host).source_location break if host_source_location != nil return unless host.name - host = eval(host.namespace_name) + host = eval(namespace_name(host)) end while host # We want to exclude all source_locations that aren't gems (i.e @@ -186,6 +186,12 @@ def cache(meth) YARD.parse(file) end end + + private + + def namespace_name(host) + host.name.split("::")[0..-2].join("::") + end end end end