[rubygems/rubygems] Don't remember --jobs flag

https://github.com/rubygems/rubygems/commit/9ab1136036
This commit is contained in:
David Rodríguez 2023-11-23 23:13:14 +01:00 committed by Hiroshi SHIBATA
parent 56ac1b0e14
commit 794c879d19
2 changed files with 29 additions and 1 deletions

View File

@ -46,6 +46,20 @@ module Bundler
update_requires_all_flag
].freeze
REMEMBERED_KEYS = %w[
bin
cache_all
clean
deployment
frozen
no_prune
path
shebang
path.system
without
with
].freeze
NUMBER_KEYS = %w[
jobs
redirect
@ -115,7 +129,7 @@ module Bundler
end
def set_command_option(key, value)
if Bundler.feature_flag.forget_cli_options?
if !is_remembered(key) || Bundler.feature_flag.forget_cli_options?
temporary(key => value)
value
else
@ -374,6 +388,10 @@ module Bundler
ARRAY_KEYS.include?(self.class.key_to_s(key))
end
def is_remembered(key)
REMEMBERED_KEYS.include?(self.class.key_to_s(key))
end
def is_credential(key)
key == "gem.push_key"
end

View File

@ -1288,4 +1288,14 @@ RSpec.describe "bundle install with gem sources" do
expect(err).to include("Could not find compatible versions")
end
end
context "when --jobs option given" do
before do
install_gemfile "source \"#{file_uri_for(gem_repo1)}\"", :jobs => 1
end
it "does not save the flag to config" do
expect(bundled_app(".bundle/config")).not_to exist
end
end
end