Commit Graph

37 Commits

Author SHA1 Message Date
Robert Haines 1c06454985 Update minimum ruby version to 3.0.
All rubies before 3.0 are EOL and this is a major version bump, so it's
the right time to do this.
2024-03-01 22:14:48 +00:00
Robert Haines 307fc6c6e9 Mark other mutating methods in `Entry` as dirty.
Also, remove `Entry#extra=` as it makes no sense (and wasn't even being
tested).

And remove slightly odd test that was assuming an archive would not be
changed if its utime was changed - even if it was being changed back
immediately. This test was merely confirming that we weren't catching
timestamp changes correctly.
2022-06-20 17:18:20 +01:00
Finn Bacall 451a04f7a2 Test for `Errno::ENOENT` 2022-06-16 20:31:35 +01:00
Finn Bacall 8b87b0e200 Implement `Zip::FileSystem::ZipFsFile#symlink?` 2022-06-16 20:31:35 +01:00
Robert Haines cf258bbb71 Move to ruby 2.5 as the earliest supported version.
2.4 is nearly two years beyond EOL now.

Closes #484.
2022-01-11 22:26:09 +00:00
Robert Haines d1329299c3 Extract `FileSystem::File` from the main filesystem file. 2021-06-06 15:02:49 +01:00
Robert Haines e10badf68e Fix Style/FrozenStringLiteralComment cop. 2021-05-25 21:24:50 +01:00
Robert Haines c2b9aa2893 Correctly read extra fields when opening a zip file.
Previously, only the extra fields stored in the central directory were
being read in. In reality it is often the case that the extra field in
the central directory is just a marker, and the full data is in the
local header. So we need to read both in and merge the two into the
final correct extra field. This merging infrastructure was already
implemented in the extra field code but we never actually read the
local extra fields in until now.

Reading the central directory headers and local entry headers seems
rather fragile, so we can't just read one over the other and hope to end
up with a correctly merged set of extra fields because this breaks other
things. So we need to specifically read the local extra field data and
merge just those bits.

This commit also fixes a couple of tests that were 'broken' by us now
reading extra fields in correctly!
2020-10-03 18:27:20 +01:00
Robert Haines e6f414f539 Fix Naming/VariableName cop in the tests. 2020-02-29 18:11:52 +00:00
Robert Haines 5ce4e13ddd Configure and fix Style/ClassCheck cop. 2020-02-15 16:26:32 +00:00
Robert Haines 0df6cb3059 Fix Style/SymbolProc cop. 2020-02-15 16:26:32 +00:00
Robert Haines 2cbdbf110b Fix Style/SignalException cop. 2020-02-15 16:26:32 +00:00
Robert Haines 61c83b2a1a Configure Layout/HashAlignment cop. 2020-02-15 16:26:32 +00:00
Robert Haines 20743a53b2 Fix Lint/AmbiguousBlockAssociation cop. 2020-02-15 16:26:32 +00:00
Takumasa Ochi cf91112b57 Apply automatic correction by rubocop 2017-06-29 11:57:12 +09:00
Koichi ITO 33d0949902 Fix warnings: `Use assert_nil if expecting nil` 2017-01-08 15:31:51 +09:00
Pavel Lobashov 1e99ff69b9 Revert "fix rubocop cop Style/ClassCheck". It cause regression in tests
This reverts commit 8c13dfc265.
2015-06-08 10:45:23 +03:00
Pavel Lobashov 8c13dfc265 fix rubocop cop Style/ClassCheck 2015-06-08 10:36:41 +03:00
Pavel Lobashov ce7e01a206 fix rubocop Style/CommentIndentation cop 2015-03-24 19:31:28 +03:00
Pavel Lobashov d6cc880c36 fix rubocop Style/MultilineTernaryOperator cop 2015-03-23 19:32:08 +03:00
Pavel Lobashov 8533708ace fix rubocop Style/Not cop 2015-03-23 19:24:34 +03:00
Pavel Lobashov 1ba81ff46f fix rubocop Style/NumericLiterals cop 2015-03-23 19:23:04 +03:00
Pavel Lobashov 47b72f5cab fix rubocop Style/LeadingCommentSpace cop 2015-03-23 19:06:01 +03:00
Pavel.Lobashov 5ea5710b18 fix rubocop Style/SpaceBeforeBlockBraces cop 2015-03-22 19:59:33 +03:00
Pavel.Lobashov b311998e25 fix rubocop Style/SpaceInsideBlockBraces cop 2015-03-22 19:49:07 +03:00
Pavel.Lobashov d2b4a528de fix rubocop Style/SpaceAfterComma cop 2015-03-22 19:41:47 +03:00
Pavel.Lobashov 762474089a fix rubocop Style/IndentationWidth cop 2015-03-22 19:22:56 +03:00
Pavel Lobashov b93ef1266f fix rubocop Style/StringLiterals cop 2015-03-21 11:27:44 +03:00
Pavel Lobashov b9a757e045 fix rubocop Style/EmptyLinesAroundClassBody cop 2015-03-21 11:21:26 +03:00
Pavel Lobashov d0c8e8df60 fix rubocop Style/EmptyLines cop 2015-03-21 11:19:14 +03:00
Pavel Lobashov d2d8590ef8 fix rubocop Style/Blocks cop 2015-03-21 11:10:37 +03:00
Pavel Lobashov 98e6b5d057 fix rubocop Style/AlignParameters cop 2015-03-21 10:44:56 +03:00
Pavel.Lobashov eae8112180 fix rubocop Lint/StringConversionInInterpolation cop 2015-03-20 23:06:47 +03:00
Pavel.Lobashov c677730af9 fix rubocop Style/UnneededPercentQ cop 2015-03-20 22:40:27 +03:00
Henry Yang a7a11e33bd NTFS Extra Field (0x000a) support 2014-09-11 23:04:23 -07:00
Robert Haines 9785b66a43 Update tests to use the minitest 5.x API.
MiniTest::Unit::TestCase -> MiniTest::Test
MiniTest::Unit.after_tests -> MiniTest.after_run
2014-07-23 12:59:13 +03:00
Alexander Simonov 58f08ca0e1 Split all tests to small files. Move to minitest 2014-01-20 23:31:06 +02:00