Fix Style/Next cop.

This commit is contained in:
Robert Haines 2019-09-25 22:44:48 +01:00
parent 7978abb85e
commit 2f993221c0
2 changed files with 6 additions and 14 deletions

View File

@ -162,14 +162,6 @@ Style/ModuleFunction:
Style/MutableConstant:
Enabled: false
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, MinBodyLength.
# SupportedStyles: skip_modifier_ifs, always
Style/Next:
Exclude:
- 'lib/zip/entry.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedOctalStyle.

View File

@ -625,13 +625,13 @@ module Zip
while (buf = is.sysread(::Zip::Decompressor::CHUNK_SIZE, buf))
os << buf
bytes_written += buf.bytesize
if bytes_written > size && !warned
message = "entry '#{name}' should be #{size}B, but is larger when inflated."
raise ::Zip::EntrySizeError, message if ::Zip.validate_entry_sizes
next unless bytes_written > size && !warned
warn "WARNING: #{message}"
warned = true
end
message = "entry '#{name}' should be #{size}B, but is larger when inflated."
raise ::Zip::EntrySizeError, message if ::Zip.validate_entry_sizes
warn "WARNING: #{message}"
warned = true
end
end
end