[rubygems/rubygems] auto-correct Style/YodaCondition

https://github.com/rubygems/rubygems/commit/6d9e8025dc
This commit is contained in:
Hiroshi SHIBATA 2023-06-14 16:51:53 +09:00
parent 503b9bf1d4
commit 827d66266b
9 changed files with 9 additions and 9 deletions

View File

@ -12,7 +12,7 @@ module Bundler
def self.platforms_match?(gemspec_platform, local_platform)
return true if gemspec_platform.nil?
return true if Gem::Platform::RUBY == gemspec_platform
return true if gemspec_platform == Gem::Platform::RUBY
return true if local_platform == gemspec_platform
gemspec_platform = Gem::Platform.new(gemspec_platform)
return true if gemspec_platform === local_platform

View File

@ -76,7 +76,7 @@ class Gem::BasicSpecification
elsif missing_extensions?
@ignored = true
if Gem::Platform::RUBY == platform || Gem::Platform.local === platform
if platform == Gem::Platform::RUBY || Gem::Platform.local === platform
warn "Ignoring #{full_name} because its extensions are not built. " \
"Try: gem pristine #{name} --version #{version}"
end

View File

@ -121,7 +121,7 @@ extensions will be restored.
end.flatten
end
specs = specs.select {|spec| RUBY_ENGINE == spec.platform || Gem::Platform.local === spec.platform || spec.platform == Gem::Platform::RUBY }
specs = specs.select {|spec| spec.platform == RUBY_ENGINE || Gem::Platform.local === spec.platform || spec.platform == Gem::Platform::RUBY }
if specs.to_a.empty?
raise Gem::Exception,

View File

@ -155,7 +155,7 @@ class Gem::Package
Gem::Package::FileSource.new gem
end
return super unless Gem::Package == self
return super unless self == Gem::Package
return super unless gem.present?
return super unless gem.start

View File

@ -102,7 +102,7 @@ class Gem::Package::TarHeader
def self.from(stream)
header = stream.read 512
empty = (EMPTY_HEADER == header)
empty = (header == EMPTY_HEADER)
fields = header.unpack UNPACK_FORMAT

View File

@ -790,7 +790,7 @@ Gem dependencies file #{@path} includes git reference for both ref/branch and ta
return true if @installing
unless RUBY_VERSION == version
unless version == RUBY_VERSION
message = "Your Ruby version is #{RUBY_VERSION}, " \
"but your #{gem_deps_file} requires #{version}"

View File

@ -109,7 +109,7 @@ class Gem::RequestSet::Lockfile
requests.sort_by(&:name).each do |request|
next if request.spec.name == "bundler"
platform = "-#{request.spec.platform}" unless
Gem::Platform::RUBY == request.spec.platform
request.spec.platform == Gem::Platform::RUBY
out << " #{request.name} (#{request.version}#{platform})"

View File

@ -76,7 +76,7 @@ class Gem::Resolver::IndexSpecification < Gem::Resolver::Specification
q.breakable
q.text full_name
unless Gem::Platform::RUBY == @platform
unless @platform == Gem::Platform::RUBY
q.breakable
q.text @platform.to_s
end

View File

@ -201,7 +201,7 @@ class Gem::Version
@@release = {}
def self.new(version) # :nodoc:
return super unless Gem::Version == self
return super unless self == Gem::Version
@@all[version] ||= super
end