Commit Graph

200 Commits

Author SHA1 Message Date
lobashov 7498e8a9d3 add warn_invalid_date option 2014-12-01 18:39:29 +03:00
Nikolay Petrachkov 5a4d1ba52a Use tr instead of gsub 2014-10-22 16:37:21 +02:00
Henry Yang a7a11e33bd NTFS Extra Field (0x000a) support 2014-09-11 23:04:23 -07:00
Jason King cf0a5fe386 `Zip.sort_entries` working for zip output 2014-07-24 11:39:37 -07:00
Alexander Simonov d460b81745 Fix #171 2014-07-23 12:59:29 +03:00
Alexander Simonov 2ef328b11b Version bump 2014-07-02 18:17:00 +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 2cd56671fc Version bump 2014-07-02 14:11:04 +03:00
Alexander Simonov 62e0a87e49 Merge pull request #166 from layerssss/master
treat empty file as non-exists
2014-07-02 14:07:52 +03:00
Alexander Simonov a989e8c145 Revert "Speed up Deflater sysread speed when number_of_bytes is small and @output_buffer is large"
This reverts commit a800987a52.
2014-07-02 14:05:13 +03:00
Michael Yin fe1d4ade49 treat empty file as non-exists 2014-07-02 12:46:44 +08:00
Alexander Simonov 09011eca6b Merge pull request #141 from zacstewart/master
Add InputStream#ungetc
2014-06-21 17:48:49 +03: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
Alexander Simonov 6b77562d32 Version bump 2014-05-30 20:12:33 +03:00
Mehmet Celik b5c5b6803e Zip::Entry::DEFLATED was forced on every file 2014-04-23 08:42:09 +02:00
mrloop 9eb35ca0c4 Don't send empty string to stream
Unneeded method call removed.
This was causing an issue in rails 4 and zipline
https://github.com/fringd/zipline/pull/10
2014-04-17 13:23:12 +01:00
Alexander Simonov 3ab98483c9 Merge pull request #154 from orien/exception_naming
Alias for legacy error names
2014-04-11 10:03:31 +03:00
Orien Madgwick 9d4292007c alias error names
Ensure we maintain the v1 interface
2014-04-11 08:32:17 +10:00
Alexander Simonov 47ef890de6 Version bump 2014-04-06 18:54:23 +03:00
Orien Madgwick 34f5025d76 default arg for write_buffer
Adding the io parameter to OutputStream::write_buffer breaks backward
compatibility with v1.1.0. Adding a default value reinstates backward
compatibility.
2014-04-06 23:45:19 +10:00
Ian Young 37ed325783 Clean up tempfiles from output stream, fixes #57 2014-04-04 14:32:11 -07:00
Alexander Simonov 527137db5f Version bump 2014-03-18 15:10:31 +02:00
Alexander Simonov f7949596eb Fix #143 2014-03-18 15:09:50 +02:00
Alexander Simonov 57482232da Version bump 2014-03-16 19:29:15 +02:00
Jeremy Stanley b0b46a5b37 only write zip64 central directory if zip64 support enabled 2014-03-13 10:48:04 -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 192f910992 Use string concatenation instead of String#prepend
For < Ruby 1.9.3 compatibility
2014-03-12 11:52:12 -04:00
Zac Stewart 96377f72de Add InputStream#ungetc
Works like IO#ungetc
2014-03-11 21:19:24 -04:00
Alexander Simonov 2697c7ea4f Fix #138 2014-03-09 20:38:24 +02:00
Alexander Simonov 34437e77b8 Fix for #125 2014-03-01 12:17:22 +02:00
Alexander Simonov 81c4c4face Fix #135 2014-03-01 00:31:10 +02:00
Alexander Simonov 09ac194540 Merge pull request #130 from srawlins/less-allocations-writing-a-zipfile
Allocate less Arrays and Strings when writing a zip
2014-02-07 09:05:34 +02:00
Sam Rawlins a37e13c6f0 File.exists? -> File.exist? 2014-02-06 15:00:38 -08:00
Henry Yang a800987a52 Speed up Deflater sysread speed when number_of_bytes is small and @output_buffer is large 2014-02-04 10:56:56 -08:00
Sam Rawlins a68a36c759 Allocate less Arrays and Strings when writing a zip 2014-02-03 12:15:08 -08:00
Alexander Simonov ec81c30382 Fix for #126 and #127 2014-01-24 11:37:38 +02:00
René Sprotte 471aa1599e Add config to set the default compression level. 2014-01-20 14:38:22 +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
Alexander Simonov 18506c6345 Fix #119 calling 'path' on not IO objects 2014-01-06 20:29:39 +02:00
Jim Ryan 0f8ce2cbb8 Make File.open_buffer support Tempfiles 2013-12-02 18:57:42 -05:00
Alexander Simonov 3917dedbb5 Version bump 2013-11-01 16:36:25 +02:00
Alexander Simonov 94b29aba5d Fix #106 Set options about restoring ownerships, permissions and times. restore permissions enabled by default. 2013-10-27 16:30:48 +02: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 b87c95cc7e fix string encoding of zip64 header ids for ruby 2.0 2013-09-27 21:45:08 -06: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