util/rubocop -A --only Style/MultipleComparison
This commit is contained in:
parent
f8fe151ca9
commit
7800d4eeb5
@ -103,7 +103,7 @@ class Gem::Doctor
|
||||
directory = File.join(@gem_repository, sub_directory)
|
||||
|
||||
Dir.entries(directory).sort.each do |ent|
|
||||
next if ent == "." || ent == ".."
|
||||
next if [".", ".."].include?(ent)
|
||||
|
||||
child = File.join(directory, ent)
|
||||
next unless File.exist?(child)
|
||||
|
@ -297,7 +297,7 @@ module Gem::GemcutterUtilities
|
||||
def get_mfa_params(profile)
|
||||
mfa_level = profile["mfa"]
|
||||
params = {}
|
||||
if mfa_level == "ui_only" || mfa_level == "ui_and_gem_signin"
|
||||
if ["ui_only", "ui_and_gem_signin"].include?(mfa_level)
|
||||
selected = ask_yes_no("Would you like to enable MFA for this key? (strongly recommended)")
|
||||
params["mfa"] = true if selected
|
||||
end
|
||||
|
@ -171,7 +171,7 @@ class Gem::Request
|
||||
no_env_proxy = env_proxy.nil? || env_proxy.empty?
|
||||
|
||||
if no_env_proxy
|
||||
return _scheme == "https" || _scheme == "http" ?
|
||||
return ["https", "http"].include?(_scheme) ?
|
||||
:no_proxy : get_proxy_from_env("http")
|
||||
end
|
||||
|
||||
|
@ -193,7 +193,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
|
||||
prerelease_dep && !@specification.version.prerelease?
|
||||
|
||||
open_ended = dep.requirement.requirements.all? do |op, version|
|
||||
!version.prerelease? && (op == ">" || op == ">=")
|
||||
!version.prerelease? && [">", ">="].include?(op)
|
||||
end
|
||||
|
||||
if open_ended
|
||||
@ -203,7 +203,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
|
||||
|
||||
base = segments.first 2
|
||||
|
||||
recommendation = if (op == ">" || op == ">=") && segments == [0]
|
||||
recommendation = if [">", ">="].include?(op) && segments == [0]
|
||||
" use a bounded requirement, such as '~> x.y'"
|
||||
else
|
||||
bugfix = if op == ">"
|
||||
|
Loading…
x
Reference in New Issue
Block a user