Skip to content

Commit

Permalink
Another Windows special case.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Oct 7, 2024
1 parent c67b948 commit 71f70d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/rdf/util/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ def self.open_file(filename_or_url, proxy: nil, headers: {}, verify_none: false,
# Just use path if there's a file scheme. This leaves out a potential host, which isn't supported anyway.
if url_no_frag_or_query.scheme == 'file'
url_no_frag_or_query = url_no_frag_or_query.path
if url_no_frag_or_query.match?(/^\/[A-Za-z]:/) && Gem.win_platform?
# Turns "/D:foo" into "D:foo"
url_no_frag_or_query = url_no_frag_or_query[1..-1]
end
end

Kernel.open(url_no_frag_or_query, "r", **options) do |file|
Expand Down

0 comments on commit 71f70d5

Please sign in to comment.