[rubygems/rubygems] Fix bundle binstub --path=foo not printing a deprecation warning

Like others, it's a remembered option which we are deprecating in favor
of configuration.

801d5dd943
This commit is contained in:
David Rodríguez 2025-07-15 21:20:01 +02:00 committed by Hiroshi SHIBATA
parent 19d931b50d
commit 44dd27c430
2 changed files with 26 additions and 2 deletions

View file

@ -331,6 +331,8 @@ module Bundler
method_option "all", type: :boolean, banner: "Install binstubs for all gems"
method_option "all-platforms", type: :boolean, default: false, banner: "Install binstubs for all platforms"
def binstubs(*gems)
remembered_flag_deprecation("path", option_name: "bin")
require_relative "cli/binstubs"
Binstubs.new(options, gems).run
end
@ -743,7 +745,7 @@ module Bundler
nil
end
def remembered_flag_deprecation(name, negative: false)
def remembered_flag_deprecation(name, negative: false, option_name: nil)
option = current_command.options[name]
flag_name = option.switch_name
flag_name = "--no-" + flag_name.gsub(/\A--/, "") if negative
@ -753,7 +755,7 @@ module Bundler
value = value.join(" ").to_s if option.type == :array
value = "'#{value}'" unless option.type == :boolean
print_remembered_flag_deprecation(flag_name, name.tr("-", "_"), value)
print_remembered_flag_deprecation(flag_name, option_name || name.tr("-", "_"), value)
end
def print_remembered_flag_deprecation(flag_name, option_name, option_value)