diff options
author | Hiroshi SHIBATA <[email protected]> | 2023-03-22 13:26:37 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2023-03-23 17:18:49 +0900 |
commit | 0eef33e113e61f0d6efcf47f93602bd9d68f68d2 (patch) | |
tree | 1305402633da67630cf1ebfebbb6a630420108be /lib/rubygems/command.rb | |
parent | bec069b0cae3934bb2caee3aad7fbf587ab95937 (diff) |
[rubygems/rubygems] util/rubocop -A --only Style/Next
https://github.com/rubygems/rubygems/commit/e5868e92f7
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7582
Diffstat (limited to 'lib/rubygems/command.rb')
-rw-r--r-- | lib/rubygems/command.rb | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/rubygems/command.rb b/lib/rubygems/command.rb index 8bcfe2eb83..9f933b68c7 100644 --- a/lib/rubygems/command.rb +++ b/lib/rubygems/command.rb @@ -395,22 +395,21 @@ class Gem::Command def check_deprecated_options(options) options.each do |option| - if option_is_deprecated?(option) - deprecation = @deprecated_options[command][option] - version_to_expire = deprecation["rg_version_to_expire"] + next unless option_is_deprecated?(option) + deprecation = @deprecated_options[command][option] + version_to_expire = deprecation["rg_version_to_expire"] - deprecate_option_msg = if version_to_expire - "The \"#{option}\" option has been deprecated and will be removed in Rubygems #{version_to_expire}." - else - "The \"#{option}\" option has been deprecated and will be removed in future versions of Rubygems." - end + deprecate_option_msg = if version_to_expire + "The \"#{option}\" option has been deprecated and will be removed in Rubygems #{version_to_expire}." + else + "The \"#{option}\" option has been deprecated and will be removed in future versions of Rubygems." + end - extra_msg = deprecation["extra_msg"] + extra_msg = deprecation["extra_msg"] - deprecate_option_msg += " #{extra_msg}" if extra_msg + deprecate_option_msg += " #{extra_msg}" if extra_msg - alert_warning(deprecate_option_msg) - end + alert_warning(deprecate_option_msg) end end |