End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Gem::Util.correct_for_windows_path
correct_for_windows_path(path)
lib/rubygems/util.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/rubygems/util.rb, line 111
def self.correct_for_windows_path(path)
if path[0].chr == "/" && path[1].chr =~ /[a-z]/i && path[2].chr == ":"
path[1..-1]
else
path
end
end
Corrects path (usually returned by ‘URI.parse().path` on Windows), that comes with a leading slash.