diff --git a/.travis.yml b/.travis.yml index 6f21b41a..a95c3efd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,12 @@ before_install: - gem update bundler + - gem update rake rvm: - - 2.0.0 - - 2.1.10 - - 2.2.9 - - 2.3.6 - - 2.4.3 - - 2.5.0 + - 2.4.9 + - 2.5.7 + - 2.6.5 + - 2.7.0 script: - bundle exec rake spec 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 diff --git a/pry-doc.gemspec b/pry-doc.gemspec index 6ddac3ad..aea791a1 100644 --- a/pry-doc.gemspec +++ b/pry-doc.gemspec @@ -26,5 +26,5 @@ DESCR s.add_dependency 'pry', "~> 0.11" s.add_development_dependency 'latest_ruby', '~> 2.0' s.add_development_dependency 'rspec', '~> 3.5' - s.add_development_dependency 'rake', "~> 10.0" + s.add_development_dependency 'rake' end