Method: Gem::Specification#full_gem_path

Defined in:
lib/bundler/rubygems_ext.rb

#full_gem_pathObject


26
27
28
29
30
31
32
33
34
35
36
# File 'lib/bundler/rubygems_ext.rb', line 26

def full_gem_path
  # this cannot check source.is_a?(Bundler::Plugin::API::Source)
  # because that _could_ trip the autoload, and if there are unresolved
  # gems at that time, this method could be called inside another require,
  # thus raising with that constant being undefined. Better to check a method
  if source.respond_to?(:path) || (source.respond_to?(:bundler_plugin_api_source?) && source.bundler_plugin_api_source?)
    Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.tap{|x| x.untaint if RUBY_VERSION < "2.7" }
  else
    rg_full_gem_path
  end
end