Skip to content

Commit

Permalink
[rubygems/rubygems] Keep a single copy of the remembered flag depreca…
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez authored and hsbt committed Nov 27, 2023
1 parent fe57be5 commit e00d7b6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/bundler/cli.rb
Expand Up @@ -458,11 +458,7 @@ def fund
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. " \
Expand Down Expand Up @@ -886,11 +882,15 @@ def flag_deprecation(name, flag_name, option)
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

0 comments on commit e00d7b6

Please sign in to comment.