Fix Style/Next cop.
This commit is contained in:
parent
7978abb85e
commit
2f993221c0
|
@ -162,14 +162,6 @@ Style/ModuleFunction:
|
||||||
Style/MutableConstant:
|
Style/MutableConstant:
|
||||||
Enabled: false
|
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
|
# Offense count: 2
|
||||||
# Cop supports --auto-correct.
|
# Cop supports --auto-correct.
|
||||||
# Configuration parameters: EnforcedOctalStyle.
|
# Configuration parameters: EnforcedOctalStyle.
|
||||||
|
|
|
@ -625,13 +625,13 @@ module Zip
|
||||||
while (buf = is.sysread(::Zip::Decompressor::CHUNK_SIZE, buf))
|
while (buf = is.sysread(::Zip::Decompressor::CHUNK_SIZE, buf))
|
||||||
os << buf
|
os << buf
|
||||||
bytes_written += buf.bytesize
|
bytes_written += buf.bytesize
|
||||||
if bytes_written > size && !warned
|
next unless 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
|
|
||||||
|
|
||||||
warn "WARNING: #{message}"
|
message = "entry '#{name}' should be #{size}B, but is larger when inflated."
|
||||||
warned = true
|
raise ::Zip::EntrySizeError, message if ::Zip.validate_entry_sizes
|
||||||
end
|
|
||||||
|
warn "WARNING: #{message}"
|
||||||
|
warned = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue