8000 Add configs of rubocop gem and fix some rubocop warnings by ShockwaveNN · Pull Request #226 · rubyzip/rubyzip · GitHub
[go: up one dir, main page]

Skip to content

Add configs of rubocop gem and fix some rubocop warnings #226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 107 commits into from
Jun 8, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
715f064
add rubocop configs
ShockwaveNN Mar 20, 2015
7c4fed2
fix name of file
ShockwaveNN Mar 20, 2015
fc8e042
fix rubocop Style/WordArray warning
ShockwaveNN Mar 20, 2015
7a8a8b6
fix rubocop Style/WhileUntilModifier warning
ShockwaveNN Mar 20, 2015
f507a01
rename .rubocop.yml .rubocop_rubyzip.yml
ShockwaveNN Mar 20, 2015
b7cda26
fix rubocop Style/WhileUntilDo сщз
ShockwaveNN Mar 20, 2015
c677730
fix rubocop Style/UnneededPercentQ cop
ShockwaveNN Mar 20, 2015
6fac8c7
fix rubocop Style/TrailingWhitespace cop
ShockwaveNN Mar 20, 2015
7dcba79
fix rubocop Style/TrailingComma cop
ShockwaveNN Mar 20, 2015
c45a639
fix rubocop Style/TrailingBlankLines cop
ShockwaveNN Mar 20, 2015
5d47830
fix rubocop Style/Tab cop
ShockwaveNN Mar 20, 2015
d928aee
make parse_zip64_extra check for empty @extra['Zip64'] easier to read
ShockwaveNN Mar 20, 2015
6d19df4
fix rubocop Lint/AssignmentInCondition cop
ShockwaveNN Mar 20, 2015
52623a4
fix rubocop Lint/DeprecatedClassMethods cop
ShockwaveNN Mar 20, 2015
67838e1
fix rubocop Lint/EndAlignment cop
ShockwaveNN Mar 20, 2015
bfc8b3c
fix rubocop Lint/ShadowingOuterLocalVariable cop
ShockwaveNN Mar 20, 2015
eae8112
fix rubocop Lint/StringConversionInInterpolation cop
ShockwaveNN Mar 20, 2015
d3e911f
fix rubocop Lint/UnusedBlockArgument cop
ShockwaveNN Mar 20, 2015
4ee6d6b
fix rubocop Lint/UnusedMethodArgument cop
ShockwaveNN Mar 20, 2015
7ef15bd
fix rubocop Lint/UselessAssignment cop
ShockwaveNN Mar 20, 2015
bb08213
fix rubocop Style/Alias cop
ShockwaveNN Mar 20, 2015
f401fff
fix rubocop Style/AlignArray cop
ShockwaveNN Mar 20, 2015
98e6b5d
fix rubocop Style/AlignParameters cop
ShockwaveNN Mar 21, 2015
a2afbaf
fix rubocop Style/AndOr cop
ShockwaveNN Mar 21, 2015
0c6a10e
fix rubocop Style/AndOr cop
ShockwaveNN Mar 21, 2015
d2d8590
fix rubocop Style/Blocks cop
ShockwaveNN Mar 21, 2015
a0da550
fix rubocop Style/CaseIndentation cop
ShockwaveNN Mar 21, 2015
6c46c21
fix rubocop Style/ColonMethodCall cop
ShockwaveNN Mar 21, 2015
0aa70b8
fix rubocop Style/DefWithParentheses cop
ShockwaveNN Mar 21, 2015
d0c8e8d
fix rubocop Style/EmptyLines cop
ShockwaveNN Mar 21, 2015
eba5fa1
fix rubocop Style/EmptyLinesAroundAccessModifier cop
ShockwaveNN Mar 21, 2015
b1c0dc2
fix rubocop Style/EmptyLinesAroundBlockBody cop
ShockwaveNN Mar 21, 2015
b9a757e
fix rubocop Style/EmptyLinesAroundClassBody cop
ShockwaveNN Mar 21, 2015
2ac8086
fix rubocop Style/EmptyLinesAroundMethodBody cop
ShockwaveNN Mar 21, 2015
f67cf18
fix rubocop Style/EmptyLinesAroundModuleBody cop
ShockwaveNN Mar 21, 2015
f0dc815
fix rubocop Style/EndOfLine cop
ShockwaveNN Mar 21, 2015
70dd0d0
fix rubocop Style/IndentArray cop
ShockwaveNN Mar 21, 2015
b93ef12
fix rubocop Style/StringLiterals cop
ShockwaveNN Mar 21, 2015
3efd167
Merge pull request #1 from rubyzip/master
ShockwaveNN Mar 21, 2015
da863e4
Merge branch 'master' into rubocop_fixes
ShockwaveNN Mar 21, 2015
b730387
redone fixes by rubocop Style/Alias to be in style of https://github.…
ShockwaveNN Mar 21, 2015
e0d5617
update .rubocop_rubyzip.yml after all previous changes
ShockwaveNN Mar 22, 2015
7624740
fix rubocop Style/IndentationWidth cop
ShockwaveNN Mar 22, 2015
06e5a93
fix rubocop Style/ParenthesesAroundCondition cop
ShockwaveNN Mar 22, 2015
225a4f7
fix rubocop Style/RedundantReturn cop
ShockwaveNN Mar 22, 2015
abf9cbe
fix rubocop Style/RedundantSelf cop
ShockwaveNN Mar 22, 2015
105c2c7
fix rubocop Style/RedundantException cop
ShockwaveNN Mar 22, 2015
735a055
fix rubocop Style/RedundantBegin cop
ShockwaveNN Mar 22, 2015
707bd44
fix rubocop Style/SingleLineMethods cop
ShockwaveNN Mar 22, 2015
d2b4a52
fix rubocop Style/SpaceAfterComma cop
ShockwaveNN Mar 22, 2015
73e5f70
fix rubocop Style/SpaceAfterMethodName cop
ShockwaveNN Mar 22, 2015
77ef05c
fix rubocop Style/SpaceAfterNot cop
ShockwaveNN Mar 22, 2015
cb143f0
fix rubocop Style/SpaceAroundEqualsInParameterDefault cop
ShockwaveNN Mar 22, 2015
b311998
fix rubocop Style/SpaceInsideBlockBraces cop
ShockwaveNN Mar 22, 2015
2c7a990
fix rubocop Style/TrailingWhitespace cop
ShockwaveNN Mar 22, 2015
b13fafb
fix rubocop Style/StringLiterals cop
ShockwaveNN Mar 22, 2015
d92d8d6
fix rubocop Style/SpaceInsideParens cop
ShockwaveNN Mar 22, 2015
987dbf1
fix rubocop Style/SpaceInsideBrackets cop
ShockwaveNN Mar 22, 2015
5ea5710
fix rubocop Style/SpaceBeforeBlockBraces cop
ShockwaveNN Mar 22, 2015
8d6f23b
fix rubocop Style/SpaceAroundOperators cop
ShockwaveNN Mar 22, 2015
7eb06a1
fix some rubocop Style/Semicolon cop
ShockwaveNN Mar 22, 2015
edf3126
EntrySet.dub fix for code-style
ShockwaveNN Mar 23, 2015
d5f7982
fix rubocop Style/LineEndConcatenation cop
ShockwaveNN Mar 23, 2015
b6f9176
fix rubocop Style/Lambda cop
ShockwaveNN Mar 23, 2015
47b72f5
fix rubocop Style/LeadingCommentSpace cop
ShockwaveNN Mar 23, 2015
930b5ae
fix rubocop Style/MethodCallParentheses cop
ShockwaveNN Mar 23, 2015
04f6902
fix rubocop Style/MultilineBlockLayout cop
ShockwaveNN Mar 23, 2015
6a7a22f
fix rubocop Style/MultilineOperationIndentation cop
ShockwaveNN Mar 23, 2015
f291e1f
fix rubocop Style/NegatedIf cop
ShockwaveNN Mar 23, 2015
31fb9d7
fix rubocop Style/PredicateName cop
ShockwaveNN Mar 23, 2015
77b7d6c
fix rubocop Style/PercentLiteralDelimiters cop
ShockwaveNN Mar 23, 2015
1ba81ff
fix rubocop Style/NumericLiterals cop
ShockwaveNN Mar 23, 2015
8533708
fix rubocop Style/Not cop
ShockwaveNN Mar 23, 2015
abb8c02
fix rubocop Style/Next cop
ShockwaveNN Mar 23, 2015
d6cc880
fix rubocop Style/MultilineTernaryOperator cop
ShockwaveNN Mar 23, 2015
b1bfb1a
fix some rubocop Style/ModuleFunction cop
ShockwaveNN Mar 23, 2015
23cfcc7
fix rubocop Style/MethodName cop
ShockwaveNN Mar 24, 2015
2c8f6f8
fix correct initialization for ExtraField
ShockwaveNN Mar 24, 2015
b9aefaf
fix rubocop Style/IfUnlessModifier cop
ShockwaveNN Mar 24, 2015
63b3ee3
fix rubocop Style/HashSyntax cop
ShockwaveNN Mar 24, 2015
b920a1e
fix rubocop Style/GuardClause cop
ShockwaveNN Mar 24, 2015
112a77d
fix some Style/FormatString cop
ShockwaveNN Mar 24, 2015
68b5fcf
fix some Style/FormatString cop
ShockwaveNN Mar 24, 2015
068a3e7
fix rubocop Style/FileName cop
ShockwaveNN Mar 24, 2015
f6693af
fix rubocop Style/EmptyLinesAroundMethodBody cop
ShockwaveNN Mar 24, 2015
94c1df1
fix rubocop Style/EmptyLinesAroundAccessModifier cop
ShockwaveNN Mar 24, 2015
4b60095
fix rubocop Style/EmptyLines cop
ShockwaveNN Mar 24, 2015
784e70b
fix rubocop Style/EmptyElse cop
ShockwaveNN Mar 24, 2015
ce7e01a
fix rubocop Style/CommentIndentation cop
ShockwaveNN Mar 24, 2015
96f3997
fix rubocop Style/GuardClause cop
ShockwaveNN Mar 24, 2015
1759f71
fix rubocop Style/CommentAnnotation cop
ShockwaveNN Mar 24, 2015
aa83776
fix rubocop Style/ClassMethods cop
ShockwaveNN Mar 24, 2015
fd864bd
fix rubocop Style/CaseEquality cop
ShockwaveNN Mar 24, 2015
2007be0
fix rubocop Lint/UselessAccessModifier cop
ShockwaveNN Mar 24, 2015
e211434
fix rubocop Lint/UnusedBlockArgument cop
ShockwaveNN Mar 24, 2015
8000
63d388c
Merge pull request #2 from rubyzip/master
ShockwaveNN Jun 8, 2015
c0177a4
Merge branch 'master' into rubocop_fixes
ShockwaveNN Jun 8, 2015
53fba8a
fix after merge fix
ShockwaveNN Jun 8, 2015
47aa16f
update .rubocop_rubyzip for latest version of rubocop
ShockwaveNN Jun 8, 2015
68181da
fix rubocop cop Style/TrailingBlankLines
ShockwaveNN Jun 8, 2015
f7eec2d
fix rubocop cop Style/SpaceAroundOperators
ShockwaveNN Jun 8, 2015
37ede3c
fix rubocop cop Style/SingleSpaceBeforeFirstArg
ShockwaveNN Jun 8, 2015
13658b0
fix rubocop cop Style/NonNilCheck
ShockwaveNN Jun 8, 2015
4c81b11
fix rubocop cop Style/NilComparison
ShockwaveNN Jun 8, 2015
753eab1
fix rubocop cop Style/EmptyLinesAroundClassBody
ShockwaveNN Jun 8, 2015
8c13dfc
fix rubocop cop Style/ClassCheck
ShockwaveNN Jun 8, 2015
1e99ff6
Revert "fix rubocop cop Style/ClassCheck". It cause regression in tests
ShockwaveNN Jun 8, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix rubocop Style/EmptyLinesAroundClassBody cop
  • Loading branch information
ShockwaveNN committed Mar 21, 2015
commit b9a757e0456866a8b128d2c48c515bf41d0f47c8
6 changes: 0 additions & 6 deletions .rubocop_rubyzip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,6 @@ Style/ElseAlignment:
Style/EmptyElse:
Enabled: false

# Offense count: 40
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/EmptyLinesAroundClassBody:
Enabled: false

# Offense count: 4
# Cop supports --auto-correct.
Style/EmptyLinesAroundMethodBody:
Expand Down
1 change: 0 additions & 1 deletion lib/zip/deflater.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Zip
class Deflater < Compressor #:nodoc:all

def initialize(output_stream, level = Zip.default_compression, encrypter = NullEncrypter.new)
super()
@output_stream = output_stream
Expand Down
1 change: 0 additions & 1 deletion lib/zip/dos_time.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Zip
class DOSTime < Time #:nodoc:all

#MS-DOS File Date and Time format as used in Interrupt 21H Function 57H:

# Register CX, the Time:
Expand Down
2 changes: 0 additions & 2 deletions lib/zip/entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ def read_local_entry(io)
rescue Error
nil
end

end

public
Expand Down Expand Up @@ -686,7 +685,6 @@ def prep_zip64_extra(for_local_header) #:nodoc:all
end
end
end

end
end

Expand Down
2 changes: 0 additions & 2 deletions lib/zip/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ module Zip
# interface for accessing the filesystem, ie. the File and Dir classes.

class File < CentralDirectory

CREATE = 1
SPLIT_SIGNATURE = 0x08074b50
ZIP64_EOCD_SIGNATURE = 0x06064b50
Expand Down Expand Up @@ -426,7 +425,6 @@ def get_tempfile
temp_file.binmode
temp_file
end

end
end

Expand Down
6 changes: 0 additions & 6 deletions lib/zip/filesystem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,11 @@ def file
# The individual methods are not documented due to their
# similarity with the methods in File
class ZipFsFile

attr_writer :dir
# protected :dir

class ZipFsStat

class << self

def delegate_to_fs_file(*methods)
methods.each do |method|
self.class_eval <<-end_eval, __FILE__, __LINE__ + 1
Expand All @@ -82,7 +79,6 @@ def #{method} # def file?
end_eval
end
end

end

def initialize(zipFsFile, entryName)
Expand Down Expand Up @@ -430,7 +426,6 @@ def expand_path(aPath)
# The individual methods are not documented due to their
# similarity with the methods in Dir
class ZipFsDir

def initialize(mappedZip)
@mappedZip = mappedZip
end
Expand Down Expand Up @@ -504,7 +499,6 @@ def mkdir(entryName, permissionInt = 0755)
def chroot(*_args)
raise NotImplementedError, "The chroot() function is not implemented"
end

end

class ZipFsDirIterator # :nodoc:all
Expand Down
1 change: 0 additions & 1 deletion lib/zip/output_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ def << (data)
@compressor << data
self
end

end
end

Expand Down
1 change: 0 additions & 1 deletion lib/zip/pass_thru_decompressor.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Zip
class PassThruDecompressor < Decompressor #:nodoc:all

def initialize(input_stream, chars_to_read)
super(input_stream)
@chars_to_read = chars_to_read
Expand Down
2 changes: 0 additions & 2 deletions samples/example_recursive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# zf = ZipFileGenerator.new(directoryToZip, outputFile)
# zf.write()
class ZipFileGenerator

# Initialize with the directory to zip and the location of the output archive.
def initialize(inputDir, outputFile)
@inputDir = inputDir
Expand Down Expand Up @@ -46,5 +45,4 @@ def writeEntries(entries, path, io)
end
end
end

end
1 change: 0 additions & 1 deletion samples/qtzip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
a = Qt::Application.new(ARGV)

class ZipDialog < ZipDialogUI

def initialize
super()
connect(child('add_button'), SIGNAL('clicked()'),
Expand Down
1 change: 0 additions & 1 deletion test/basic_zip_file_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,4 @@ def test_get_input_streamBlock
fileAndEntryName)
end
end

end
2 changes: 0 additions & 2 deletions test/central_directory_entry_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'test_helper'

class ZipCentralDirectoryEntryTest < MiniTest::Test

def test_read_from_stream
File.open("test/data/testDirectory.bin", "rb") do |file|
entry = ::Zip::Entry.read_c_dir_entry(file)
Expand Down Expand Up @@ -67,5 +66,4 @@ def test_ReadEntryFromTruncatedZipFile
fail "ZipError expected"
rescue ::Zip::Error
end

end
1 change: 0 additions & 1 deletion test/central_directory_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'test_helper'

class ZipCentralDirectoryTest < MiniTest::Test

def teardown
::Zip.reset!
end
Expand Down
1 change: 0 additions & 1 deletion test/entry_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,4 @@ def test_store_file_without_compression

assert_match(/mimetypeapplication\/epub\+zip/, first_100_bytes)
end

end
2 changes: 0 additions & 2 deletions test/errors_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require 'test_helper'

class ErrorsTest < MiniTest::Test

def test_rescue_legacy_zip_error
raise ::Zip::Error
rescue ::Zip::ZipError
Expand Down Expand Up @@ -32,5 +31,4 @@ def test_rescue_legacy_zip_internal_error
raise ::Zip::InternalError
rescue ::Zip::ZipInternalError
end

end
1 change: 0 additions & 1 deletion test/extra_field_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,4 @@ def test_equality
extra1.create("IUnix")
assert_equal(extra1, extra3)
end

end
1 change: 0 additions & 1 deletion test/file_extract_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,4 @@ def test_extractNonEntry2
end
assert(!File.exist?(outFile))
end

end
2 changes: 0 additions & 2 deletions test/filesystem/dir_iterator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require 'zip/filesystem'

class ZipFsDirIteratorTest < MiniTest::Test

FILENAME_ARRAY = %w(f1 f2 f3 f4 f5 f6)

def setup
Expand Down Expand Up @@ -57,5 +56,4 @@ def test_tell_seek
@dirIt.seek(pos)
assert_equal(valAtPos, @dirIt.read)
end

end
1 change: 0 additions & 1 deletion test/filesystem/directory_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,4 @@ def test_open_new
end
end
end

end
1 change: 0 additions & 1 deletion test/filesystem/file_mutating_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,4 @@ def do_test_delete_or_unlink(symbol)
assert(zf.file.exists?("dir1/dir11/"))
end
end

end
1 change: 0 additions & 1 deletion test/filesystem/file_nonmutating_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -502,5 +502,4 @@ def test_read
assert_equal(orig_file, zip_file)
end
end

end
2 changes: 0 additions & 2 deletions test/filesystem/file_stat_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require 'zip/filesystem'

class ZipFsFileStatTest < MiniTest::Test

def setup
@zip_file = ::Zip::File.new("test/data/zipWithDirs.zip")
end
Expand Down Expand Up @@ -62,5 +61,4 @@ def test_nlink
def test_blksize
assert_nil(@zip_file.file.stat("file1").blksize)
end

end
1 change: 0 additions & 1 deletion test/gentestfiles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def ensure_dir(name)
end
Dir.mkdir(name)
end

end
end

Expand Down
1 change: 0 additions & 1 deletion test/input_stream_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,4 @@ def test_ungetc
assert_equal("$VERBOSE =", zis.read(10))
end
end

end
1 change: 0 additions & 1 deletion test/local_entry_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'test_helper'

class ZipLocalEntryTest < MiniTest::Test

CEH_FILE = 'test/data/generated/centralEntryHeader.bin'
LEH_FILE = 'test/data/generated/localEntryHeader.bin'

Expand Down
2 changes: 0 additions & 2 deletions test/unicode_file_names_and_comments_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require 'test_helper'

class ZipUnicodeFileNamesAndComments < MiniTest::Test

FILENAME = File.join(File.dirname(__FILE__), "test1.zip")

def test_unicode_file_name
Expand Down Expand Up @@ -48,5 +47,4 @@ def test_unicode_comment
end
::File.unlink(FILENAME)
end

end
1 change: 0 additions & 1 deletion test/zip64_full_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def test_largeZipFile
# but some OSes (*cough* OSX) still bundle a 5.xx release
assert system("unzip -t #{test_filename}"), "third-party zip validation failed"
end

end

end
1 change: 0 additions & 1 deletion test/zip64_support_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ def test_open_zip64_file
assert(test_rb.size == 482)
assert(test_rb.compressed_size == 229)
end

end
0