Commit Graph

205 Commits

Author SHA1 Message Date
Pavel.Lobashov c45a639c54 fix rubocop Style/TrailingBlankLines cop 2015-03-20 22:45:50 +03:00
Pavel.Lobashov 7dcba79bb5 fix rubocop Style/TrailingComma cop 2015-03-20 22:44:21 +03:00
Pavel.Lobashov 6fac8c7e86 fix rubocop Style/TrailingWhitespace cop 2015-03-20 22:43:29 +03:00
Pavel.Lobashov c677730af9 fix rubocop Style/UnneededPercentQ cop 2015-03-20 22:40:27 +03:00
Pavel Lobashov 7a8a8b6fd2 fix rubocop Style/WhileUntilModifier warning 2015-03-20 18:33:43 +03:00
Pavel Lobashov fc8e04271a fix rubocop Style/WordArray warning 2015-03-20 18:31:47 +03:00
weshatheleopard 360636ca41 Integration test 2015-03-16 22:09:01 +00:00
weshatheleopard cfc38b30a1 PROPER case insensitivity handling 2015-03-08 13:38:57 -05:00
Sergey Konotopov 61a4435cc3 Case insensitivity option for #find_entry 2015-02-20 01:20:07 +03:00
Alexander Simonov 002959f2e2 Add tests from #182 for testing tempfile as IO for OutputStream::write_buffer 2015-02-02 23:40:52 +02:00
Shigeaki Matsumura 5834e999b1 set Zip.default_compression manually to avoid side effect of others 2015-01-17 13:05:58 +09:00
Shigeaki Matsumura f61b3e9b0e added test case for traditional encryption
zip file generated by archive-zip as reference
2015-01-08 18:31:17 +09:00
Shigeaki Matsumura 85a7bbdf1a add data descriptor for each entries when encrypto 2015-01-08 18:30:32 +09:00
Shigeaki Matsumura 87d1a5a775 added test cases for encryption support 2015-01-06 00:49:16 +09:00
lobashov ecea81f5f6 add test to check warn_invalid_date but without verification 2014-12-02 10:39:35 +03:00
Henry Yang a7a11e33bd NTFS Extra Field (0x000a) support 2014-09-11 23:04:23 -07:00
Jason King b859e9a50a Sorted `EntrySet#each` test 2014-07-24 11:39:37 -07:00
Jason King 96f84aee4c Fixes occasional failures of tests 2014-07-24 11:34:55 -07:00
Alexander Simonov d460b81745 Fix #171 2014-07-23 12:59:29 +03:00
Robert Haines 4b943fb263 Remove unused variable 'comment' in file_test.rb. 2014-07-23 12:59:14 +03:00
Robert Haines 9e642acdc9 Don't use deprecated File.exists? in tests. 2014-07-23 12:59:14 +03:00
Robert Haines cd2ac6c747 Clean up test/dummy.txt generated file.
Now force file generation into the test/data/generated directory where other
such files go so tests are cleaned up properly.
2014-07-23 12:59:14 +03:00
Robert Haines 4b4c10d9da Clean up and disambiguate extEntry generated file.
Now force file generation into the test/data/generated directory where other
such files go so tests are cleaned up properly.
2014-07-23 12:59:13 +03:00
Robert Haines 6eee8aafbf Clean up output_stream_test.rb generated files.
Now force file generation into the test/data/generated directory where other
such files go so tests are cleaned up properly.
2014-07-23 12:59:13 +03:00
Robert Haines 8100cf69a0 Clean up okToDeleteMoved.txt generated file.
Now force file generation into the test/data/generated directory where other
such files go so tests are cleaned up properly.
2014-07-23 12:59:13 +03:00
Robert Haines 58f24bbb94 Clean up emptyOutDir generated file.
Now force file generation into the test/data/generated directory where other
such files go so tests are cleaned up properly.
2014-07-23 12:59:13 +03:00
Robert Haines 656116c55a Clean up deflater_test.rb generated files.
Now force file generation into the test/data/generated directory where other
such files go so tests are cleaned up properly.
2014-07-23 12:59:13 +03:00
Robert Haines 2b6044530f Clean up local_entry_test.rb generated files.
Now force file generation into the test/data/generated directory where other
such files go so tests are cleaned up properly.
2014-07-23 12:59:13 +03: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 2fcdc3a3ea Revert "Return created zip file from Zip::File.open when supplied a block"
This reverts commit e3029d0b10.
2014-07-02 18:15:54 +03:00
Alexander Simonov 09011eca6b Merge pull request #141 from zacstewart/master
Add InputStream#ungetc
2014-06-21 17:48:49 +03:00
Robert Haines d01b0cde12 Rename the unicode tests file so it actually runs. 2014-06-21 13:47:03 +01:00
Robert Haines 81d39ff7c3 Declare utf-8 encoding for the unicode tests.
Will fail without this as there are utf-8 characters in the file.
2014-06-21 13:43:14 +01:00
Tyler Pickett e3029d0b10 Return created zip file from Zip::File.open when supplied a block
This change is to match ruby zip’s behavior to core’s IO.open when
supplied a block.
2014-06-17 10:08:26 -06:00
Mehmet Celik b5c5b6803e Zip::Entry::DEFLATED was forced on every file 2014-04-23 08:42:09 +02:00
Orien Madgwick 9d4292007c alias error names
Ensure we maintain the v1 interface
2014-04-11 08:32:17 +10:00
Alexander Simonov 1173397321 Merge pull request #150 from iangreenleaf/tempfile_cleanup
Clean up tempfiles from output stream
2014-04-06 12:32:10 +03:00
Ian Young 37ed325783 Clean up tempfiles from output stream, fixes #57 2014-04-04 14:32:11 -07:00
Ian Young 3e28147525 Remove line doing random copy 2014-04-04 14:03:58 -07:00
Jeremy Stanley ea33f64ed8 qualify namespaces in zip64_full_test 2014-03-13 11:53:08 -06:00
Jeremy Stanley 38205d02f3 fix FULL_ZIP64_TEST
this test fails if zip64 write support isn't enabled
2014-03-13 07:42:57 -06:00
Jeremy Stanley 9e144061b9 fix modifying existing zipfile with zip64 enabled
The local header size computed from the central directory entry
is incorrect due to the Zip64Placeholder in the local entry.
This caused us to seek to the wrong location when copying an
unchanged compressed data stream.

(The same problem could occur when modifying any zip file where
the local header and central directory header contain different
variable-sized fields, so it's a good idea not to trust the CD
to tell us the local header size in any case.)
2014-03-12 15:57:52 -06:00
Zac Stewart b3d3b15968 Use String#reverse in test for 1.9 compatibility 2014-03-12 11:28:02 -04:00
Zac Stewart 96377f72de Add InputStream#ungetc
Works like IO#ungetc
2014-03-11 21:19:24 -04:00
Alexander Simonov 81c4c4face Fix #135 2014-03-01 00:31:10 +02:00
Sam Rawlins a37e13c6f0 File.exists? -> File.exist? 2014-02-06 15:00:38 -08:00
Alexander Simonov ec81c30382 Fix for #126 and #127 2014-01-24 11:37:38 +02:00
Alexander Simonov 1e03c13a2e Fix tests on JRuby 2014-01-20 23:57:56 +02:00
Alexander Simonov 541ff9657f Move file generation to one folder 2014-01-20 23:42:27 +02:00
Alexander Simonov 37bfd10b36 master merge 2014-01-20 23:35:20 +02:00
Alexander Simonov 58f08ca0e1 Split all tests to small files. Move to minitest 2014-01-20 23:31:06 +02:00
René Sprotte 73b4da4232 Add test for default compression setting. 2014-01-20 15:22:23 +01:00
Alexander Simonov 52efd5cd61 Fix tests. Fix duping StringIO for writing 2014-01-19 14:06:54 +02:00
Alexander Simonov c7f0b17abf Real fix for #119 2014-01-19 13:45:58 +02:00
Mike Perham a2737dc246 Add test reproducing #119 2014-01-06 14:48:48 -08:00
Alexander Simonov b67675480d fix jRuby Building #104 2013-10-22 22:04:43 +03:00
Alexander Simonov cb6e628fb2 Fix #28 and #103 2013-10-20 23:09:52 +03:00
Alexander Simonov 9c25518761 Merge pull request #101 from ProGNOMmers/issue_100
Add entry arguments to Zip::File#get_output_stream. Fixes rubyzip/rubyzip#100
2013-10-19 12:35:09 -07:00
Alexander Simonov 569d0b7078 Fix #102 recover file permissions if zip file was exist 2013-10-19 22:05:18 +03:00
Maurizio De Santis bc512d7061 Add missing Zip::Entry arguments to Zip::File#get_output_stream. Fixes rubyzip/rubyzip#100 2013-10-11 11:40:44 +02:00
Alexander Simonov d1aba72c03 Merge pull request #99 from jstanley0/master
Add read/write support for zip64 extensions
2013-09-27 23:41:56 -07:00
Jeremy Stanley af165f5cbd Add read/write support for zip64 extensions
This commit adds the capability of creating archives larger than
4GB via zip64 extensions. It also fixes bugs reading archives of
this size (specifically, the 64-bit offset of the local file
header was not being read from the central directory entry).

To maximize compatibility, zip64 extensions are used only when
required. Unfortunately, at the time we write a local file header,
we don't know the size of the file and thus whether a Zip64
Extended Information Extra Field will be required. Therefore
this commit writes a 'placeholder' extra field to reserve space
for the zip64 entry, which will be written if necessary when
we update the local entry with the final sizes and CRC. I use
the signature "\x99\x99" for this field, following the example
of DotNetZip which does the same.

This commit also adds a rake task, zip64_full_test, which
fully tests zip64 by actually creating and verifying a 4GB zip
file. Please note, however, that this test requires UnZip
version 6.00 or newer, which may not be supplied by your OS.
This test doesn't run along with the main unit tests because
it takes a few minutes to complete.
2013-09-27 20:41:00 -06:00
Alexander Simonov c707d60117 set direct path to zip 2013-09-25 21:23:37 +03:00
Krishna Dole 8d3258eebf Calling #read(number_of_bytes) on a Zip::InputStream should return nil at EOF.
Previously it would return an empty string the first time, then raise on subsequent calls.
2013-09-24 15:29:19 -07:00
Alexander Simonov 2bd6ebea11 JRuby support 2013-09-17 20:34:19 +03:00
Alexander Simonov 5f2411955a Fix tests for 1.9.2 2013-08-30 00:22:19 +03:00
Alexander Simonov 73d9e1c8a0 StingIO support #47 #18 2013-08-29 23:50:12 +03:00
Alexander Simonov 609de2ff48 Zip64 read-only support. Fix #81 2013-08-26 23:26:14 +03:00
Alexander Simonov 3fa6f837da Remove coverages from repo 2013-08-22 00:37:26 +03:00
Alexander Simonov 317fdd0d04 Add posibility to set Language encoding flag. Changed way to set settings. 2013-08-15 01:00:27 +03:00
Alexander Simonov a8c25e2ac9 Coveralls 2013-07-01 00:21:59 +03:00
Alexander Simonov 261cee901b Fix tests 2013-06-03 11:03:19 +03:00
Alexander Simonov 61ce5dbc5f Refactoring part #2
Rubyzip interface was changed!
2013-06-03 10:56:24 +03:00
Alexander Simonov 974f5675c2 Code refactoring start 2013-06-02 21:33:03 +03:00
Alexander Simonov ce2c3ede73 Fix merge 2013-04-13 13:26:20 +03:00
Alexander Simonov 85e6468180 Merge pull request #75 from hbakhtiyor/split-archive-feature
Split archive feature
2013-04-13 01:58:23 -07:00
Abd ar-Rahman Hamidi 5604881648 Add ZipFile.split method for spliting an archive into parts with chunk size. With samples and test cases 2013-04-07 18:29:33 +05:00
Kenichi Kamiya 2fb1d175bc Use parentheses for an assertion in test
This commit removes below interpreter warning.

* warning: (...) interpreted as grouped expression
2013-04-03 23:48:02 +09:00
Kenichi Kamiya 11136d5ce3 Rename unused variable in test
This commit removes below interpreter warning.

* warning: assigned but unused variable
2013-04-03 23:47:24 +09:00
Alexander Simonov 66f0c0fafe Merge pull request #65 from marcuserronius/preserve-order
preserves order of zipfile entries
2013-02-07 00:55:28 -08:00
Alexander Simonov 9f46091456 Merge pull request #67 from JustinLove/getslimit
support gets-with-limit from ruby 1.9
2013-02-07 00:48:38 -08:00
Alexander Simonov 8549489929 Merge pull request #69 from JustinLove/unorderedtest
update tests which fail on 1.8 due to unordered hash
2013-02-07 00:47:22 -08:00
Matt Rogers 640694b6fc Fix several assigned but unused variable warnings
Only removes the warnings that have no impact on the code
2013-01-02 11:27:38 -06:00
Matt Rogers d84e40086a Fix variable shadowing warnings 2013-01-02 11:16:23 -06:00
Matt Rogers aca1fa3df4 Fix indentation 2013-01-02 11:08:57 -06:00
Justin Love 43793875d8 update tests which fail on 1.8 due to unordered hash 2012-12-20 18:12:59 -06:00
Justin Love 11df150531 support gets-with-limit from ruby 1.9 2012-12-07 20:53:22 -06:00
Mark Hubbart 31259bb416 preserves order of zipfile entries
Makes ZipEntrySet preserve the original order of files in the zipfile.
Also preserves the insertion order of files.
2012-10-19 12:24:02 -07:00
Justin Love 3406ad49cd read boundaries could break a multi-character gets terminator 2012-08-29 19:11:23 -05:00
Justin Love d45d656353 Merge branch 'master' into pos 2012-07-05 13:56:26 -05:00
Alexander Simonov dbc0213633 Merge pull request #48 from yaauie/feature/glob
Add ZipFile#glob and ZipFileSystem#glob
2012-05-19 01:36:59 -07:00
Ryan Biesemeyer 739b352f32 add glob support in ZipFile and ZipFileSystem, refactor existing ZipEntrySet#glob to accept block and be more memory efficient with results. 2012-05-18 21:57:19 +00:00
Dylan Markow c60520f299 Properly commit when the comment is the only thing changed. 2012-04-06 16:40:21 -07:00
Alexander Simonov 82c2037cf6 Merge pull request #40 from edouard/keep_entry_mtime
ZipEntry modification time isn’t saved in zip file
2012-03-27 02:50:38 -07:00
Édouard Brière 9268fefaf1 Fix: ZipOutputStream#put_next_entry now keeps entry modification time 2012-03-27 11:31:13 +02:00
Édouard Brière 6ea9e53e35 Add failing test demonstrating that file timestamp isn’t stored
ZipOutputStream#put_next_entry(ZipEntry) should create a zip file containing entries with the correct timestamp
2012-03-27 09:55:34 +02:00
wpc d33d8c2398 Fix performance issue on ZipFile#find_entry when reading/writing zip
file with large amount of files and directories.
2012-03-26 00:05:06 -07:00
Alexander Simonov f9b9a30b6f Refactoring 2012-03-13 10:13:58 +02:00
kellydunn 7830a83b52 [lib][test] Renaming option for simplicity 2012-03-12 16:34:50 -07:00
kellydunn 265409fd66 [test] Adding in tests to check for adding files with changing settings 2012-03-12 15:18:50 -07:00