rubyzip 0.5.11 → 0.5.12

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rubyzip might be problematic. Click here for more details.

data/ChangeLog CHANGED
@@ -1,3 +1,29 @@
1
+ 2005-09-06 21:19 thomas
2
+
3
+ * lib/zip/zip.rb: [no log message]
4
+
5
+ 2005-09-06 21:08 thomas
6
+
7
+ * NEWS: [no log message]
8
+
9
+ 2005-09-06 21:04 thomas
10
+
11
+ * lib/zip/zip.rb, test/gentestfiles.rb, test/ziptest.rb: Fixed
12
+ problem on windows - tempfile has to be set to binmode again when
13
+ it is reopened
14
+
15
+ 2005-09-04 16:45 thomas
16
+
17
+ * Rakefile: [no log message]
18
+
19
+ 2005-09-04 16:33 thomas
20
+
21
+ * TODO: [no log message]
22
+
23
+ 2005-09-04 15:43 thomas
24
+
25
+ * test/ziptest.rb: [no log message]
26
+
1
27
  2005-09-03 10:27 thomas
2
28
 
3
29
  * NEWS: [no log message]
data/NEWS CHANGED
@@ -1,3 +1,7 @@
1
+ = Version 0.5.12
2
+
3
+ Fixed problem with writing binary content to a ZipFile in MS Windows.
4
+
1
5
  = Version 0.5.11
2
6
 
3
7
  Fixed name clash file method copy_stream from fileutils.rb. Fixed
data/Rakefile CHANGED
@@ -24,7 +24,7 @@ PKG_FILES.add %w{ lib/**/*.rb }
24
24
  def clobberFromCvsIgnore(path)
25
25
  CLOBBER.add File.readlines(path+'/.cvsignore').map {
26
26
  |f| File.join(path, f.chomp)
27
- }
27
+ } rescue StandardError
28
28
  end
29
29
 
30
30
  clobberFromCvsIgnore '.'
data/TODO CHANGED
@@ -1,4 +1,8 @@
1
1
 
2
+ * Adjust rdoc stylesheet to advertise inherited methods if possible
3
+ * Suggestion: Add ZipFile/ZipInputStream example that demonstrates extracting all entries.
4
+ * Suggestion: ZipFile#extract destination should default to "."
5
+ * Suggestion: ZipEntry should have extract(), get_input_stream() methods etc
2
6
  * rename write to syswrite
3
7
  * provide alias for write -> syswrite in ioextras.rb
4
8
  * (is buffering used anywhere with write?)
@@ -19,7 +19,7 @@ end
19
19
 
20
20
  module Zip
21
21
 
22
- VERSION = '0.5.11'
22
+ VERSION = '0.5.12'
23
23
 
24
24
  RUBY_MINOR_VERSION = RUBY_VERSION.split(".")[1].to_i
25
25
 
@@ -1330,6 +1330,7 @@ module Zip
1330
1330
  raise StandardError, "cannot open entry for reading while its open for writing - #{name}"
1331
1331
  end
1332
1332
  @tempFile.open # reopens tempfile from top
1333
+ @tempFile.binmode
1333
1334
  if block_given?
1334
1335
  begin
1335
1336
  yield(@tempFile)
@@ -113,7 +113,7 @@ class TestZipFile
113
113
  File.open("data/generated/longBinary.bin", "wb") {
114
114
  |file|
115
115
  while (file.tell < 3E5)
116
- file << testBinaryPattern << rand
116
+ file << testBinaryPattern << rand << "\0"
117
117
  end
118
118
  }
119
119
  raise "failed to create test zip '#{TEST_ZIP2.zip_name}'" unless
@@ -468,8 +468,8 @@ class ZipInputStreamTest < Test::Unit::TestCase
468
468
  ZipInputStream.open(TestZipFile::TEST_ZIP2.zip_name) {
469
469
  |zis|
470
470
  e = zis.get_next_entry
471
- assert_equal("#!/usr/bin/env ruby\n", zis.gets)
472
- assert_equal("\n", zis.gets)
471
+ assert_equal("#!/usr/bin/env ruby", zis.gets.chomp)
472
+ assert_equal("", zis.gets.chomp)
473
473
  assert_equal("$VERBOSE =", zis.read(10))
474
474
  }
475
475
  end
@@ -1043,13 +1043,18 @@ class ZipFileTest < Test::Unit::TestCase
1043
1043
  assert_equal(entryCount+1, zf.size)
1044
1044
  assert_equal("Putting stuff in data/generated/empty.txt", zf.read("data/generated/empty.txt"))
1045
1045
 
1046
+ zf.get_output_stream('entry.bin') {
1047
+ |os|
1048
+ os.write(File.open('data/generated/4entry.zip', 'rb').read)
1049
+ }
1046
1050
  }
1047
1051
 
1048
1052
  ZipFile.open(TEST_ZIP.zip_name) {
1049
1053
  |zf|
1050
- assert_equal(entryCount+1, zf.size)
1054
+ assert_equal(entryCount+2, zf.size)
1051
1055
  assert_equal("Putting stuff in newEntry.txt", zf.read("newEntry.txt"))
1052
1056
  assert_equal("Putting stuff in data/generated/empty.txt", zf.read("data/generated/empty.txt"))
1057
+ assert_equal(File.open('data/generated/4entry.zip', 'rb').read, zf.read("entry.bin"))
1053
1058
  }
1054
1059
  end
1055
1060
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: rubyzip
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.5.11
7
- date: 2005-09-03 00:00:00 +02:00
6
+ version: 0.5.12
7
+ date: 2005-09-06 00:00:00 +02:00
8
8
  summary: rubyzip is a ruby module for reading and writing zip files
9
9
  require_paths:
10
10
  - lib