1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[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 committed by Hiroshi SHIBATA
parent 7116ec6199
commit 0e01ad881a
Notes: git 2021-08-31 19:07:20 +09:00
2 changed files with 19 additions and 0 deletions

View file

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

View file

@ -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