Commit Graph

1039 Commits

Author SHA1 Message Date
John Lees-Miller d3027eab95 Update changelog for #423 2019-12-15 17:44:40 +00:00
John Lees-Miller c925bdbf3a
Merge pull request #423 from hainesr/sync-options
Sync options and fix inconsistent behaviour of `Zip::File#get_entry` and `Zip::File#find_entry`.
2019-12-15 17:37:26 +00:00
Robert Haines f3a2f4a8ec Add tests for File#get/find_entry. 2019-10-31 18:15:17 +00:00
Robert Haines 2d6b6e024b Ensure File#get/find_entry work consistently.
I have switched around the logic somewhat so that `get_entry` calls
`find_entry` and raises an exception if it gets `nil` back.
2019-10-31 18:12:18 +00:00
Robert Haines 0f6ca04a9d Set the default options in `Entry` the same as `File`. 2019-10-31 17:30:14 +00:00
Robert Haines cef3bc0784 A test to ensure find/get entry calls agree. 2019-10-31 17:27:19 +00:00
John Lees-Miller 6389d657c1 Update changelog for #413 and #419 2019-10-27 22:34:41 +00:00
John Lees-Miller e539560067
Merge pull request #419 from hainesr/travis-tweaks
Travis updates and tweaks
2019-10-27 22:21:30 +00:00
John Lees-Miller c9b6523226
Merge pull request #413 from hainesr/file-options
Fix `restore_times` option when extracting, and test file options
2019-10-27 22:09:13 +00:00
Robert Haines 323437c577 Update to OpenJDK 11 (LTS) in the CI tests.
OpenJDK 8 is now out of (commercial) support. Leave a version testing
with OpenJDK 8 as it's still in free support for another year.
2019-10-21 14:43:15 +01:00
Robert Haines 0fd4f914cd Update to use a later Ubuntu version on Travis.
Move to Xenial, which allows us to test with later OpenJDKs. Moving to
Bionic would be nice but it no longer has OpenJDK 8, which is still in
support.
2019-10-21 14:41:58 +01:00
Robert Haines acc3d9ed24 Use `fast-finish` in the test matrix.
This means that long-running tests that are allowed to fail don't hold
up the build being marked as finished, if all the required tests have
passed.
2019-10-21 12:31:43 +01:00
Robert Haines 1a21f39e82 Add a test for restoring file permissions on extract. 2019-10-20 19:30:34 +01:00
Robert Haines 2bdd37d894 Add a convenience method for creating DOSTime instances.
DOSTime::from_time creates a DOSTime instance from a vanilla Time
instance.
2019-10-20 19:30:34 +01:00
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