summaryrefslogtreecommitdiff
path: root/lib/bundler/fetcher
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-05-05 19:00:47 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-03 09:29:55 +0900
commite111f38f34ea6b48446a0c29e142ccf44cfff282 (patch)
tree386cf93787490bf315980e586ff20d4d4b06ce98 /lib/bundler/fetcher
parentc3ddd47ce7b546530e2241b0ea6a96817977886a (diff)
[bundler/bundler] Fix file:// handling under Windows
Windows paths do not start with a slash, so we add an extra slash to separate the host from the path in file:// urls. Otherwise "D:" is parsed as the host segment in the URI. The path for those URLs now starts with "/", so we ignore that leading character when using the URI's path. This reduces Windows CI spec failures from 429 to 355. https://github.com/bundler/bundler/commit/1b7e274cbc
Diffstat (limited to 'lib/bundler/fetcher')
-rw-r--r--lib/bundler/fetcher/index.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bundler/fetcher/index.rb b/lib/bundler/fetcher/index.rb
index 9beb0e27d8..d10c21b041 100644
--- a/lib/bundler/fetcher/index.rb
+++ b/lib/bundler/fetcher/index.rb
@@ -30,7 +30,8 @@ module Bundler
uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
if uri.scheme == "file"
- Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(uri.path))
+ path = Gem.win_platform? ? uri.path[1..-1] : uri.path
+ Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(path))
elsif cached_spec_path = gemspec_cached_path(spec_file_name)
Bundler.load_gemspec(cached_spec_path)
else