[feature] default_cli_command for config what command bundler runs when no specific command is provided#8886
Open
jonbarlo wants to merge 6 commits intoruby:masterfrom
Open
[feature] default_cli_command for config what command bundler runs when no specific command is provided#8886jonbarlo wants to merge 6 commits intoruby:masterfrom
jonbarlo wants to merge 6 commits intoruby:masterfrom
Conversation
deivid-rodriguez
suggested changes
Aug 27, 2025
| ) | ||
| end | ||
|
|
||
| it "rejects nil values" do |
Contributor
There was a problem hiding this comment.
Please update this test to match the implementation and name it it "accepts nil values".
Contributor
There was a problem hiding this comment.
Also, the code in the rule checking for !value.nil? in order to not raise an error it's not even triggered by this test, because we Settings#set_local returns early if the previous value of the setting (nil in this case), matches the value passed to #set_local (nil, too).
So I'd add an extra test it "accepts nil values for unsetting an existing value of the setting" that first sets settings.set_local("default_cli_command", "install") and then checks that settings.set_local("default_cli_command", nil) does not raise an error.
44ea10b to
5913a7a
Compare
…o specific command is provided.
…er required and updating rspec test to not override the settings
5913a7a to
e042f4a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was the end-user or developer problem that led to this PR?
Closes#8786
The
default_cli_commandfeature allows users to configure what command Bundler runs when no specific command is provided.What is your fix for the problem, implemented in this PR?
Implementation Details
bundler/lib/bundler/settings/validator.rbdefault_cli_commandinstallorcli_help) are acceptedbundler/lib/bundler/settings.rbdefault_cli_commandtoSTRING_KEYSlistbundler/lib/bundler/cli.rbversionmethod to not show default timestamp (1980-01-02)cli_helpmethod to use enhanced man-based help systembundler/spec/bundler/settings_spec.rbKey Technical Changes
Validation Rule
Version Display Fix
Enhanced Help System
Setting the Default Command
Users can configure the default CLI command using Bundler's settings system:
Valid Values
The
default_cli_commandsetting accepts only two valid values:install- Runsbundle installwhen no command is specified (Bundler 3 behavior)cli_help- Displays usage help when no command is specified (Bundler 4 behavior)Make sure the following tasks are checked