From d0709b474b241ce82a82e71d07af72f3003605a5 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Tue, 8 Oct 2024 17:24:25 -0700 Subject: [PATCH] Fix windows filename in Metadata.open. --- lib/rdf/tabular/metadata.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/rdf/tabular/metadata.rb b/lib/rdf/tabular/metadata.rb index fa6a48d..acccda2 100644 --- a/lib/rdf/tabular/metadata.rb +++ b/lib/rdf/tabular/metadata.rb @@ -143,12 +143,11 @@ def self.open(path, **options) } ) if RDF::URI(path).relative? - path = File.expand_path(path, __FILE__) - if Gem.win_platform? + path = if Gem.win_platform? # Expanded path starts with drive letter "file:/" + File.expand_path(path, __FILE__) else - path = "file:#{File.expand_path(path, __FILE__)}" + "file:#{File.expand_path(path, __FILE__)}" end end RDF::Util::File.open_file(path, **options) do |file|