fix rubocop Style/MultilineBlockLayout cop

This commit is contained in:
Pavel Lobashov 2015-03-23 19:08:12 +03:00
parent 930b5ae45b
commit 04f69028f9
4 changed files with 7 additions and 19 deletions

View File

@ -173,11 +173,6 @@ Style/ModuleFunction:
Style/MultilineBlockChain: Style/MultilineBlockChain:
Enabled: false Enabled: false
# Offense count: 7
# Cop supports --auto-correct.
Style/MultilineBlockLayout:
Enabled: false
# Offense count: 11 # Offense count: 11
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles. # Configuration parameters: EnforcedStyle, SupportedStyles.

View File

@ -70,8 +70,7 @@ part_zips_count = Zip::File.split('large_zip_file.zip', 2097152, false)
puts "Zip file splitted in #{part_zips_count} parts" puts "Zip file splitted in #{part_zips_count} parts"
# Track splitting an archive # Track splitting an archive
Zip::File.split('large_zip_file.zip', 1048576, true, 'part_zip_file') do Zip::File.split('large_zip_file.zip', 1048576, true, 'part_zip_file') do |part_count, part_index, chunk_bytes, segment_bytes|
|part_count, part_index, chunk_bytes, segment_bytes|
puts "#{part_index} of #{part_count} part splitting: #{(chunk_bytes.to_f / segment_bytes.to_f * 100).to_i}%" puts "#{part_index} of #{part_count} part splitting: #{(chunk_bytes.to_f / segment_bytes.to_f * 100).to_i}%"
end end

View File

@ -11,8 +11,7 @@ class ZipInputStreamTest < MiniTest::Test
end end
def test_openWithBlock def test_openWithBlock
::Zip::InputStream.open(TestZipFile::TEST_ZIP2.zip_name) do ::Zip::InputStream.open(TestZipFile::TEST_ZIP2.zip_name) do |zis|
|zis|
assert_stream_contents(zis, TestZipFile::TEST_ZIP2) assert_stream_contents(zis, TestZipFile::TEST_ZIP2)
assert_equal(true, zis.eof?) assert_equal(true, zis.eof?)
end end
@ -50,8 +49,7 @@ class ZipInputStreamTest < MiniTest::Test
end end
def test_incompleteReads def test_incompleteReads
::Zip::InputStream.open(TestZipFile::TEST_ZIP2.zip_name) do ::Zip::InputStream.open(TestZipFile::TEST_ZIP2.zip_name) do |zis|
|zis|
entry = zis.get_next_entry # longAscii.txt entry = zis.get_next_entry # longAscii.txt
assert_equal(false, zis.eof?) assert_equal(false, zis.eof?)
assert_equal(TestZipFile::TEST_ZIP2.entry_names[0], entry.name) assert_equal(TestZipFile::TEST_ZIP2.entry_names[0], entry.name)
@ -114,8 +112,7 @@ class ZipInputStreamTest < MiniTest::Test
end end
def test_rewind def test_rewind
::Zip::InputStream.open(TestZipFile::TEST_ZIP2.zip_name) do ::Zip::InputStream.open(TestZipFile::TEST_ZIP2.zip_name) do |zis|
|zis|
e = zis.get_next_entry e = zis.get_next_entry
assert_equal(TestZipFile::TEST_ZIP2.entry_names[0], e.name) assert_equal(TestZipFile::TEST_ZIP2.entry_names[0], e.name)
@ -145,8 +142,7 @@ class ZipInputStreamTest < MiniTest::Test
end end
def test_mix_read_and_gets def test_mix_read_and_gets
::Zip::InputStream.open(TestZipFile::TEST_ZIP2.zip_name) do ::Zip::InputStream.open(TestZipFile::TEST_ZIP2.zip_name) do |zis|
|zis|
zis.get_next_entry zis.get_next_entry
assert_equal('#!/usr/bin/env ruby', zis.gets.chomp) assert_equal('#!/usr/bin/env ruby', zis.gets.chomp)
assert_equal(false, zis.eof?) assert_equal(false, zis.eof?)

View File

@ -27,8 +27,7 @@ class ZipLocalEntryTest < MiniTest::Test
end end
def test_readDateTime def test_readDateTime
::File.open('test/data/rubycode.zip', 'rb') do ::File.open('test/data/rubycode.zip', 'rb') do |file|
|file|
entry = ::Zip::Entry.read_local_entry(file) entry = ::Zip::Entry.read_local_entry(file)
assert_equal('zippedruby1.rb', entry.name) assert_equal('zippedruby1.rb', entry.name)
assert_equal(::Zip::DOSTime.at(1019261638), entry.time) assert_equal(::Zip::DOSTime.at(1019261638), entry.time)
@ -36,8 +35,7 @@ class ZipLocalEntryTest < MiniTest::Test
end end
def test_read_local_entryFromNonZipFile def test_read_local_entryFromNonZipFile
::File.open('test/data/file2.txt') do ::File.open('test/data/file2.txt') do |file|
|file|
assert_equal(nil, ::Zip::Entry.read_local_entry(file)) assert_equal(nil, ::Zip::Entry.read_local_entry(file))
end end
end end