[ruby/rubygems] Restore install as default command

Fix: https://github.com/ruby/rubygems/issues/9124

This behavior is a deeply entrenched convention and changing it
will annoy lots of developers with unclear gains.

https://github.com/ruby/rubygems/commit/628e0ede46
This commit is contained in:
Jean Boussier 2025-11-26 18:58:42 +01:00 committed by git
parent f18bedaf96
commit 7dae2a1f48
2 changed files with 2 additions and 13 deletions

View File

@ -123,17 +123,7 @@ module Bundler
def self.default_command(meth = nil)
return super if meth
default_cli_command = Bundler.settings[:default_cli_command]
return default_cli_command if default_cli_command
Bundler.ui.warn(<<~MSG)
In the next version of Bundler, running `bundle` without argument will no longer run `bundle install`.
Instead, the `help` command will be displayed.
If you'd like to keep the previous behaviour please run `bundle config set default_cli_command install --global`.
MSG
"install"
Bundler.settings[:default_cli_command] || "install"
end
class_option "no-color", type: :boolean, desc: "Disable colorization in output"

View File

@ -87,9 +87,8 @@ RSpec.describe "bundle executable" do
end
context "with no arguments" do
it "installs and log a warning by default" do
it "installs by default" do
bundle "", raise_on_error: false
expect(err).to include("running `bundle` without argument will no longer run `bundle install`.")
expect(err).to include("Could not locate Gemfile")
end