aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2023-11-23 22:46:35 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-11-27 15:04:40 +0900
commite00d7b61827303ed3c7759757e9d0a90b80415cb (patch)
treedac302886de6277e266c1426bdd8453a963dfc3f /lib/bundler
parentfe57be5a2ea80655e1ece52518e3fe72058a0ad9 (diff)
downloadruby-e00d7b61827303ed3c7759757e9d0a90b80415cb.tar.gz
[rubygems/rubygems] Keep a single copy of the remembered flag deprecation message
https://github.com/rubygems/rubygems/commit/cb4e26eabc
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/cli.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index adc228193b..8099b74ba1 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -458,11 +458,7 @@ module Bundler
bundle without having to download any additional gems.
D
def cache
- SharedHelpers.major_deprecation 2,
- "The `--all` 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 cache_all true`, " \
- "and stop using this flag" if ARGV.include?("--all")
+ print_remembered_flag_deprecation("--all", "cache_all", "true") if ARGV.include?("--all")
SharedHelpers.major_deprecation 2,
"The `--path` flag is deprecated because its semantics are unclear. " \
@@ -886,11 +882,15 @@ 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)
+ end
+
+ def print_remembered_flag_deprecation(flag_name, option_name, option_value)
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"
+ "do in future versions. Instead please use `bundle config set #{option_name} " \
+ "#{option_value}`, and stop using this flag"
end
end
end