Preview Ruby 4.1 is a preview. It can change before the final release. 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-4.1.0-preview1/lib/rubygems/util.rb, line 118
def self.correct_for_windows_path(path)
if path[0].chr == "/" && path[1].chr.match?(/[a-z]/i) && path[2].chr == ":"
path[1..-1]
else
path
end
end
Corrects path (usually returned by ‘Gem::URI.parse().path` on Windows), that comes with a leading slash.