Commit Graph

1025 Commits

Author SHA1 Message Date
Robert Haines 8c694d38ee Add functionality to restore file timestamps.
There has been an option in `Zip::File` (`:restore_times`) for a long
time, but it seems it has never worked. Firstly the actual timestamp of
an added file wasn't being saved, and secondly an extracted file wasn't
having its timestamp set correctly.

This commit fixes both of those issues, and adds tests to make sure.
2019-10-20 19:30:27 +01:00
Robert Haines 378293539d Make the attr_accessors in File more readable.
Note what the default is and that a couple of them will change at some
point soon.
2019-10-19 20:46:21 +01:00
Robert Haines 253457545e Correctly set/default options in the File class.
Fixes #395. Set the options to false for now for consistency.
2019-10-19 20:45:29 +01:00
John Lees-Miller e43e36057c Update changelog for #416 and #418 2019-10-19 18:20:15 +01:00
John Lees-Miller 056c00cb16
Merge pull request #418 from hainesr/open-options
Add `options` parameter to `Zip::File.open`.
2019-10-19 17:38:38 +01:00
John Lees-Miller 15a54b4c2b
Merge pull request #416 from hainesr/warnings
Print library warnings to stderr with `warn` (not `puts`).
2019-10-19 17:38:26 +01:00
Robert Haines 3fea9958c2 Update comment for `Zip::File.open`. 2019-10-19 07:15:51 +01:00
Robert Haines f58e38012c Add the `options` parameter to `Zip::File.open`. 2019-10-19 07:04:04 +01:00
Robert Haines ccabd94e42 Update tests to check error messages.
Check that they say the right things and are on stderr, not stdout. A
nice side effect of this is that it cleans up the test output.
2019-10-13 15:40:49 +01:00
Robert Haines 935a4f31a2 Make warning messages consistent.
And fix a few spelling mistakes.
2019-10-12 12:52:04 +01:00
Robert Haines 340379f080 Use `warn` instead of `puts` for messages from the library code.
`warn` has the advantage of easily being disabled by, the `-W0` interpreter
flag or setting $VERBOSE to nil.
2019-10-11 19:31:42 +01:00
John Lees-Miller 34d2074ecb Update changelog for #411 2019-10-04 21:36:31 +01:00
John Lees-Miller a9a313a386
Merge pull request #411 from hainesr/tempfiles
Clean up temp file usage and fix #410
2019-10-04 21:33:15 +01:00
Robert Haines e87184200a Require 'tmpdir' only in the tests.
It's not used in the library code.
2019-09-27 16:28:02 +01:00
Robert Haines 506d557edc StreamableStream now uses the OS temp directory.
Rather than using the local folder.

Fixes #410
2019-09-27 16:13:56 +01:00
John Lees-Miller 2825898f69
Merge pull request #408 from rubyzip/v2-0-0
Bump version to 2.0.0
2019-09-25 21:23:47 +01:00
John Lees-Miller cb407b1065 Bump version to 2.0.0 2019-09-25 21:10:05 +01:00
John Lees-Miller e1d9af6e46
Merge pull request #406 from rubyzip/bump-supported-ruby
Bump supported ruby versions
2019-09-25 20:41:10 +01:00
John Lees-Miller 3641a963ea
Merge pull request #405 from rubyzip/remove-test-files
Remove test files from gem
2019-09-25 20:40:38 +01:00
John Lees-Miller e79d9ea292
Merge pull request #407 from rubyzip/v1-3-0
Bump version to 1.3.0
2019-09-25 20:24:16 +01:00
John Lees-Miller 7c65e1e359 Bump version to 1.3.0 2019-09-25 19:59:24 +01:00
John Lees-Miller d65fe7bd28
Merge pull request #403 from rubyzip/check-size
Validate entry sizes when extracting
2019-09-25 19:56:00 +01:00
John Lees-Miller 35446f467b Drop old ruby and JDK versions from CI 2019-09-18 22:01:48 +01:00
John Lees-Miller 74d4bec371 Remove test files from gem 2019-09-18 21:04:33 +01:00
John Lees-Miller 97cb6aefe6 Warn when an entry size is invalid 2019-09-18 18:34:23 +01:00
John Lees-Miller 7849f7362a Default validate_entry_sizes to false for 1.3 release 2019-09-15 15:23:35 +01:00
John Lees-Miller 4167f0ce67 Validate entry sizes when extracting 2019-09-15 15:11:35 +01:00
John Lees-Miller 94b7fa2769 [ci skip] Update changelog 2019-09-15 15:03:19 +01:00
John Lees-Miller 93505ca16f Check expected entry size in add_stored test 2019-09-15 14:58:13 +01:00
John Lees-Miller 6619bf3a1d
Merge pull request #366 from hainesr/add-stored
Zip::File.add_stored() to add uncompressed files.
2019-09-15 14:53:31 +01:00
Robert Haines ecb2776218 Zip::File.add_stored() to add uncompressed files.
Adding uncompressed files to a zip archive can be overly complex, so
this convenience method makes it easier.
2019-09-14 13:58:30 +01:00
John Lees-Miller 09bb9465be
Merge pull request #402 from orien/gem-metadata
Add project metadata to the gemspec
2019-09-13 21:59:54 +01:00
Orien Madgwick 72e7ca0d04 Add project metadata to the gemspec
As per https://guides.rubygems.org/specification-reference/#metadata,
add metadata to the gemspec file. This'll allow people to more easily
access the source code, raise issues and read the changelog. These
`bug_tracker_uri`, `changelog_uri`, `documentation_uri`, `wiki_uri` and
`source_code_uri` links will appear on the rubygems page at
https://rubygems.org/gems/rubyzip and be available via the rubygems API
after the next release.
2019-09-12 12:56:00 +10:00
John Lees-Miller 0d85cb6a49 Bump to 1.2.4 2019-09-06 18:01:30 +01:00
John Lees-Miller 9a41ce65c4 Add more explicit test for #280 2019-09-06 17:58:38 +01:00
John Lees-Miller eeef5073d5 Add test case based on #146 2019-09-05 19:00:34 +01:00
John Lees-Miller 7fbaf1e6c0
Merge pull request #360 from hainesr/fix-open-buffer
Fix #280 - `open_buffer` mangles the content of the buffer it is given.
2019-09-05 18:48:39 +01:00
John Lees-Miller ee6fb82958
Merge pull request #399 from rubyzip/rbx-4
Fix CI and try rbx-4
2019-07-20 16:45:10 +01:00
John Lees-Miller 8dfc95dc79 Hold jruby at 9.1 on JDK 7 2019-07-20 15:15:30 +01:00
John Lees-Miller fc23db2efc Update changelog for #399 2019-07-20 15:06:17 +01:00
John Lees-Miller b2573f6069 Use rbx-4 in CI 2019-07-07 18:18:49 +01:00
John Lees-Miller 5152f6f7a0 Put CI back to trusty
Xenial is now the default.

Trusty is now out of support but still not end of life.

Also omit the ruby patch versions so we don't have to keep updating 
them.
2019-07-07 17:59:35 +01:00
John Lees-Miller 2ffbc3b169
Merge pull request #397 from rubyzip/tidy-examples
Update example_recursive in README
2019-05-24 18:56:46 +02:00
John Lees-Miller 952950e474 Update changelog for #397
Also run changelog through prettier for consistency with README.md.
2019-05-24 17:25:17 +01:00
John Lees-Miller 1e21121f6c Update example_recursive in README
The sample has been updated several times since the last update to the 
README. Also ran through prettier for formatting consistency.
2019-05-24 17:07:35 +01:00
John Lees-Miller 9d891f7353
Fix link typo in changelog 2019-05-23 18:35:24 +01:00
John Lees-Miller 6f0b219265
Merge pull request #393 from rubyzip/v1-2-3
Bump version to 1.2.3
2019-05-23 19:33:53 +02:00
John Lees-Miller ef516bdc81
Merge pull request #391 from jdleesmiller/fix-expand-path
Allow tilde in zip entry names
2019-05-23 19:33:30 +02:00
John Lees-Miller ada408d60a Add #394 to changelog 2019-03-22 21:18:40 +02:00
John Lees-Miller 249775f563
Merge pull request #394 from olleolleolle/patch-1
CI: update to latest MRI, drop a setting
2019-03-22 21:17:27 +02:00