Fix Lint/LiteralAsCondition cop.

This fixes Style/InfiniteLoop as a side-effect.
This commit is contained in:
Robert Haines 2020-02-09 11:01:57 +00:00
parent 20743a53b2
commit b528cae084
2 changed files with 1 additions and 12 deletions

View File

@ -31,11 +31,6 @@ Layout/HashAlignment:
- 'lib/zip/file.rb'
- 'rubyzip.gemspec'
# Offense count: 1
Lint/LiteralAsCondition:
Exclude:
- 'lib/zip/ioextras/abstract_input_stream.rb'
# Offense count: 1
Lint/RescueException:
Exclude:
@ -283,12 +278,6 @@ Style/IfUnlessModifier:
- 'lib/zip/pass_thru_decompressor.rb'
- 'lib/zip/streamable_stream.rb'
# Offense count: 1
# Cop supports --auto-correct.
Style/InfiniteLoop:
Exclude:
- 'lib/zip/ioextras/abstract_input_stream.rb'
# Offense count: 1
Style/MixinUsage:
Exclude:

View File

@ -101,7 +101,7 @@ module Zip
end
def each_line(a_sep_string = $/)
yield readline(a_sep_string) while true
loop { yield readline(a_sep_string) }
rescue EOFError
end