[rubygems/rubygems] Don't depend on Pathname unnecessarily

8c8aaecc48
This commit is contained in:
David Rodriguez 2024-05-13 15:02:43 +02:00 committed by git
parent b5e53e2f32
commit 22dab73971

View file

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "pathname"
require "rubygems" unless defined?(Gem) require "rubygems" unless defined?(Gem)
# We can't let `Gem::Source` be autoloaded in the `Gem::Specification#source` # We can't let `Gem::Source` be autoloaded in the `Gem::Specification#source`
@ -47,7 +45,7 @@ module Gem
def full_gem_path def full_gem_path
if source.respond_to?(:root) if source.respond_to?(:root)
Pathname.new(loaded_from).dirname.expand_path(source.root).to_s File.expand_path(File.dirname(loaded_from), source.root)
else else
rg_full_gem_path rg_full_gem_path
end end