Commit Graph

994 Commits

Author SHA1 Message Date
Alexander Simonov 1dfce0543b Merge pull request #312 from koic/use_latest_rubies
Use the latest rubies on Travis
2017-02-04 23:22:58 +02:00
mwlang 14b8fed18c allows open_buffer to work without a given block 2017-01-16 13:24:22 -06:00
Koichi ITO 960414aff0 Fix warnings: `constant ::Fixnum is deprecated` in Ruby 2.4 2017-01-08 16:41:23 +09:00
Koichi ITO 7c250c0127 Fix warning: `::[] is deprecated. Use ::new instead.` 2017-01-08 15:37:41 +09:00
Koichi ITO 33d0949902 Fix warnings: `Use assert_nil if expecting nil` 2017-01-08 15:31:51 +09:00
Koichi ITO 4a7ec6a865 Use the latest rubies on Travis 2017-01-08 14:56:45 +09:00
Alexander Simonov f34c1d972d Merge pull request #289 from Meatballs1/fix_readme_dir_recursion
Replace puts with write in README.md for dir recursion
2016-12-21 10:37:47 +02:00
Alexander Simonov c12b8b3553 Merge pull request #308 from dogatana/support_cp932
remove tr to support cp932 encoding
2016-12-21 10:37:25 +02:00
Alexander Simonov 8d1808f50a Merge pull request #306 from deivid-rodriguez/fix_build
Revert "Cleanup after ourselves"
2016-12-21 07:03:56 +02:00
dogatana a4e3b55bb2 remove tr to support cp932 encoding 2016-12-07 22:35:33 +09:00
David Rodríguez f157dfc1b6 Revert "Cleanup after ourselves"
This reverts commit 6597af1257 since
7caab1f already fixed the same thing. It should fix the build.
2016-11-10 08:23:34 -02:00
Alexander Simonov 812609111c Merge pull request #297 from EagleSHCN/patch-1
example_recursive.rb lost some special characters (0x1a at file end) …
2016-11-09 22:22:16 +02:00
Alexander Simonov a0cf673186 Merge pull request #300 from hainesr/fix-create-perms
Fix permissions on new zip files (#294)
2016-11-09 22:19:04 +02:00
Alexander Simonov 82fa57cc83 Merge pull request #303 from deivid-rodriguez/extended_globbing
Extended globbing
2016-11-09 22:17:17 +02:00
Alexander Simonov fdc7a50e89 Merge pull request #298 from hainesr/cleanup-post-tests
Clean up empty.zip after running tests.
2016-11-09 22:16:24 +02:00
Alexander Simonov 2569a655fe Merge pull request #283 from entwanderer/master
Fixing outdated/incorrect example code in Readme and some typos
2016-11-09 22:15:38 +02:00
Alexander Simonov bf8ffa46c0 Merge pull request #304 from knut2/internal_file_attributes
Update entry.rb
2016-11-09 22:15:12 +02:00
Alexander Simonov 80af58eb40 Merge pull request #301 from hainesr/update-travis
Update travis config
2016-11-09 22:13:57 +02:00
knut2 579e78f1ef Update entry.rb
Add accessor to @internal_file_attributes
See http://stackoverflow.com/questions/39800771/hot-to-set-binary-flag-in-zip-file-with-rubyzip
2016-10-10 23:04:36 +02:00
David Rodríguez 9c475f5160 Add extended globbing support 2016-10-08 19:32:53 -03:00
David Rodríguez 6597af1257 Cleanup after ourselves
Otherwise tests leave an empty file there.
2016-10-08 19:23:45 -03:00
David Rodríguez 366a1d8dca Fix test failure when running a single test file
```
bundle exec rake TEST=test/file_test.rb
```

was giving

```
  1) Error:
ZipFileTest#test_get_output_stream:
NameError: uninitialized constant ZipFileTest::ZipEntryTest
    .../test/file_test.rb:59:in `block in test_get_output_stream'
    .../lib/zip/file.rb:102:in `open'
    .../test/file_test.rb:45:in `test_get_output_stream'
```
2016-10-08 19:21:30 -03:00
Robert Haines c00d767533 Fix rubocop offence caused by temp files changes. 2016-09-05 17:34:12 +01:00
Robert Haines fc23f68f77 Refactor the create logic in Zip::File.
Make the internal @create varible more consistent and actually match the
documentation.

Zip::File::CREATE is now true, rather than 1.

A new test is added to check if passing 1 in still works to ensure backwards
compatibility.
2016-09-05 15:16:57 +01:00
Robert Haines 63ed0d970b Refactor the code which manages temp files.
Combine the creation of the temporary filename with the writing to it.
2016-09-05 15:07:18 +01:00
Robert Haines 331c4bb070 No need to allow jruby builds to fail any more. 2016-09-02 12:04:47 +01:00
Robert Haines dee6fbe8e1 Try latest jruby. 2016-09-02 11:49:12 +01:00
Robert Haines e8def12e87 Allow Travis jruby tests to fail, for now.
It's not ideal to have these tests being allowed to fail but while there are
issues with jruby itself I think it's best to have the Travis tests pass.

Jruby should be OK from the next release given that jruby-head passes at the
moment.
2016-09-01 19:50:24 +01:00
Robert Haines 36dc49bd41 Test with Java 8 in Travis. 2016-09-01 19:36:56 +01:00
Robert Haines b2e65caa66 Update Travis jrubies to latest stable. 2016-09-01 19:36:03 +01:00
Robert Haines 3b75ffe266 Add jruby-head to Travis but allow failures. 2016-09-01 19:24:13 +01:00
Robert Haines 40eca74cdb Update Travis rubies to latest in each branch.
Rubies available are detailed here: http://rubies.travis-ci.org/
2016-09-01 19:19:08 +01:00
Robert Haines 936604453f Test ruby 2.3.1 with Travis. 2016-09-01 19:16:10 +01:00
Robert Haines b005c487b4 Clean up file permissions tests.
Now we don't differentiate between Windows and Linux in the library code for
this, we don't need separate tests.
2016-09-01 12:15:30 +01:00
Robert Haines 7b14d11c00 Stop using 0600 perms for temporary files.
This fixes #294 in what I hope is a more sensible way than trying to mess with
umasks, etc, directly.

Temporary files were being created with 0600 permissions and then being set to
different permissions, based on umask, etc, afterwards. I don't know what the
rationale for this was, but there were errors in the umask calculations when
moving from the temporary file to the intended end result.
2016-09-01 12:10:56 +01:00
Robert Haines 7caab1f467 Clean up empty.zip after running tests.
After running the tests there was a file left in the project directory,
'empty.zip', which was simply 'touch'ed to use as a null file. Switch to create
this as one of the generated test files so it's cleaned up automatically.

Also, use 'null.zip' as the name as there is already an 'empty.zip' generated
that is a zip file, but empty.
2016-08-28 12:17:17 +01:00
EagleSHCN b0b54e505f example_recursive.rb lost some special characters (0x1a at file end) in file
example_recursive.rb lost some special characters ( for example 0x1a at file end ) , it should related to io stream implementation . Use internal zip add method instead of File.read could avoid this lose . 

An issue is posted at https://github.com/rubyzip/rubyzip/issues/296
2016-08-15 12:41:41 +08:00
Marcos Wright-Kuhns 4b27538818 Add a test helper for more human-readable file permission comparison
Before this change:
  1) Failure:
FilePermissionsTest#test_umask_027 [/Users/marcoswk/workspace/rubyzip/test/file_permissions_test.rb:52]:
Expected: 33184
  Actual: 33183

After this change:
  1) Failure:
FilePermissionsTest#test_umask_027 [/Users/marcoswk/workspace/rubyzip/test/file_permissions_test.rb:52]:
--- expected
+++ actual
@@ -1,2 +1,2 @@
 # encoding: US-ASCII
-"100640"
+"100637"
2016-06-30 14:47:41 -07:00
Marcos Wright-Kuhns 046b7f8f86 Add a failing test when the umask is 0027
This test fails because in *NIX when the umask is 0027, files are created with 0640 permissions. The current implementation of Zip::File.create_file_permissions does a simple subtraction of 0666 - 0027 == 0637
2016-06-30 14:43:52 -07:00
Marcos Wright-Kuhns b6896c4de3 Switch file_permission_test.rb to compare with File.open perms
...instead of comparing against in-ruby subtraction math.
2016-06-30 14:41:27 -07:00
Meatballs c0dccb1582
Replace puts with write in README.md for dir recursion 2016-05-09 15:55:16 +01:00
Alexander Simonov 7aa3666e34 Merge pull request #278 from mnaberez/changelog-1.2.0
Add changelog entries for RubyZip 1.2.0
2016-04-06 23:12:27 +03:00
Alexander Simonov 4b21d52ccd Merge pull request #287 from peter50216/patch-1
Small change to "Modify docx file with rubyzip"
2016-04-06 23:11:20 +03:00
peter50216 4d86978362 Small change to "Modify docx file with rubyzip"
To make copy-pasting work :D
2016-03-28 09:41:50 +08:00
beyrle 63c0ef0782 - copied current version of example_recursive.rb to readme (old version was buggy on windows systems) 2016-03-22 11:25:11 +01:00
beyrle 66d6076871 - revised typo 2016-03-22 11:24:28 +01:00
Mike Naberezny 4a6077164e Add changelog entries for 1.2.0. Fixes #275 2016-02-29 10:38:56 -08:00
Alexander Simonov 3ec40d875d
Version bump 2016-02-19 11:14:57 +02:00
Alexander Simonov 088f44a233 Merge pull request #270 from pol0nium/master
Fix in example_recursive
2016-01-22 11:52:53 +02:00
Alexander Simonov 62558f09b2 Merge pull request #268 from Neil-Ni/master
Fix typo file name in samples/example_filesystem.rb
2016-01-22 11:52:33 +02:00