From fe57be5a2ea80655e1ece52518e3fe72058a0ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Thu, 23 Nov 2023 23:01:35 +0100 Subject: [rubygems/rubygems] Avoid some unnecessary quotes in remember flag deprecation message https://github.com/rubygems/rubygems/commit/3fd627e486 --- lib/bundler/cli.rb | 3 ++- spec/bundler/other/major_deprecation_spec.rb | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 942f2984d4..adc228193b 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -884,12 +884,13 @@ module Bundler value = options[name] value = value.join(" ").to_s if option.type == :array + value = "'#{value}'" unless option.type == :boolean Bundler::SharedHelpers.major_deprecation 2, "The `#{flag_name}` flag is deprecated because it relies on being " \ "remembered across bundler invocations, which bundler will no longer " \ "do in future versions. Instead please use `bundle config set #{name.tr("-", "_")} " \ - "'#{value}'`, and stop using this flag" + "#{value}`, and stop using this flag" end end end diff --git a/spec/bundler/other/major_deprecation_spec.rb b/spec/bundler/other/major_deprecation_spec.rb index f6d5325299..2d01b64537 100644 --- a/spec/bundler/other/major_deprecation_spec.rb +++ b/spec/bundler/other/major_deprecation_spec.rb @@ -370,16 +370,16 @@ RSpec.describe "major deprecations" do end { - "clean" => ["clean", true], - "deployment" => ["deployment", true], - "frozen" => ["frozen", true], - "no-deployment" => ["deployment", false], - "no-prune" => ["no_prune", true], - "path" => ["path", "vendor/bundle"], - "shebang" => ["shebang", "ruby27"], - "system" => ["system", true], - "without" => ["without", "development"], - "with" => ["with", "development"], + "clean" => ["clean", "true"], + "deployment" => ["deployment", "true"], + "frozen" => ["frozen", "true"], + "no-deployment" => ["deployment", "false"], + "no-prune" => ["no_prune", "true"], + "path" => ["path", "'vendor/bundle'"], + "shebang" => ["shebang", "'ruby27'"], + "system" => ["system", "true"], + "without" => ["without", "'development'"], + "with" => ["with", "'development'"], }.each do |name, expectations| option_name, value = *expectations flag_name = "--#{name}" @@ -395,7 +395,7 @@ RSpec.describe "major deprecations" do "The `#{flag_name}` flag is deprecated because it relies on " \ "being remembered across bundler invocations, which bundler " \ "will no longer do in future versions. Instead please use " \ - "`bundle config set #{option_name} '#{value}'`, and stop using this flag" + "`bundle config set #{option_name} #{value}`, and stop using this flag" ) end -- cgit v1.2.3