Skip to content

Commit

Permalink
Don't remember --jobs flag
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Nov 24, 2023
1 parent 3e0049e commit 9ab1136
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
20 changes: 19 additions & 1 deletion bundler/lib/bundler/settings.rb
Expand Up @@ -46,6 +46,20 @@ class Settings
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
Expand Down Expand Up @@ -115,7 +129,7 @@ def [](name)
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
Expand Down Expand Up @@ -374,6 +388,10 @@ def is_array(key)
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
Expand Down
10 changes: 10 additions & 0 deletions bundler/spec/commands/install_spec.rb
Expand Up @@ -1288,4 +1288,14 @@ def run
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

0 comments on commit 9ab1136

Please sign in to comment.