summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2023-11-23 23:13:14 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-11-27 15:04:40 +0900
commit794c879d19689df8ced5537ecaacdbe5313f2a3f (patch)
tree41d9a1eae503c5a30b1c328bcefcb0537850dcf2
parent56ac1b0e1435a425eb7451e10c0606a009d9113a (diff)
[rubygems/rubygems] Don't remember `--jobs` flag
https://github.com/rubygems/rubygems/commit/9ab1136036
-rw-r--r--lib/bundler/settings.rb20
-rw-r--r--spec/bundler/commands/install_spec.rb10
2 files changed, 29 insertions, 1 deletions
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index 0dd92b1ad9..8885b22e08 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -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
diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb
index 4456af2572..bed24f0618 100644
--- a/spec/bundler/commands/install_spec.rb
+++ b/spec/bundler/commands/install_spec.rb
@@ -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