[rubygems/rubygems] The `--local` flag to `bundle install` shouldn't hit the network

If the cache was missing, `bundler` would try to re-fetch it. With the
`--local` flag, it should just look at installed gems.

https://github.com/rubygems/rubygems/commit/630d29c69e
This commit is contained in:
David Rodríguez 2021-07-31 15:39:45 +02:00 коммит произвёл Hiroshi SHIBATA
Родитель 7116ec6199
Коммит 0e01ad881a
2 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@ -50,6 +50,7 @@ module Bundler
return if @allow_cached
@specs = nil
@allow_local = true
@allow_cached = true
end

Просмотреть файл

@ -759,4 +759,22 @@ RSpec.describe "bundle install with gem sources" do
)
end
end
context "with --local flag" do
before do
system_gems "rack-1.0.0", :path => default_bundle_path
end
it "respects installed gems without fetching any remote sources" do
install_gemfile <<-G, :local => true
source "#{file_uri_for(gem_repo1)}"
source "https://not-existing-source" do
gem "rack"
end
G
expect(last_command).to be_success
end
end
end