diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9932428..b120cad 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -146,13 +146,6 @@ Style/Documentation: Style/FormatStringToken: EnforcedStyle: unannotated -# Offense count: 97 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: always, always_true, never -Style/FrozenStringLiteralComment: - Enabled: false - # Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: AllowSplatArgument. diff --git a/.simplecov b/.simplecov index fc3979d..6c400bf 100644 --- a/.simplecov +++ b/.simplecov @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'simplecov-lcov' SimpleCov::Formatter::LcovFormatter.config do |c| diff --git a/Gemfile b/Gemfile index fa75df1..7f4f5e9 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source 'https://rubygems.org' gemspec diff --git a/Guardfile b/Guardfile index 1508e4c..5365a7a 100644 --- a/Guardfile +++ b/Guardfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + guard :minitest do # with Minitest::Unit watch(%r{^test/(.*)\/?(.*)_test\.rb$}) diff --git a/Rakefile b/Rakefile index 717c6b7..1fc3618 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'bundler/gem_tasks' require 'rake/testtask' require 'rubocop/rake_task' diff --git a/bin/console b/bin/console index 6df9a59..15e7b97 100755 --- a/bin/console +++ b/bin/console @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require 'bundler/setup' require 'zip' diff --git a/lib/zip.rb b/lib/zip.rb index 8cf982a..5e14293 100644 --- a/lib/zip.rb +++ b/lib/zip.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'English' require 'delegate' require 'singleton' diff --git a/lib/zip/central_directory.rb b/lib/zip/central_directory.rb index 5b64c7f..36a150b 100644 --- a/lib/zip/central_directory.rb +++ b/lib/zip/central_directory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip class CentralDirectory include Enumerable diff --git a/lib/zip/compressor.rb b/lib/zip/compressor.rb index 079c1cb..8c0680e 100644 --- a/lib/zip/compressor.rb +++ b/lib/zip/compressor.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip class Compressor #:nodoc:all def finish; end diff --git a/lib/zip/constants.rb b/lib/zip/constants.rb index fe89847..c15aeae 100644 --- a/lib/zip/constants.rb +++ b/lib/zip/constants.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip RUNNING_ON_WINDOWS = RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/i @@ -38,27 +40,27 @@ module Zip FSTYPE_ATHEOS = 30 FSTYPES = { - FSTYPE_FAT => 'FAT'.freeze, - FSTYPE_AMIGA => 'Amiga'.freeze, - FSTYPE_VMS => 'VMS (Vax or Alpha AXP)'.freeze, - FSTYPE_UNIX => 'Unix'.freeze, - FSTYPE_VM_CMS => 'VM/CMS'.freeze, - FSTYPE_ATARI => 'Atari ST'.freeze, - FSTYPE_HPFS => 'OS/2 or NT HPFS'.freeze, - FSTYPE_MAC => 'Macintosh'.freeze, - FSTYPE_Z_SYSTEM => 'Z-System'.freeze, - FSTYPE_CPM => 'CP/M'.freeze, - FSTYPE_TOPS20 => 'TOPS-20'.freeze, - FSTYPE_NTFS => 'NTFS'.freeze, - FSTYPE_QDOS => 'SMS/QDOS'.freeze, - FSTYPE_ACORN => 'Acorn RISC OS'.freeze, - FSTYPE_VFAT => 'Win32 VFAT'.freeze, - FSTYPE_MVS => 'MVS'.freeze, - FSTYPE_BEOS => 'BeOS'.freeze, - FSTYPE_TANDEM => 'Tandem NSK'.freeze, - FSTYPE_THEOS => 'Theos'.freeze, - FSTYPE_MAC_OSX => 'Mac OS/X (Darwin)'.freeze, - FSTYPE_ATHEOS => 'AtheOS'.freeze + FSTYPE_FAT => 'FAT', + FSTYPE_AMIGA => 'Amiga', + FSTYPE_VMS => 'VMS (Vax or Alpha AXP)', + FSTYPE_UNIX => 'Unix', + FSTYPE_VM_CMS => 'VM/CMS', + FSTYPE_ATARI => 'Atari ST', + FSTYPE_HPFS => 'OS/2 or NT HPFS', + FSTYPE_MAC => 'Macintosh', + FSTYPE_Z_SYSTEM => 'Z-System', + FSTYPE_CPM => 'CP/M', + FSTYPE_TOPS20 => 'TOPS-20', + FSTYPE_NTFS => 'NTFS', + FSTYPE_QDOS => 'SMS/QDOS', + FSTYPE_ACORN => 'Acorn RISC OS', + FSTYPE_VFAT => 'Win32 VFAT', + FSTYPE_MVS => 'MVS', + FSTYPE_BEOS => 'BeOS', + FSTYPE_TANDEM => 'Tandem NSK', + FSTYPE_THEOS => 'Theos', + FSTYPE_MAC_OSX => 'Mac OS/X (Darwin)', + FSTYPE_ATHEOS => 'AtheOS' }.freeze COMPRESSION_METHOD_STORE = 0 diff --git a/lib/zip/crypto/decrypted_io.rb b/lib/zip/crypto/decrypted_io.rb index 61a377d..92ccde6 100644 --- a/lib/zip/crypto/decrypted_io.rb +++ b/lib/zip/crypto/decrypted_io.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip class DecryptedIo #:nodoc:all CHUNK_SIZE = 32_768 diff --git a/lib/zip/crypto/encryption.rb b/lib/zip/crypto/encryption.rb index 4351be1..c792e38 100644 --- a/lib/zip/crypto/encryption.rb +++ b/lib/zip/crypto/encryption.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip class Encrypter #:nodoc:all end diff --git a/lib/zip/crypto/null_encryption.rb b/lib/zip/crypto/null_encryption.rb index a93f707..ae33c40 100644 --- a/lib/zip/crypto/null_encryption.rb +++ b/lib/zip/crypto/null_encryption.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip module NullEncryption def header_bytesize diff --git a/lib/zip/crypto/traditional_encryption.rb b/lib/zip/crypto/traditional_encryption.rb index 270e9ef..eef3b18 100644 --- a/lib/zip/crypto/traditional_encryption.rb +++ b/lib/zip/crypto/traditional_encryption.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip module TraditionalEncryption def initialize(password) diff --git a/lib/zip/decompressor.rb b/lib/zip/decompressor.rb index 2f89545..0d29e61 100644 --- a/lib/zip/decompressor.rb +++ b/lib/zip/decompressor.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip class Decompressor #:nodoc:all CHUNK_SIZE = 32_768 diff --git a/lib/zip/deflater.rb b/lib/zip/deflater.rb index 9f5371c..8f4827b 100644 --- a/lib/zip/deflater.rb +++ b/lib/zip/deflater.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip class Deflater < Compressor #:nodoc:all def initialize(output_stream, level = Zip.default_compression, encrypter = NullEncrypter.new) diff --git a/lib/zip/dos_time.rb b/lib/zip/dos_time.rb index 51139dd..264ead2 100644 --- a/lib/zip/dos_time.rb +++ b/lib/zip/dos_time.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rubygems' module Zip diff --git a/lib/zip/entry.rb b/lib/zip/entry.rb index 0b13470..453c174 100644 --- a/lib/zip/entry.rb +++ b/lib/zip/entry.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'pathname' module Zip class Entry diff --git a/lib/zip/entry_set.rb b/lib/zip/entry_set.rb index 9c50378..a582245 100644 --- a/lib/zip/entry_set.rb +++ b/lib/zip/entry_set.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip class EntrySet #:nodoc:all include Enumerable diff --git a/lib/zip/errors.rb b/lib/zip/errors.rb index 0ff0e1e..947f8dc 100644 --- a/lib/zip/errors.rb +++ b/lib/zip/errors.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip class Error < StandardError; end class EntryExistsError < Error; end diff --git a/lib/zip/extra_field.rb b/lib/zip/extra_field.rb index aa3ef8a..24352aa 100644 --- a/lib/zip/extra_field.rb +++ b/lib/zip/extra_field.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip class ExtraField < Hash ID_MAP = {} diff --git a/lib/zip/extra_field/generic.rb b/lib/zip/extra_field/generic.rb index 9237a1d..b3db791 100644 --- a/lib/zip/extra_field/generic.rb +++ b/lib/zip/extra_field/generic.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip class ExtraField::Generic def self.register_map diff --git a/lib/zip/extra_field/ntfs.rb b/lib/zip/extra_field/ntfs.rb index f80b507..cd691b1 100644 --- a/lib/zip/extra_field/ntfs.rb +++ b/lib/zip/extra_field/ntfs.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip # PKWARE NTFS Extra Field (0x000a) # Only Tag 0x0001 is supported diff --git a/lib/zip/extra_field/old_unix.rb b/lib/zip/extra_field/old_unix.rb index dfd2ba5..351339f 100644 --- a/lib/zip/extra_field/old_unix.rb +++ b/lib/zip/extra_field/old_unix.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip # Olf Info-ZIP Extra for UNIX uid/gid and file timestampes class ExtraField::OldUnix < ExtraField::Generic diff --git a/lib/zip/extra_field/universal_time.rb b/lib/zip/extra_field/universal_time.rb index 424c281..63ef070 100644 --- a/lib/zip/extra_field/universal_time.rb +++ b/lib/zip/extra_field/universal_time.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip # Info-ZIP Additional timestamp field class ExtraField::UniversalTime < ExtraField::Generic diff --git a/lib/zip/extra_field/unix.rb b/lib/zip/extra_field/unix.rb index d83087e..f88f135 100644 --- a/lib/zip/extra_field/unix.rb +++ b/lib/zip/extra_field/unix.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip # Info-ZIP Extra for UNIX uid/gid class ExtraField::IUnix < ExtraField::Generic diff --git a/lib/zip/extra_field/zip64.rb b/lib/zip/extra_field/zip64.rb index 875fc62..2f7c32c 100644 --- a/lib/zip/extra_field/zip64.rb +++ b/lib/zip/extra_field/zip64.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip # Info-ZIP Extra for Zip64 size class ExtraField::Zip64 < ExtraField::Generic diff --git a/lib/zip/extra_field/zip64_placeholder.rb b/lib/zip/extra_field/zip64_placeholder.rb index dfaa56e..2619a68 100644 --- a/lib/zip/extra_field/zip64_placeholder.rb +++ b/lib/zip/extra_field/zip64_placeholder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip # placeholder to reserve space for a Zip64 extra information record, for the # local file header only, that we won't know if we'll need until after diff --git a/lib/zip/file.rb b/lib/zip/file.rb index 6578456..1c57953 100644 --- a/lib/zip/file.rb +++ b/lib/zip/file.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip # ZipFile is modeled after java.util.zip.ZipFile from the Java SDK. # The most important methods are those inherited from diff --git a/lib/zip/filesystem.rb b/lib/zip/filesystem.rb index 6981b07..04162ca 100644 --- a/lib/zip/filesystem.rb +++ b/lib/zip/filesystem.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'zip' module Zip diff --git a/lib/zip/inflater.rb b/lib/zip/inflater.rb index 705ab0b..8f686f3 100644 --- a/lib/zip/inflater.rb +++ b/lib/zip/inflater.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip class Inflater < Decompressor #:nodoc:all def initialize(*args) diff --git a/lib/zip/input_stream.rb b/lib/zip/input_stream.rb index f942d19..d044a29 100644 --- a/lib/zip/input_stream.rb +++ b/lib/zip/input_stream.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip # InputStream is the basic class for reading zip entries in a # zip file. It is possible to create a InputStream object directly, diff --git a/lib/zip/ioextras.rb b/lib/zip/ioextras.rb index 7a97a51..879a514 100644 --- a/lib/zip/ioextras.rb +++ b/lib/zip/ioextras.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip module IOExtras #:nodoc: CHUNK_SIZE = 131_072 diff --git a/lib/zip/ioextras/abstract_input_stream.rb b/lib/zip/ioextras/abstract_input_stream.rb index bf32811..11438fc 100644 --- a/lib/zip/ioextras/abstract_input_stream.rb +++ b/lib/zip/ioextras/abstract_input_stream.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip module IOExtras # Implements many of the convenience methods of IO diff --git a/lib/zip/ioextras/abstract_output_stream.rb b/lib/zip/ioextras/abstract_output_stream.rb index b94c9d4..e826b54 100644 --- a/lib/zip/ioextras/abstract_output_stream.rb +++ b/lib/zip/ioextras/abstract_output_stream.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip module IOExtras # Implements many of the output convenience methods of IO. diff --git a/lib/zip/null_compressor.rb b/lib/zip/null_compressor.rb index 70fd329..41da0c6 100644 --- a/lib/zip/null_compressor.rb +++ b/lib/zip/null_compressor.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip class NullCompressor < Compressor #:nodoc:all include Singleton diff --git a/lib/zip/null_decompressor.rb b/lib/zip/null_decompressor.rb index 6534b16..7b2557d 100644 --- a/lib/zip/null_decompressor.rb +++ b/lib/zip/null_decompressor.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip module NullDecompressor #:nodoc:all module_function diff --git a/lib/zip/null_input_stream.rb b/lib/zip/null_input_stream.rb index 2cd3661..69bc38d 100644 --- a/lib/zip/null_input_stream.rb +++ b/lib/zip/null_input_stream.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip module NullInputStream #:nodoc:all include ::Zip::NullDecompressor diff --git a/lib/zip/output_stream.rb b/lib/zip/output_stream.rb index 65b7d62..6bfd938 100644 --- a/lib/zip/output_stream.rb +++ b/lib/zip/output_stream.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip # ZipOutputStream is the basic class for writing zip files. It is # possible to create a ZipOutputStream object directly, passing diff --git a/lib/zip/pass_thru_compressor.rb b/lib/zip/pass_thru_compressor.rb index 2dbaa27..484d0da 100644 --- a/lib/zip/pass_thru_compressor.rb +++ b/lib/zip/pass_thru_compressor.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip class PassThruCompressor < Compressor #:nodoc:all def initialize(output_stream) diff --git a/lib/zip/pass_thru_decompressor.rb b/lib/zip/pass_thru_decompressor.rb index 22db40e..c9973c8 100644 --- a/lib/zip/pass_thru_decompressor.rb +++ b/lib/zip/pass_thru_decompressor.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip class PassThruDecompressor < Decompressor #:nodoc:all def initialize(*args) diff --git a/lib/zip/streamable_directory.rb b/lib/zip/streamable_directory.rb index 3738ce2..a3c7c93 100644 --- a/lib/zip/streamable_directory.rb +++ b/lib/zip/streamable_directory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip class StreamableDirectory < Entry def initialize(zipfile, entry, src_path = nil, permission = nil) diff --git a/lib/zip/streamable_stream.rb b/lib/zip/streamable_stream.rb index 68f3e0e..e823e00 100644 --- a/lib/zip/streamable_stream.rb +++ b/lib/zip/streamable_stream.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip class StreamableStream < DelegateClass(Entry) # :nodoc:all def initialize(entry) diff --git a/lib/zip/version.rb b/lib/zip/version.rb index 55d4ac2..633899d 100644 --- a/lib/zip/version.rb +++ b/lib/zip/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Zip VERSION = '3.0.0' end diff --git a/rubyzip.gemspec b/rubyzip.gemspec index f858ee8..b331648 100644 --- a/rubyzip.gemspec +++ b/rubyzip.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'zip/version' diff --git a/samples/example.rb b/samples/example.rb index 345e7e1..3e82d0a 100755 --- a/samples/example.rb +++ b/samples/example.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true $LOAD_PATH << '../lib' system('zip example.zip example.rb gtk_ruby_zip.rb') diff --git a/samples/example_filesystem.rb b/samples/example_filesystem.rb index 0d93ab6..d37eaee 100755 --- a/samples/example_filesystem.rb +++ b/samples/example_filesystem.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true $LOAD_PATH << '../lib' diff --git a/samples/example_recursive.rb b/samples/example_recursive.rb index 56a5cc7..175e69f 100644 --- a/samples/example_recursive.rb +++ b/samples/example_recursive.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'zip' # This is a simple example which uses rubyzip to diff --git a/samples/gtk_ruby_zip.rb b/samples/gtk_ruby_zip.rb index a86f0a9..ed8410a 100755 --- a/samples/gtk_ruby_zip.rb +++ b/samples/gtk_ruby_zip.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true $LOAD_PATH << '../lib' diff --git a/samples/qtzip.rb b/samples/qtzip.rb index 2c189ed..715623a 100755 --- a/samples/qtzip.rb +++ b/samples/qtzip.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true $VERBOSE = true diff --git a/samples/write_simple.rb b/samples/write_simple.rb index 8bb31bb..f793920 100755 --- a/samples/write_simple.rb +++ b/samples/write_simple.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true $LOAD_PATH << '../lib' diff --git a/samples/zipfind.rb b/samples/zipfind.rb index 8f0dbf2..c388838 100755 --- a/samples/zipfind.rb +++ b/samples/zipfind.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true $VERBOSE = true diff --git a/test/basic_zip_file_test.rb b/test/basic_zip_file_test.rb index 8ff999b..160fd20 100644 --- a/test/basic_zip_file_test.rb +++ b/test/basic_zip_file_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class BasicZipFileTest < MiniTest::Test diff --git a/test/bzip2_support_test.rb b/test/bzip2_support_test.rb index ab86b4e..119d1c0 100644 --- a/test/bzip2_support_test.rb +++ b/test/bzip2_support_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class Bzip2SupportTest < MiniTest::Test diff --git a/test/case_sensitivity_test.rb b/test/case_sensitivity_test.rb index fdbee8e..0a9844b 100644 --- a/test/case_sensitivity_test.rb +++ b/test/case_sensitivity_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ZipCaseSensitivityTest < MiniTest::Test diff --git a/test/central_directory_entry_test.rb b/test/central_directory_entry_test.rb index c060a4d..a6898c5 100644 --- a/test/central_directory_entry_test.rb +++ b/test/central_directory_entry_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ZipCentralDirectoryEntryTest < MiniTest::Test diff --git a/test/central_directory_test.rb b/test/central_directory_test.rb index 6dfd9ad..011bdb5 100644 --- a/test/central_directory_test.rb +++ b/test/central_directory_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ZipCentralDirectoryTest < MiniTest::Test diff --git a/test/constants_test.rb b/test/constants_test.rb index 8be0171..d31419f 100644 --- a/test/constants_test.rb +++ b/test/constants_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ConstantsTest < MiniTest::Test diff --git a/test/crypto/null_encryption_test.rb b/test/crypto/null_encryption_test.rb index ca03996..e6b6ef5 100644 --- a/test/crypto/null_encryption_test.rb +++ b/test/crypto/null_encryption_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class NullEncrypterTest < MiniTest::Test diff --git a/test/crypto/traditional_encryption_test.rb b/test/crypto/traditional_encryption_test.rb index 51f6cbb..c3cc9fe 100644 --- a/test/crypto/traditional_encryption_test.rb +++ b/test/crypto/traditional_encryption_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class TraditionalEncrypterTest < MiniTest::Test diff --git a/test/data/notzippedruby.rb b/test/data/notzippedruby.rb index 79f9cbb..65b52b5 100755 --- a/test/data/notzippedruby.rb +++ b/test/data/notzippedruby.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true class NotZippedRuby def return_true diff --git a/test/decompressor_test.rb b/test/decompressor_test.rb index d7ff2e7..9109a2e 100644 --- a/test/decompressor_test.rb +++ b/test/decompressor_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class DecompressorTest < MiniTest::Test TEST_COMPRESSION_METHOD = 255 diff --git a/test/deflater_test.rb b/test/deflater_test.rb index 35d7b0c..fb78220 100644 --- a/test/deflater_test.rb +++ b/test/deflater_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class DeflaterTest < MiniTest::Test diff --git a/test/encryption_test.rb b/test/encryption_test.rb index 0b59e64..110e7a3 100644 --- a/test/encryption_test.rb +++ b/test/encryption_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class EncryptionTest < MiniTest::Test diff --git a/test/entry_set_test.rb b/test/entry_set_test.rb index fd038de..4c9f202 100644 --- a/test/entry_set_test.rb +++ b/test/entry_set_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ZipEntrySetTest < MiniTest::Test diff --git a/test/entry_test.rb b/test/entry_test.rb index e6ac7a4..7c1cf60 100644 --- a/test/entry_test.rb +++ b/test/entry_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ZipEntryTest < MiniTest::Test diff --git a/test/errors_test.rb b/test/errors_test.rb index 5e6260f..2f1b506 100644 --- a/test/errors_test.rb +++ b/test/errors_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ErrorsTest < MiniTest::Test diff --git a/test/extra_field_test.rb b/test/extra_field_test.rb index c8958fa..7aea91e 100644 --- a/test/extra_field_test.rb +++ b/test/extra_field_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ZipExtraFieldTest < MiniTest::Test diff --git a/test/extra_field_ut_test.rb b/test/extra_field_ut_test.rb index 6b85497..74cb21f 100644 --- a/test/extra_field_ut_test.rb +++ b/test/extra_field_ut_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ZipExtraFieldUTTest < MiniTest::Test diff --git a/test/file_extract_directory_test.rb b/test/file_extract_directory_test.rb index 02a3fd0..fc10979 100644 --- a/test/file_extract_directory_test.rb +++ b/test/file_extract_directory_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ZipFileExtractDirectoryTest < MiniTest::Test diff --git a/test/file_extract_test.rb b/test/file_extract_test.rb index d8306b3..16fba3a 100644 --- a/test/file_extract_test.rb +++ b/test/file_extract_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ZipFileExtractTest < MiniTest::Test diff --git a/test/file_options_test.rb b/test/file_options_test.rb index 61b86e8..e9c612c 100644 --- a/test/file_options_test.rb +++ b/test/file_options_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class FileOptionsTest < MiniTest::Test @@ -8,9 +10,9 @@ class FileOptionsTest < MiniTest::Test EXTPATH_1 = ::File.join(Dir.tmpdir, 'extracted_1.txt').freeze EXTPATH_2 = ::File.join(Dir.tmpdir, 'extracted_2.txt').freeze EXTPATH_3 = ::File.join(Dir.tmpdir, 'extracted_3.txt').freeze - ENTRY_1 = 'entry_1.txt'.freeze - ENTRY_2 = 'entry_2.txt'.freeze - ENTRY_3 = 'entry_3.txt'.freeze + ENTRY_1 = 'entry_1.txt' + ENTRY_2 = 'entry_2.txt' + ENTRY_3 = 'entry_3.txt' def teardown ::File.unlink(ZIPPATH) if ::File.exist?(ZIPPATH) diff --git a/test/file_permissions_test.rb b/test/file_permissions_test.rb index 2d8283c..1b31a79 100644 --- a/test/file_permissions_test.rb +++ b/test/file_permissions_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class FilePermissionsTest < MiniTest::Test diff --git a/test/file_split_test.rb b/test/file_split_test.rb index 22dd134..50fc4a4 100644 --- a/test/file_split_test.rb +++ b/test/file_split_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ZipFileSplitTest < MiniTest::Test diff --git a/test/file_test.rb b/test/file_test.rb index bdba569..6f1e109 100644 --- a/test/file_test.rb +++ b/test/file_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ZipFileTest < MiniTest::Test diff --git a/test/filesystem/dir_iterator_test.rb b/test/filesystem/dir_iterator_test.rb index e46da42..6223b44 100644 --- a/test/filesystem/dir_iterator_test.rb +++ b/test/filesystem/dir_iterator_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' require 'zip/filesystem' diff --git a/test/filesystem/directory_test.rb b/test/filesystem/directory_test.rb index 8ad04d9..5717702 100644 --- a/test/filesystem/directory_test.rb +++ b/test/filesystem/directory_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' require 'zip/filesystem' diff --git a/test/filesystem/file_mutating_test.rb b/test/filesystem/file_mutating_test.rb index ccba6e3..91d45af 100644 --- a/test/filesystem/file_mutating_test.rb +++ b/test/filesystem/file_mutating_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' require 'zip/filesystem' diff --git a/test/filesystem/file_nonmutating_test.rb b/test/filesystem/file_nonmutating_test.rb index 485298f..bc0e41d 100644 --- a/test/filesystem/file_nonmutating_test.rb +++ b/test/filesystem/file_nonmutating_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' require 'zip/filesystem' diff --git a/test/filesystem/file_stat_test.rb b/test/filesystem/file_stat_test.rb index b8efe75..0f6e2b5 100644 --- a/test/filesystem/file_stat_test.rb +++ b/test/filesystem/file_stat_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' require 'zip/filesystem' diff --git a/test/gentestfiles.rb b/test/gentestfiles.rb index bb1b981..c46e9c2 100755 --- a/test/gentestfiles.rb +++ b/test/gentestfiles.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true $VERBOSE = true diff --git a/test/inflater_test.rb b/test/inflater_test.rb index 7748c94..424d47a 100644 --- a/test/inflater_test.rb +++ b/test/inflater_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class InflaterTest < MiniTest::Test include DecompressorTests diff --git a/test/input_stream_test.rb b/test/input_stream_test.rb index a1adf10..2d192ab 100644 --- a/test/input_stream_test.rb +++ b/test/input_stream_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ZipInputStreamTest < MiniTest::Test diff --git a/test/ioextras/abstract_input_stream_test.rb b/test/ioextras/abstract_input_stream_test.rb index a18c4e3..6bc87d4 100644 --- a/test/ioextras/abstract_input_stream_test.rb +++ b/test/ioextras/abstract_input_stream_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' require 'zip/ioextras' diff --git a/test/ioextras/abstract_output_stream_test.rb b/test/ioextras/abstract_output_stream_test.rb index 8c61244..d4a8d0a 100644 --- a/test/ioextras/abstract_output_stream_test.rb +++ b/test/ioextras/abstract_output_stream_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' require 'zip/ioextras' diff --git a/test/ioextras/fake_io_test.rb b/test/ioextras/fake_io_test.rb index 612f442..07b24b5 100644 --- a/test/ioextras/fake_io_test.rb +++ b/test/ioextras/fake_io_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' require 'zip/ioextras' diff --git a/test/local_entry_test.rb b/test/local_entry_test.rb index 1317fb4..9d2e3ed 100644 --- a/test/local_entry_test.rb +++ b/test/local_entry_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ZipLocalEntryTest < MiniTest::Test diff --git a/test/output_stream_test.rb b/test/output_stream_test.rb index c813945..3b46f61 100644 --- a/test/output_stream_test.rb +++ b/test/output_stream_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ZipOutputStreamTest < MiniTest::Test diff --git a/test/pass_thru_compressor_test.rb b/test/pass_thru_compressor_test.rb index 334ba90..455f800 100644 --- a/test/pass_thru_compressor_test.rb +++ b/test/pass_thru_compressor_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class PassThruCompressorTest < MiniTest::Test diff --git a/test/pass_thru_decompressor_test.rb b/test/pass_thru_decompressor_test.rb index e0b6689..937c3ac 100644 --- a/test/pass_thru_decompressor_test.rb +++ b/test/pass_thru_decompressor_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class PassThruDecompressorTest < MiniTest::Test include DecompressorTests diff --git a/test/path_traversal_test.rb b/test/path_traversal_test.rb index 47c7e30..9676432 100644 --- a/test/path_traversal_test.rb +++ b/test/path_traversal_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class PathTraversalTest < MiniTest::Test diff --git a/test/samples/example_recursive_test.rb b/test/samples/example_recursive_test.rb index 4fb1488..a2af3ec 100644 --- a/test/samples/example_recursive_test.rb +++ b/test/samples/example_recursive_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' require 'fileutils' require_relative '../../samples/example_recursive' diff --git a/test/settings_test.rb b/test/settings_test.rb index 0510a6f..6e33573 100644 --- a/test/settings_test.rb +++ b/test/settings_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ZipSettingsTest < MiniTest::Test diff --git a/test/stored_support_test.rb b/test/stored_support_test.rb index 28836b9..1a12591 100644 --- a/test/stored_support_test.rb +++ b/test/stored_support_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class StoredSupportTest < MiniTest::Test diff --git a/test/test_helper.rb b/test/test_helper.rb index 212a24c..125ee99 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'simplecov' require 'minitest/autorun' require 'minitest/unit' diff --git a/test/unicode_file_names_and_comments_test.rb b/test/unicode_file_names_and_comments_test.rb index 7950e28..1518171 100644 --- a/test/unicode_file_names_and_comments_test.rb +++ b/test/unicode_file_names_and_comments_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ZipUnicodeFileNamesAndComments < MiniTest::Test diff --git a/test/zip64_full_test.rb b/test/zip64_full_test.rb index ed11ed6..769709e 100644 --- a/test/zip64_full_test.rb +++ b/test/zip64_full_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if ENV['FULL_ZIP64_TEST'] require 'minitest/autorun' require 'minitest/unit' diff --git a/test/zip64_support_test.rb b/test/zip64_support_test.rb index 3e4154a..0e96a9c 100644 --- a/test/zip64_support_test.rb +++ b/test/zip64_support_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class Zip64SupportTest < MiniTest::Test