-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[feature] default_cli_command for config what command bundler runs when no specific command is provided #8886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| ) | ||
| end | ||
|
|
||
| it "rejects nil values" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update this test to match the implementation and name it it "accepts nil values".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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