fix rubocop cop Style/NonNilCheck
This commit is contained in:
parent
37ede3cd61
commit
13658b0586
|
@ -112,12 +112,6 @@ Style/MultilineBlockChain:
|
|||
Style/NilComparison:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 13
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: IncludeSemanticChanges.
|
||||
Style/NonNilCheck:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 3
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
|
||||
|
|
|
@ -189,7 +189,7 @@ module Zip
|
|||
private :unix_mode_cmp
|
||||
|
||||
def exists?(fileName)
|
||||
expand_path(fileName) == '/' || @mappedZip.find_entry(fileName) != nil
|
||||
expand_path(fileName) == '/' || !@mappedZip.find_entry(fileName).nil?
|
||||
end
|
||||
alias exist? exists?
|
||||
|
||||
|
@ -234,7 +234,7 @@ module Zip
|
|||
|
||||
def directory?(fileName)
|
||||
entry = @mappedZip.find_entry(fileName)
|
||||
expand_path(fileName) == '/' || (entry != nil && entry.directory?)
|
||||
expand_path(fileName) == '/' || (!entry.nil? && entry.directory?)
|
||||
end
|
||||
|
||||
def open(fileName, openMode = 'r', permissionInt = 0644, &block)
|
||||
|
@ -293,7 +293,7 @@ module Zip
|
|||
|
||||
def file?(fileName)
|
||||
entry = @mappedZip.find_entry(fileName)
|
||||
entry != nil && entry.file?
|
||||
!entry.nil? && entry.file?
|
||||
end
|
||||
|
||||
def dirname(fileName)
|
||||
|
|
|
@ -6,7 +6,7 @@ class ZipFileExtractDirectoryTest < MiniTest::Test
|
|||
TEST_OUT_NAME = 'test/data/generated/emptyOutDir'
|
||||
|
||||
def open_zip(&aProc)
|
||||
assert(aProc != nil)
|
||||
assert(!aProc.nil?)
|
||||
::Zip::File.open(TestZipFile::TEST_ZIP4.zip_name, &aProc)
|
||||
end
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ class ZipSettingsTest < MiniTest::Test
|
|||
end
|
||||
|
||||
def open_zip(&aProc)
|
||||
assert(aProc != nil)
|
||||
assert(!aProc.nil?)
|
||||
::Zip::File.open(TestZipFile::TEST_ZIP4.zip_name, &aProc)
|
||||
end
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ module AssertEntry
|
|||
end
|
||||
|
||||
def assert_stream_contents(zis, testZipFile)
|
||||
assert(zis != nil)
|
||||
assert(!zis.nil?)
|
||||
testZipFile.entry_names.each do |entryName|
|
||||
assert_next_entry(entryName, zis)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue