lib/pry-doc/pry_ext/method_info.rb
def gem_dir_from_method(meth)
        return unless (host = method_host(meth)).name

        guess_gem_name(host.name.split('::').first).each do |guess|
          matches = $LOAD_PATH.grep(%r(/gems/#{guess}))
          return gem_root(matches.first) if matches.any?
        end

        nil
      end
##
# Try to recover the gem directory of a gem based on a method object.
#
# @param [Method, UnboundMethod] meth The method object
# @return [String, nil] the located gem directory
Try to recover the gem directory of a gem based on a method object.
Try to recover the gem directory of a gem based on a method object .
def gem_dir_from_method(meth)
        return unless (host = method_host(meth)).name
        guess_gem_name(host.name.split('::').first).each do |guess|
          matches = $LOAD_PATH.grep(%r(/gems/#{guess}))
          return gem_root(matches.first) if matches.any?
        end
        nil
      end
def gem_dir_from_method ( meth ) return unless ( host = method_host ( meth ) ) . name guess_gem_name ( host . name . split ( '::' ) . first ) . each do | guess | matches = $LOAD_PATH . grep ( %r( /gems/ #{ guess } ) ) return gem_root ( matches . first ) if matches . any? end nil end
Try to recover the gem directory of a gem based on a method object.
Try to recover the gem directory of a gem based on a method object .
the located gem directory
the located gem directory
String, nil
meth
meth The method object
meth The method object