fix rubocop Style/EmptyLinesAroundClassBody cop
This commit is contained in:
parent
b1c0dc2428
commit
b9a757e045
|
@ -110,12 +110,6 @@ Style/ElseAlignment:
|
||||||
Style/EmptyElse:
|
Style/EmptyElse:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
# Offense count: 40
|
|
||||||
# Cop supports --auto-correct.
|
|
||||||
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
||||||
Style/EmptyLinesAroundClassBody:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
# Offense count: 4
|
# Offense count: 4
|
||||||
# Cop supports --auto-correct.
|
# Cop supports --auto-correct.
|
||||||
Style/EmptyLinesAroundMethodBody:
|
Style/EmptyLinesAroundMethodBody:
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
module Zip
|
module Zip
|
||||||
class Deflater < Compressor #:nodoc:all
|
class Deflater < Compressor #:nodoc:all
|
||||||
|
|
||||||
def initialize(output_stream, level = Zip.default_compression, encrypter = NullEncrypter.new)
|
def initialize(output_stream, level = Zip.default_compression, encrypter = NullEncrypter.new)
|
||||||
super()
|
super()
|
||||||
@output_stream = output_stream
|
@output_stream = output_stream
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
module Zip
|
module Zip
|
||||||
class DOSTime < Time #:nodoc:all
|
class DOSTime < Time #:nodoc:all
|
||||||
|
|
||||||
#MS-DOS File Date and Time format as used in Interrupt 21H Function 57H:
|
#MS-DOS File Date and Time format as used in Interrupt 21H Function 57H:
|
||||||
|
|
||||||
# Register CX, the Time:
|
# Register CX, the Time:
|
||||||
|
|
|
@ -198,7 +198,6 @@ module Zip
|
||||||
rescue Error
|
rescue Error
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
public
|
public
|
||||||
|
@ -686,7 +685,6 @@ module Zip
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,6 @@ module Zip
|
||||||
# interface for accessing the filesystem, ie. the File and Dir classes.
|
# interface for accessing the filesystem, ie. the File and Dir classes.
|
||||||
|
|
||||||
class File < CentralDirectory
|
class File < CentralDirectory
|
||||||
|
|
||||||
CREATE = 1
|
CREATE = 1
|
||||||
SPLIT_SIGNATURE = 0x08074b50
|
SPLIT_SIGNATURE = 0x08074b50
|
||||||
ZIP64_EOCD_SIGNATURE = 0x06064b50
|
ZIP64_EOCD_SIGNATURE = 0x06064b50
|
||||||
|
@ -426,7 +425,6 @@ module Zip
|
||||||
temp_file.binmode
|
temp_file.binmode
|
||||||
temp_file
|
temp_file
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -65,14 +65,11 @@ module Zip
|
||||||
# The individual methods are not documented due to their
|
# The individual methods are not documented due to their
|
||||||
# similarity with the methods in File
|
# similarity with the methods in File
|
||||||
class ZipFsFile
|
class ZipFsFile
|
||||||
|
|
||||||
attr_writer :dir
|
attr_writer :dir
|
||||||
# protected :dir
|
# protected :dir
|
||||||
|
|
||||||
class ZipFsStat
|
class ZipFsStat
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
|
|
||||||
def delegate_to_fs_file(*methods)
|
def delegate_to_fs_file(*methods)
|
||||||
methods.each do |method|
|
methods.each do |method|
|
||||||
self.class_eval <<-end_eval, __FILE__, __LINE__ + 1
|
self.class_eval <<-end_eval, __FILE__, __LINE__ + 1
|
||||||
|
@ -82,7 +79,6 @@ module Zip
|
||||||
end_eval
|
end_eval
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(zipFsFile, entryName)
|
def initialize(zipFsFile, entryName)
|
||||||
|
@ -430,7 +426,6 @@ module Zip
|
||||||
# The individual methods are not documented due to their
|
# The individual methods are not documented due to their
|
||||||
# similarity with the methods in Dir
|
# similarity with the methods in Dir
|
||||||
class ZipFsDir
|
class ZipFsDir
|
||||||
|
|
||||||
def initialize(mappedZip)
|
def initialize(mappedZip)
|
||||||
@mappedZip = mappedZip
|
@mappedZip = mappedZip
|
||||||
end
|
end
|
||||||
|
@ -504,7 +499,6 @@ module Zip
|
||||||
def chroot(*_args)
|
def chroot(*_args)
|
||||||
raise NotImplementedError, "The chroot() function is not implemented"
|
raise NotImplementedError, "The chroot() function is not implemented"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
class ZipFsDirIterator # :nodoc:all
|
class ZipFsDirIterator # :nodoc:all
|
||||||
|
|
|
@ -181,7 +181,6 @@ module Zip
|
||||||
@compressor << data
|
@compressor << data
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
module Zip
|
module Zip
|
||||||
class PassThruDecompressor < Decompressor #:nodoc:all
|
class PassThruDecompressor < Decompressor #:nodoc:all
|
||||||
|
|
||||||
def initialize(input_stream, chars_to_read)
|
def initialize(input_stream, chars_to_read)
|
||||||
super(input_stream)
|
super(input_stream)
|
||||||
@chars_to_read = chars_to_read
|
@chars_to_read = chars_to_read
|
||||||
|
|
|
@ -11,7 +11,6 @@ require 'zip'
|
||||||
# zf = ZipFileGenerator.new(directoryToZip, outputFile)
|
# zf = ZipFileGenerator.new(directoryToZip, outputFile)
|
||||||
# zf.write()
|
# zf.write()
|
||||||
class ZipFileGenerator
|
class ZipFileGenerator
|
||||||
|
|
||||||
# Initialize with the directory to zip and the location of the output archive.
|
# Initialize with the directory to zip and the location of the output archive.
|
||||||
def initialize(inputDir, outputFile)
|
def initialize(inputDir, outputFile)
|
||||||
@inputDir = inputDir
|
@inputDir = inputDir
|
||||||
|
@ -46,5 +45,4 @@ class ZipFileGenerator
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,7 +12,6 @@ require 'zip'
|
||||||
a = Qt::Application.new(ARGV)
|
a = Qt::Application.new(ARGV)
|
||||||
|
|
||||||
class ZipDialog < ZipDialogUI
|
class ZipDialog < ZipDialogUI
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
super()
|
super()
|
||||||
connect(child('add_button'), SIGNAL('clicked()'),
|
connect(child('add_button'), SIGNAL('clicked()'),
|
||||||
|
|
|
@ -57,5 +57,4 @@ class BasicZipFileTest < MiniTest::Test
|
||||||
fileAndEntryName)
|
fileAndEntryName)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class ZipCentralDirectoryEntryTest < MiniTest::Test
|
class ZipCentralDirectoryEntryTest < MiniTest::Test
|
||||||
|
|
||||||
def test_read_from_stream
|
def test_read_from_stream
|
||||||
File.open("test/data/testDirectory.bin", "rb") do |file|
|
File.open("test/data/testDirectory.bin", "rb") do |file|
|
||||||
entry = ::Zip::Entry.read_c_dir_entry(file)
|
entry = ::Zip::Entry.read_c_dir_entry(file)
|
||||||
|
@ -67,5 +66,4 @@ class ZipCentralDirectoryEntryTest < MiniTest::Test
|
||||||
fail "ZipError expected"
|
fail "ZipError expected"
|
||||||
rescue ::Zip::Error
|
rescue ::Zip::Error
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class ZipCentralDirectoryTest < MiniTest::Test
|
class ZipCentralDirectoryTest < MiniTest::Test
|
||||||
|
|
||||||
def teardown
|
def teardown
|
||||||
::Zip.reset!
|
::Zip.reset!
|
||||||
end
|
end
|
||||||
|
|
|
@ -160,5 +160,4 @@ class ZipEntryTest < MiniTest::Test
|
||||||
|
|
||||||
assert_match(/mimetypeapplication\/epub\+zip/, first_100_bytes)
|
assert_match(/mimetypeapplication\/epub\+zip/, first_100_bytes)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class ErrorsTest < MiniTest::Test
|
class ErrorsTest < MiniTest::Test
|
||||||
|
|
||||||
def test_rescue_legacy_zip_error
|
def test_rescue_legacy_zip_error
|
||||||
raise ::Zip::Error
|
raise ::Zip::Error
|
||||||
rescue ::Zip::ZipError
|
rescue ::Zip::ZipError
|
||||||
|
@ -32,5 +31,4 @@ class ErrorsTest < MiniTest::Test
|
||||||
raise ::Zip::InternalError
|
raise ::Zip::InternalError
|
||||||
rescue ::Zip::ZipInternalError
|
rescue ::Zip::ZipInternalError
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -73,5 +73,4 @@ class ZipExtraFieldTest < MiniTest::Test
|
||||||
extra1.create("IUnix")
|
extra1.create("IUnix")
|
||||||
assert_equal(extra1, extra3)
|
assert_equal(extra1, extra3)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -80,5 +80,4 @@ class ZipFileExtractTest < MiniTest::Test
|
||||||
end
|
end
|
||||||
assert(!File.exist?(outFile))
|
assert(!File.exist?(outFile))
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,6 @@ require 'test_helper'
|
||||||
require 'zip/filesystem'
|
require 'zip/filesystem'
|
||||||
|
|
||||||
class ZipFsDirIteratorTest < MiniTest::Test
|
class ZipFsDirIteratorTest < MiniTest::Test
|
||||||
|
|
||||||
FILENAME_ARRAY = %w(f1 f2 f3 f4 f5 f6)
|
FILENAME_ARRAY = %w(f1 f2 f3 f4 f5 f6)
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
|
@ -57,5 +56,4 @@ class ZipFsDirIteratorTest < MiniTest::Test
|
||||||
@dirIt.seek(pos)
|
@dirIt.seek(pos)
|
||||||
assert_equal(valAtPos, @dirIt.read)
|
assert_equal(valAtPos, @dirIt.read)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -118,5 +118,4 @@ class ZipFsDirectoryTest < MiniTest::Test
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -85,5 +85,4 @@ class ZipFsFileMutatingTest < MiniTest::Test
|
||||||
assert(zf.file.exists?("dir1/dir11/"))
|
assert(zf.file.exists?("dir1/dir11/"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -502,5 +502,4 @@ class ZipFsFileNonmutatingTest < MiniTest::Test
|
||||||
assert_equal(orig_file, zip_file)
|
assert_equal(orig_file, zip_file)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,6 @@ require 'test_helper'
|
||||||
require 'zip/filesystem'
|
require 'zip/filesystem'
|
||||||
|
|
||||||
class ZipFsFileStatTest < MiniTest::Test
|
class ZipFsFileStatTest < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@zip_file = ::Zip::File.new("test/data/zipWithDirs.zip")
|
@zip_file = ::Zip::File.new("test/data/zipWithDirs.zip")
|
||||||
end
|
end
|
||||||
|
@ -62,5 +61,4 @@ class ZipFsFileStatTest < MiniTest::Test
|
||||||
def test_blksize
|
def test_blksize
|
||||||
assert_nil(@zip_file.file.stat("file1").blksize)
|
assert_nil(@zip_file.file.stat("file1").blksize)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -52,7 +52,6 @@ class TestFiles
|
||||||
end
|
end
|
||||||
Dir.mkdir(name)
|
Dir.mkdir(name)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -166,5 +166,4 @@ class ZipInputStreamTest < MiniTest::Test
|
||||||
assert_equal("$VERBOSE =", zis.read(10))
|
assert_equal("$VERBOSE =", zis.read(10))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class ZipLocalEntryTest < MiniTest::Test
|
class ZipLocalEntryTest < MiniTest::Test
|
||||||
|
|
||||||
CEH_FILE = 'test/data/generated/centralEntryHeader.bin'
|
CEH_FILE = 'test/data/generated/centralEntryHeader.bin'
|
||||||
LEH_FILE = 'test/data/generated/localEntryHeader.bin'
|
LEH_FILE = 'test/data/generated/localEntryHeader.bin'
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class ZipUnicodeFileNamesAndComments < MiniTest::Test
|
class ZipUnicodeFileNamesAndComments < MiniTest::Test
|
||||||
|
|
||||||
FILENAME = File.join(File.dirname(__FILE__), "test1.zip")
|
FILENAME = File.join(File.dirname(__FILE__), "test1.zip")
|
||||||
|
|
||||||
def test_unicode_file_name
|
def test_unicode_file_name
|
||||||
|
@ -48,5 +47,4 @@ class ZipUnicodeFileNamesAndComments < MiniTest::Test
|
||||||
end
|
end
|
||||||
::File.unlink(FILENAME)
|
::File.unlink(FILENAME)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -46,7 +46,6 @@ if ENV['FULL_ZIP64_TEST']
|
||||||
# but some OSes (*cough* OSX) still bundle a 5.xx release
|
# but some OSes (*cough* OSX) still bundle a 5.xx release
|
||||||
assert system("unzip -t #{test_filename}"), "third-party zip validation failed"
|
assert system("unzip -t #{test_filename}"), "third-party zip validation failed"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,5 +11,4 @@ class Zip64SupportTest < MiniTest::Test
|
||||||
assert(test_rb.size == 482)
|
assert(test_rb.size == 482)
|
||||||
assert(test_rb.compressed_size == 229)
|
assert(test_rb.compressed_size == 229)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue