Fix Layout/SpaceAroundOperators cop.

This commit is contained in:
Robert Haines 2020-02-09 10:52:06 +00:00
parent e7275dad93
commit 98c6969c18
6 changed files with 7 additions and 19 deletions

View File

@ -31,18 +31,6 @@ Layout/HashAlignment:
- 'lib/zip/file.rb'
- 'rubyzip.gemspec'
# Offense count: 5
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
# SupportedStylesForExponentOperator: space, no_space
Layout/SpaceAroundOperators:
Exclude:
- 'lib/zip/entry.rb'
- 'lib/zip/extra_field/zip64.rb'
- 'lib/zip/file.rb'
- 'lib/zip/filesystem.rb'
- 'lib/zip/input_stream.rb'
# Offense count: 1
Lint/AmbiguousBlockAssociation:
Exclude:

View File

@ -99,7 +99,7 @@ module Zip
@extra.create('UniversalTime')
end
(@extra['UniversalTime'] || @extra['NTFS']).mtime = value
@time = value
@time = value
end
def file_type_is?(type)

View File

@ -9,7 +9,7 @@ module Zip
# unparsed binary; we don't actually know what this contains
# without looking for FFs in the associated file header
# call parse after initializing with a binary string
@content = nil
@content = nil
@original_size = nil
@compressed_size = nil
@relative_header_offset = nil

View File

@ -75,7 +75,7 @@ module Zip
# a new archive if it doesn't exist already.
def initialize(path_or_io, create = false, buffer = false, options = {})
super()
options = DEFAULT_OPTIONS.merge(options)
options = DEFAULT_OPTIONS.merge(options)
@name = path_or_io.respond_to?(:path) ? path_or_io.path : path_or_io
@comment = ''
@create = create ? true : false # allow any truthy value to mean true

View File

@ -35,9 +35,9 @@ module Zip
module FileSystem
def initialize # :nodoc:
mappedZip = ZipFileNameMapper.new(self)
@zipFsDir = ZipFsDir.new(mappedZip)
@zipFsFile = ZipFsFile.new(mappedZip)
mappedZip = ZipFileNameMapper.new(self)
@zipFsDir = ZipFsDir.new(mappedZip)
@zipFsFile = ZipFsFile.new(mappedZip)
@zipFsDir.file = @zipFsFile
@zipFsFile.dir = @zipFsDir
end

View File

@ -51,7 +51,7 @@ module Zip
# @param offset [Integer] offset in the IO/StringIO
def initialize(context, offset = 0, decrypter = nil)
super()
@archive_io = get_io(context, offset)
@archive_io = get_io(context, offset)
@decompressor = ::Zip::NullDecompressor
@decrypter = decrypter || ::Zip::NullDecrypter.new
@current_entry = nil