From aac6f0681536c8ca58638714c2cc8d7e35aa6a37 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 10 Oct 2025 15:30:31 +0900 Subject: [PATCH 1/3] [rubygems/rubygems] Make default_cli_command flag to settings https://github.com/rubygems/rubygems/commit/31d67ecc05 --- lib/bundler/cli.rb | 2 +- lib/bundler/feature_flag.rb | 2 -- lib/bundler/settings.rb | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 6ee6bc76aec8ff..62225a352d71fa 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -107,7 +107,7 @@ def cli_help shell.say self.class.send(:class_options_help, shell) end - default_task(Bundler.feature_flag.default_cli_command) + default_task(Bundler.settings[:default_cli_command]) class_option "no-color", type: :boolean, desc: "Disable colorization in output" class_option "retry", type: :numeric, aliases: "-r", banner: "NUM", diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb index c3b8d790fbbce9..593d704e2b3e0e 100644 --- a/lib/bundler/feature_flag.rb +++ b/lib/bundler/feature_flag.rb @@ -29,8 +29,6 @@ def self.settings_method(name, key, &default) settings_flag(:update_requires_all_flag) { bundler_5_mode? } - settings_option(:default_cli_command) { bundler_4_mode? ? :cli_help : :install } - def removed_major?(target_major_version) @major_version > target_major_version end diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index 64f0c9900eb285..b6bc6c5a8a5c70 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -83,6 +83,7 @@ class Settings "BUNDLE_VERSION" => "lockfile", "BUNDLE_LOCKFILE_CHECKSUMS" => true, "BUNDLE_CACHE_ALL" => true, + "BUNDLE_DEFAULT_CLI_COMMAND" => "cli_help", "BUNDLE_PLUGINS" => true, "BUNDLE_GLOBAL_GEM_CACHE" => false, }.freeze From 4a285dd91aaacc7da44ce63191f41a1a1c287828 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 10 Oct 2025 15:32:29 +0900 Subject: [PATCH 2/3] [rubygems/rubygems] Added extra examples for cli_help default command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/rubygems/rubygems/commit/b2472e7b82 Co-authored-by: David Rodríguez <2887858+deivid-rodriguez@users.noreply.github.com> --- spec/bundler/bundler/cli_spec.rb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/spec/bundler/bundler/cli_spec.rb b/spec/bundler/bundler/cli_spec.rb index 07f589bd5de359..b3a97e72ceb2d8 100644 --- a/spec/bundler/bundler/cli_spec.rb +++ b/spec/bundler/bundler/cli_spec.rb @@ -87,7 +87,7 @@ def out_with_macos_man_workaround end context "with no arguments" do - it "prints a concise help message", bundler: "4" do + it "prints a concise help message by default" do bundle "" expect(err).to be_empty expect(out).to include("Bundler version #{Bundler::VERSION}"). @@ -96,6 +96,23 @@ def out_with_macos_man_workaround and include("\n\n Utilities:\n"). and include("\n\nOptions:\n") end + + it "prints a concise help message when default_cli_command set to cli_help" do + bundle "config set default_cli_command cli_help" + bundle "" + expect(err).to be_empty + expect(out).to include("Bundler version #{Bundler::VERSION}"). + and include("\n\nBundler commands:\n\n"). + and include("\n\n Primary commands:\n"). + and include("\n\n Utilities:\n"). + and include("\n\nOptions:\n") + end + + it "runs bundle install when default_cli_command set to install" do + bundle "config set default_cli_command install" + bundle "", raise_on_error: false + expect(err).to include("Could not locate Gemfile") + end end context "when ENV['BUNDLE_GEMFILE'] is set to an empty string" do From 4bf14758336fd51c3c45a714c944b7d69ec9bed3 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 10 Oct 2025 15:47:10 +0900 Subject: [PATCH 3/3] [rubygems/rubygems] Make update_requires_all_flag to settings https://github.com/rubygems/rubygems/commit/631a55be91 --- lib/bundler/cli/update.rb | 2 +- lib/bundler/feature_flag.rb | 2 -- lib/bundler/settings.rb | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/bundler/cli/update.rb b/lib/bundler/cli/update.rb index cf0ceac0bd19c5..4b4ba3c64712be 100644 --- a/lib/bundler/cli/update.rb +++ b/lib/bundler/cli/update.rb @@ -23,7 +23,7 @@ def run full_update = gems.empty? && sources.empty? && groups.empty? && !options[:ruby] && !update_bundler if full_update && !options[:all] - if Bundler.feature_flag.update_requires_all_flag? + if Bundler.settings[:update_requires_all_flag] raise InvalidOption, "To update everything, pass the `--all` flag." end SharedHelpers.major_deprecation 4, "Pass --all to `bundle update` to update everything" diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb index 593d704e2b3e0e..8ec62fc1c9e638 100644 --- a/lib/bundler/feature_flag.rb +++ b/lib/bundler/feature_flag.rb @@ -27,8 +27,6 @@ def self.settings_method(name, key, &default) (1..10).each {|v| define_method("bundler_#{v}_mode?") { @major_version >= v } } - settings_flag(:update_requires_all_flag) { bundler_5_mode? } - def removed_major?(target_major_version) @major_version > target_major_version end diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index b6bc6c5a8a5c70..81f1857eec7648 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -86,6 +86,7 @@ class Settings "BUNDLE_DEFAULT_CLI_COMMAND" => "cli_help", "BUNDLE_PLUGINS" => true, "BUNDLE_GLOBAL_GEM_CACHE" => false, + "BUNDLE_UPDATE_REQUIRES_ALL_FLAG" => false, }.freeze def initialize(root = nil)