Prevent adding local paths to RubyGems sources list

This commit is contained in:
Chris Roberts 2017-03-22 16:36:42 -07:00
parent b90ba95804
commit 354c1c2b51
1 changed files with 5 additions and 1 deletions

View File

@ -248,7 +248,11 @@ module Vagrant
@logger.debug("Enabling user defined remote RubyGems sources")
all_sources.each do |src|
next if URI.parse(src).scheme.nil?
begin
next if File.file?(src) || URI.parse(src).scheme.nil?
rescue URI::InvalidURIError
next
end
@logger.debug("Adding RubyGems source #{src}")
Gem.sources << src
end