Skip to content

Commit

Permalink
Updates for opening files in suite_helper.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Oct 8, 2024
1 parent 586b5b8 commit d53c8dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/suite_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ class << self
def self.open_file(filename_or_url, **options, &block)
case
when filename_or_url.to_s =~ /^file:/
path = filename_or_url.to_s[5..-1]
path = RDF::URI(filename_or_url).path
if path.match?(/^\/[A-Za-z]:/) && Gem.win_platform?
# Turns "/D:foo" into "D:foo"
path = path[1..-1]
end
Kernel.open(path.to_s, &block)
when filename_or_url.to_s =~ %r{http://www.w3.org/ns/csvw/?}
::File.open(::File.expand_path("../../etc/csvw.jsonld", __FILE__), &block)
Expand Down

0 comments on commit d53c8dc

Please sign in to comment.