Fix Style/TernaryParentheses cop.
This commit is contained in:
parent
fae95e3c29
commit
d07b36b2e6
|
@ -168,15 +168,6 @@ Style/SafeNavigation:
|
||||||
- 'test/filesystem/file_nonmutating_test.rb'
|
- 'test/filesystem/file_nonmutating_test.rb'
|
||||||
- 'test/filesystem/file_stat_test.rb'
|
- 'test/filesystem/file_stat_test.rb'
|
||||||
- 'test/test_helper.rb'
|
- 'test/test_helper.rb'
|
||||||
# Offense count: 3
|
|
||||||
# Cop supports --auto-correct.
|
|
||||||
# Configuration parameters: EnforcedStyle, AllowSafeAssignment.
|
|
||||||
# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex
|
|
||||||
Style/TernaryParentheses:
|
|
||||||
Exclude:
|
|
||||||
- 'lib/zip/crypto/decrypted_io.rb'
|
|
||||||
- 'lib/zip/inflater.rb'
|
|
||||||
- 'lib/zip/pass_thru_decompressor.rb'
|
|
||||||
|
|
||||||
# Offense count: 1
|
# Offense count: 1
|
||||||
# Cop supports --auto-correct.
|
# Cop supports --auto-correct.
|
||||||
|
|
|
@ -8,7 +8,7 @@ module Zip
|
||||||
end
|
end
|
||||||
|
|
||||||
def read(length = nil, outbuf = +'')
|
def read(length = nil, outbuf = +'')
|
||||||
return ((length.nil? || length.zero?) ? '' : nil) if eof
|
return (length.nil? || length.zero? ? '' : nil) if eof
|
||||||
|
|
||||||
while length.nil? || (buffer.bytesize < length)
|
while length.nil? || (buffer.bytesize < length)
|
||||||
break if input_finished?
|
break if input_finished?
|
||||||
|
|
|
@ -8,7 +8,7 @@ module Zip
|
||||||
end
|
end
|
||||||
|
|
||||||
def read(length = nil, outbuf = '')
|
def read(length = nil, outbuf = '')
|
||||||
return ((length.nil? || length.zero?) ? '' : nil) if eof
|
return (length.nil? || length.zero? ? '' : nil) if eof
|
||||||
|
|
||||||
while length.nil? || (@buffer.bytesize < length)
|
while length.nil? || (@buffer.bytesize < length)
|
||||||
break if input_finished?
|
break if input_finished?
|
||||||
|
|
|
@ -6,7 +6,7 @@ module Zip
|
||||||
end
|
end
|
||||||
|
|
||||||
def read(length = nil, outbuf = '')
|
def read(length = nil, outbuf = '')
|
||||||
return ((length.nil? || length.zero?) ? '' : nil) if eof
|
return (length.nil? || length.zero? ? '' : nil) if eof
|
||||||
|
|
||||||
if length.nil? || (@read_so_far + length) > decompressed_size
|
if length.nil? || (@read_so_far + length) > decompressed_size
|
||||||
length = decompressed_size - @read_so_far
|
length = decompressed_size - @read_so_far
|
||||||
|
|
Loading…
Reference in New Issue