# File lib/pry-doc/pry_ext/method_info.rb, line 37 def gem_root(dir) return unless (index = dir.rindex(%r(/(?:lib|ext)(?:/|$)))) dir[0..index-1] end