rubyzip 0.5.12 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rubyzip might be problematic. Click here for more details.
- data/ChangeLog +151 -17
 - data/NEWS +13 -0
 - data/README +2 -0
 - data/Rakefile +2 -3
 - data/TODO +2 -3
 - data/lib/download_quizzes.rb +119 -0
 - data/lib/quiz1/t/solutions/Bill Guindon/solitaire.rb +205 -0
 - data/lib/quiz1/t/solutions/Carlos/solitaire.rb +111 -0
 - data/lib/quiz1/t/solutions/Dennis Ranke/solitaire.rb +111 -0
 - data/lib/quiz1/t/solutions/Florian Gross/solitaire.rb +301 -0
 - data/lib/quiz1/t/solutions/Glen M. Lewis/solitaire.rb +268 -0
 - data/lib/quiz1/t/solutions/James Edward Gray II/solitaire.rb +132 -0
 - data/lib/quiz1/t/solutions/Jamis Buck/bin/main.rb +13 -0
 - data/lib/quiz1/t/solutions/Jamis Buck/lib/cipher.rb +230 -0
 - data/lib/quiz1/t/solutions/Jamis Buck/lib/cli.rb +24 -0
 - data/lib/quiz1/t/solutions/Jamis Buck/test/tc_deck.rb +30 -0
 - data/lib/quiz1/t/solutions/Jamis Buck/test/tc_key-stream.rb +19 -0
 - data/lib/quiz1/t/solutions/Jamis Buck/test/tc_keying-algorithms.rb +31 -0
 - data/lib/quiz1/t/solutions/Jamis Buck/test/tc_solitaire-cipher.rb +66 -0
 - data/lib/quiz1/t/solutions/Jamis Buck/test/tc_unkeyed-algorithm.rb +17 -0
 - data/lib/quiz1/t/solutions/Jamis Buck/test/tests.rb +2 -0
 - data/lib/quiz1/t/solutions/Jim Menard/solitaire_cypher.rb +204 -0
 - data/lib/quiz1/t/solutions/Jim Menard/test.rb +47 -0
 - data/lib/quiz1/t/solutions/Moses Hohman/cipher.rb +97 -0
 - data/lib/quiz1/t/solutions/Moses Hohman/deck.rb +140 -0
 - data/lib/quiz1/t/solutions/Moses Hohman/solitaire.rb +14 -0
 - data/lib/quiz1/t/solutions/Moses Hohman/test_cipher.rb +68 -0
 - data/lib/quiz1/t/solutions/Moses Hohman/test_deck.rb +146 -0
 - data/lib/quiz1/t/solutions/Moses Hohman/test_util.rb +38 -0
 - data/lib/quiz1/t/solutions/Moses Hohman/testsuite.rb +5 -0
 - data/lib/quiz1/t/solutions/Moses Hohman/util.rb +27 -0
 - data/lib/quiz1/t/solutions/Niklas Frykholm/solitaire.rb +151 -0
 - data/lib/quiz1/t/solutions/Thomas Leitner/solitaire.rb +198 -0
 - data/lib/zip/ioextras.rb +17 -15
 - data/lib/zip/zip.rb +394 -112
 - data/lib/zip/zipfilesystem.rb +2 -2
 - data/test/gentestfiles.rb +3 -1
 - data/test/zipfilesystemtest.rb +2 -2
 - data/test/ziptest.rb +34 -29
 - metadata +35 -12
 - data/samples/zipdialogui.rb +0 -80
 - data/test/data/file2.txt.other +0 -0
 - data/test/zlibtest.rb +0 -26
 
    
        data/lib/zip/zipfilesystem.rb
    CHANGED
    
    | 
         @@ -482,7 +482,7 @@ module Zip 
     | 
|
| 
       482 
482 
     | 
    
         
             
                  alias rmdir  delete
         
     | 
| 
       483 
483 
     | 
    
         
             
                  alias unlink delete
         
     | 
| 
       484 
484 
     | 
    
         | 
| 
       485 
     | 
    
         
            -
                  def mkdir(entryName, permissionInt =  
     | 
| 
      
 485 
     | 
    
         
            +
                  def mkdir(entryName, permissionInt = 0755)
         
     | 
| 
       486 
486 
     | 
    
         
             
                    @mappedZip.mkdir(entryName, permissionInt)
         
     | 
| 
       487 
487 
     | 
    
         
             
                  end
         
     | 
| 
       488 
488 
     | 
    
         | 
| 
         @@ -571,7 +571,7 @@ module Zip 
     | 
|
| 
       571 
571 
     | 
    
         
             
                                    &continueOnExistsProc)
         
     | 
| 
       572 
572 
     | 
    
         
             
                  end
         
     | 
| 
       573 
573 
     | 
    
         | 
| 
       574 
     | 
    
         
            -
                  def mkdir(fileName, permissionInt =  
     | 
| 
      
 574 
     | 
    
         
            +
                  def mkdir(fileName, permissionInt = 0755)
         
     | 
| 
       575 
575 
     | 
    
         
             
                    @zipFile.mkdir(expand_to_entry(fileName), permissionInt)
         
     | 
| 
       576 
576 
     | 
    
         
             
                  end
         
     | 
| 
       577 
577 
     | 
    
         | 
    
        data/test/gentestfiles.rb
    CHANGED
    
    | 
         @@ -86,6 +86,7 @@ class TestZipFile 
     | 
|
| 
       86 
86 
     | 
    
         
             
            	       files.index(File.basename(TEST_ZIP3.zip_name)) &&
         
     | 
| 
       87 
87 
     | 
    
         
             
            	       files.index(File.basename(TEST_ZIP4.zip_name)) &&
         
     | 
| 
       88 
88 
     | 
    
         
             
            	       files.index("empty.txt")      &&
         
     | 
| 
      
 89 
     | 
    
         
            +
            	       files.index("empty_chmod640.txt")      &&
         
     | 
| 
       89 
90 
     | 
    
         
             
            	       files.index("short.txt")      &&
         
     | 
| 
       90 
91 
     | 
    
         
             
            	       files.index("longAscii.txt")  &&
         
     | 
| 
       91 
92 
     | 
    
         
             
            	       files.index("longBinary.bin") ))
         
     | 
| 
         @@ -95,6 +96,7 @@ class TestZipFile 
     | 
|
| 
       95 
96 
     | 
    
         
             
            	system("zip #{TEST_ZIP1.zip_name} -d data/file2.txt")
         
     | 
| 
       96 
97 
     | 
    
         | 
| 
       97 
98 
     | 
    
         
             
                  File.open("data/generated/empty.txt", "w") {}
         
     | 
| 
      
 99 
     | 
    
         
            +
                  File.open("data/generated/empty_chmod640.txt", "w") { |f| f.chmod(0640) }
         
     | 
| 
       98 
100 
     | 
    
         | 
| 
       99 
101 
     | 
    
         
             
                  File.open("data/generated/short.txt", "w") { |file| file << "ABCDEF" }
         
     | 
| 
       100 
102 
     | 
    
         
             
                  ziptestTxt=""
         
     | 
| 
         @@ -138,7 +140,7 @@ class TestZipFile 
     | 
|
| 
       138 
140 
     | 
    
         
             
              end
         
     | 
| 
       139 
141 
     | 
    
         | 
| 
       140 
142 
     | 
    
         
             
              TEST_ZIP1 = TestZipFile.new("data/generated/empty.zip", [])
         
     | 
| 
       141 
     | 
    
         
            -
              TEST_ZIP2 = TestZipFile.new("data/generated/ 
     | 
| 
      
 143 
     | 
    
         
            +
              TEST_ZIP2 = TestZipFile.new("data/generated/5entry.zip", %w{ data/generated/longAscii.txt data/generated/empty.txt data/generated/empty_chmod640.txt data/generated/short.txt data/generated/longBinary.bin}, 
         
     | 
| 
       142 
144 
     | 
    
         
             
            			      "my zip comment")
         
     | 
| 
       143 
145 
     | 
    
         
             
              TEST_ZIP3 = TestZipFile.new("data/generated/test1.zip", %w{ data/file1.txt })
         
     | 
| 
       144 
146 
     | 
    
         
             
              TEST_ZIP4 = TestZipFile.new("data/generated/zipWithDir.zip", [ "data/file1.txt", 
         
     | 
    
        data/test/zipfilesystemtest.rb
    CHANGED
    
    | 
         @@ -270,7 +270,7 @@ class ZipFsFileNonmutatingTest < Test::Unit::TestCase 
     | 
|
| 
       270 
270 
     | 
    
         
             
                assert(! @zipFile.file.zero?("file1"))
         
     | 
| 
       271 
271 
     | 
    
         
             
                assert(@zipFile.file.zero?("dir1"))
         
     | 
| 
       272 
272 
     | 
    
         
             
                blockCalled = false
         
     | 
| 
       273 
     | 
    
         
            -
                ZipFile.open("data/generated/ 
     | 
| 
      
 273 
     | 
    
         
            +
                ZipFile.open("data/generated/5entry.zip") {
         
     | 
| 
       274 
274 
     | 
    
         
             
                  |zf|
         
     | 
| 
       275 
275 
     | 
    
         
             
                  blockCalled = true
         
     | 
| 
       276 
276 
     | 
    
         
             
                  assert(zf.file.zero?("data/generated/empty.txt"))
         
     | 
| 
         @@ -280,7 +280,7 @@ class ZipFsFileNonmutatingTest < Test::Unit::TestCase 
     | 
|
| 
       280 
280 
     | 
    
         
             
                assert(! @zipFile.file.stat("file1").zero?)
         
     | 
| 
       281 
281 
     | 
    
         
             
                assert(@zipFile.file.stat("dir1").zero?)
         
     | 
| 
       282 
282 
     | 
    
         
             
                blockCalled = false
         
     | 
| 
       283 
     | 
    
         
            -
                ZipFile.open("data/generated/ 
     | 
| 
      
 283 
     | 
    
         
            +
                ZipFile.open("data/generated/5entry.zip") {
         
     | 
| 
       284 
284 
     | 
    
         
             
                  |zf|
         
     | 
| 
       285 
285 
     | 
    
         
             
                  blockCalled = true
         
     | 
| 
       286 
286 
     | 
    
         
             
                  assert(zf.file.stat("data/generated/empty.txt").zero?)
         
     | 
    
        data/test/ziptest.rb
    CHANGED
    
    | 
         @@ -94,8 +94,6 @@ class ZipEntryTest < Test::Unit::TestCase 
     | 
|
| 
       94 
94 
     | 
    
         | 
| 
       95 
95 
     | 
    
         
             
                assert(entry7 != "hello")
         
     | 
| 
       96 
96 
     | 
    
         
             
                assert(entry7 != 12)
         
     | 
| 
       97 
     | 
    
         
            -
             
     | 
| 
       98 
     | 
    
         
            -
                assert(entry7 != ZipStreamableFile.new(entry7, "aPath"))
         
     | 
| 
       99 
97 
     | 
    
         
             
              end
         
     | 
| 
       100 
98 
     | 
    
         | 
| 
       101 
99 
     | 
    
         
             
              def test_compare
         
     | 
| 
         @@ -403,6 +401,7 @@ class ZipInputStreamTest < Test::Unit::TestCase 
     | 
|
| 
       403 
401 
     | 
    
         
             
              def test_new
         
     | 
| 
       404 
402 
     | 
    
         
             
                zis = ZipInputStream.new(TestZipFile::TEST_ZIP2.zip_name)
         
     | 
| 
       405 
403 
     | 
    
         
             
                assert_stream_contents(zis, TestZipFile::TEST_ZIP2)
         
     | 
| 
      
 404 
     | 
    
         
            +
                assert_equal(true, zis.eof?)
         
     | 
| 
       406 
405 
     | 
    
         
             
                zis.close    
         
     | 
| 
       407 
406 
     | 
    
         
             
              end
         
     | 
| 
       408 
407 
     | 
    
         | 
| 
         @@ -410,6 +409,7 @@ class ZipInputStreamTest < Test::Unit::TestCase 
     | 
|
| 
       410 
409 
     | 
    
         
             
                ZipInputStream.open(TestZipFile::TEST_ZIP2.zip_name) {
         
     | 
| 
       411 
410 
     | 
    
         
             
                  |zis|
         
     | 
| 
       412 
411 
     | 
    
         
             
                  assert_stream_contents(zis, TestZipFile::TEST_ZIP2)
         
     | 
| 
      
 412 
     | 
    
         
            +
                  assert_equal(true, zis.eof?)
         
     | 
| 
       413 
413 
     | 
    
         
             
                }
         
     | 
| 
       414 
414 
     | 
    
         
             
              end
         
     | 
| 
       415 
415 
     | 
    
         | 
| 
         @@ -421,19 +421,27 @@ class ZipInputStreamTest < Test::Unit::TestCase 
     | 
|
| 
       421 
421 
     | 
    
         
             
              def test_incompleteReads
         
     | 
| 
       422 
422 
     | 
    
         
             
                ZipInputStream.open(TestZipFile::TEST_ZIP2.zip_name) {
         
     | 
| 
       423 
423 
     | 
    
         
             
                  |zis|
         
     | 
| 
       424 
     | 
    
         
            -
                  entry = zis.get_next_entry
         
     | 
| 
      
 424 
     | 
    
         
            +
                  entry = zis.get_next_entry # longAscii.txt
         
     | 
| 
      
 425 
     | 
    
         
            +
                  assert_equal(false, zis.eof?)
         
     | 
| 
       425 
426 
     | 
    
         
             
                  assert_equal(TestZipFile::TEST_ZIP2.entry_names[0], entry.name)
         
     | 
| 
       426 
427 
     | 
    
         
             
                  assert zis.gets.length > 0
         
     | 
| 
       427 
     | 
    
         
            -
                   
     | 
| 
      
 428 
     | 
    
         
            +
                  assert_equal(false, zis.eof?)
         
     | 
| 
      
 429 
     | 
    
         
            +
                  entry = zis.get_next_entry # empty.txt
         
     | 
| 
       428 
430 
     | 
    
         
             
                  assert_equal(TestZipFile::TEST_ZIP2.entry_names[1], entry.name)
         
     | 
| 
       429 
431 
     | 
    
         
             
                  assert_equal(0, entry.size)
         
     | 
| 
       430 
432 
     | 
    
         
             
                  assert_equal(nil, zis.gets)
         
     | 
| 
       431 
     | 
    
         
            -
                   
     | 
| 
      
 433 
     | 
    
         
            +
                  assert_equal(true, zis.eof?)
         
     | 
| 
      
 434 
     | 
    
         
            +
                  entry = zis.get_next_entry # empty_chmod640.txt
         
     | 
| 
       432 
435 
     | 
    
         
             
                  assert_equal(TestZipFile::TEST_ZIP2.entry_names[2], entry.name)
         
     | 
| 
       433 
     | 
    
         
            -
                   
     | 
| 
       434 
     | 
    
         
            -
                   
     | 
| 
      
 436 
     | 
    
         
            +
                  assert_equal(0, entry.size)
         
     | 
| 
      
 437 
     | 
    
         
            +
                  assert_equal(nil, zis.gets)
         
     | 
| 
      
 438 
     | 
    
         
            +
                  assert_equal(true, zis.eof?)
         
     | 
| 
      
 439 
     | 
    
         
            +
                  entry = zis.get_next_entry # short.txt
         
     | 
| 
       435 
440 
     | 
    
         
             
                  assert_equal(TestZipFile::TEST_ZIP2.entry_names[3], entry.name)
         
     | 
| 
       436 
441 
     | 
    
         
             
                  assert zis.gets.length > 0
         
     | 
| 
      
 442 
     | 
    
         
            +
                  entry = zis.get_next_entry # longBinary.bin
         
     | 
| 
      
 443 
     | 
    
         
            +
                  assert_equal(TestZipFile::TEST_ZIP2.entry_names[4], entry.name)
         
     | 
| 
      
 444 
     | 
    
         
            +
                  assert zis.gets.length > 0
         
     | 
| 
       437 
445 
     | 
    
         
             
                }
         
     | 
| 
       438 
446 
     | 
    
         
             
              end
         
     | 
| 
       439 
447 
     | 
    
         | 
| 
         @@ -448,6 +456,7 @@ class ZipInputStreamTest < Test::Unit::TestCase 
     | 
|
| 
       448 
456 
     | 
    
         
             
                  buf << zis.read(100)
         
     | 
| 
       449 
457 
     | 
    
         
             
                  buf << (zis.gets || "")
         
     | 
| 
       450 
458 
     | 
    
         
             
                  buf << (zis.gets || "")
         
     | 
| 
      
 459 
     | 
    
         
            +
                  assert_equal(false, zis.eof?)
         
     | 
| 
       451 
460 
     | 
    
         | 
| 
       452 
461 
     | 
    
         
             
                  zis.rewind
         
     | 
| 
       453 
462 
     | 
    
         | 
| 
         @@ -459,6 +468,7 @@ class ZipInputStreamTest < Test::Unit::TestCase 
     | 
|
| 
       459 
468 
     | 
    
         
             
                  assert_equal(buf, buf2)
         
     | 
| 
       460 
469 
     | 
    
         | 
| 
       461 
470 
     | 
    
         
             
                  zis.rewind
         
     | 
| 
      
 471 
     | 
    
         
            +
                  assert_equal(false, zis.eof?)
         
     | 
| 
       462 
472 
     | 
    
         | 
| 
       463 
473 
     | 
    
         
             
                  assert_entry(e.name, zis, e.name)
         
     | 
| 
       464 
474 
     | 
    
         
             
                }
         
     | 
| 
         @@ -469,8 +479,11 @@ class ZipInputStreamTest < Test::Unit::TestCase 
     | 
|
| 
       469 
479 
     | 
    
         
             
                  |zis|
         
     | 
| 
       470 
480 
     | 
    
         
             
                  e = zis.get_next_entry
         
     | 
| 
       471 
481 
     | 
    
         
             
                  assert_equal("#!/usr/bin/env ruby", zis.gets.chomp)
         
     | 
| 
      
 482 
     | 
    
         
            +
                  assert_equal(false, zis.eof?)
         
     | 
| 
       472 
483 
     | 
    
         
             
                  assert_equal("", zis.gets.chomp)
         
     | 
| 
      
 484 
     | 
    
         
            +
                  assert_equal(false, zis.eof?)
         
     | 
| 
       473 
485 
     | 
    
         
             
                  assert_equal("$VERBOSE =", zis.read(10))
         
     | 
| 
      
 486 
     | 
    
         
            +
                  assert_equal(false, zis.eof?)
         
     | 
| 
       474 
487 
     | 
    
         
             
                }
         
     | 
| 
       475 
488 
     | 
    
         
             
              end
         
     | 
| 
       476 
489 
     | 
    
         | 
| 
         @@ -999,7 +1012,7 @@ module CommonZipFileFixture 
     | 
|
| 
       999 
1012 
     | 
    
         
             
              EMPTY_FILENAME = "emptyZipFile.zip"
         
     | 
| 
       1000 
1013 
     | 
    
         | 
| 
       1001 
1014 
     | 
    
         
             
              TEST_ZIP = TestZipFile::TEST_ZIP2.clone
         
     | 
| 
       1002 
     | 
    
         
            -
              TEST_ZIP.zip_name = " 
     | 
| 
      
 1015 
     | 
    
         
            +
              TEST_ZIP.zip_name = "5entry_copy.zip"
         
     | 
| 
       1003 
1016 
     | 
    
         | 
| 
       1004 
1017 
     | 
    
         
             
              def setup
         
     | 
| 
       1005 
1018 
     | 
    
         
             
                File.delete(EMPTY_FILENAME) if File.exists?(EMPTY_FILENAME)
         
     | 
| 
         @@ -1045,7 +1058,7 @@ class ZipFileTest < Test::Unit::TestCase 
     | 
|
| 
       1045 
1058 
     | 
    
         | 
| 
       1046 
1059 
     | 
    
         
             
                  zf.get_output_stream('entry.bin') {
         
     | 
| 
       1047 
1060 
     | 
    
         
             
            	|os|
         
     | 
| 
       1048 
     | 
    
         
            -
            	os.write(File.open('data/generated/ 
     | 
| 
      
 1061 
     | 
    
         
            +
            	os.write(File.open('data/generated/5entry.zip', 'rb').read)
         
     | 
| 
       1049 
1062 
     | 
    
         
             
                  }
         
     | 
| 
       1050 
1063 
     | 
    
         
             
                }
         
     | 
| 
       1051 
1064 
     | 
    
         | 
| 
         @@ -1054,7 +1067,7 @@ class ZipFileTest < Test::Unit::TestCase 
     | 
|
| 
       1054 
1067 
     | 
    
         
             
                  assert_equal(entryCount+2, zf.size)
         
     | 
| 
       1055 
1068 
     | 
    
         
             
                  assert_equal("Putting stuff in newEntry.txt", zf.read("newEntry.txt")) 
         
     | 
| 
       1056 
1069 
     | 
    
         
             
                  assert_equal("Putting stuff in data/generated/empty.txt", zf.read("data/generated/empty.txt")) 
         
     | 
| 
       1057 
     | 
    
         
            -
                  assert_equal(File.open('data/generated/ 
     | 
| 
      
 1070 
     | 
    
         
            +
                  assert_equal(File.open('data/generated/5entry.zip', 'rb').read, zf.read("entry.bin")) 
         
     | 
| 
       1058 
1071 
     | 
    
         
             
                }
         
     | 
| 
       1059 
1072 
     | 
    
         
             
              end
         
     | 
| 
       1060 
1073 
     | 
    
         | 
| 
         @@ -1386,6 +1399,17 @@ class ZipFileExtractTest < Test::Unit::TestCase 
     | 
|
| 
       1386 
1399 
     | 
    
         
             
                  assert(File.exists?(EXTRACTED_FILENAME))
         
     | 
| 
       1387 
1400 
     | 
    
         
             
                  AssertEntry::assert_contents(EXTRACTED_FILENAME, 
         
     | 
| 
       1388 
1401 
     | 
    
         
             
            				  zf.get_input_stream(ENTRY_TO_EXTRACT) { |is| is.read })
         
     | 
| 
      
 1402 
     | 
    
         
            +
             
     | 
| 
      
 1403 
     | 
    
         
            +
             
     | 
| 
      
 1404 
     | 
    
         
            +
                  File::unlink(EXTRACTED_FILENAME)
         
     | 
| 
      
 1405 
     | 
    
         
            +
             
     | 
| 
      
 1406 
     | 
    
         
            +
                  entry = zf.get_entry(ENTRY_TO_EXTRACT)
         
     | 
| 
      
 1407 
     | 
    
         
            +
                  entry.extract(EXTRACTED_FILENAME)
         
     | 
| 
      
 1408 
     | 
    
         
            +
             
     | 
| 
      
 1409 
     | 
    
         
            +
                  assert(File.exists?(EXTRACTED_FILENAME))
         
     | 
| 
      
 1410 
     | 
    
         
            +
                  AssertEntry::assert_contents(EXTRACTED_FILENAME, 
         
     | 
| 
      
 1411 
     | 
    
         
            +
            				  entry.get_input_stream() { |is| is.read })
         
     | 
| 
      
 1412 
     | 
    
         
            +
             
     | 
| 
       1389 
1413 
     | 
    
         
             
                }
         
     | 
| 
       1390 
1414 
     | 
    
         
             
              end
         
     | 
| 
       1391 
1415 
     | 
    
         | 
| 
         @@ -1502,25 +1526,6 @@ class ZipFileExtractDirectoryTest < Test::Unit::TestCase 
     | 
|
| 
       1502 
1526 
     | 
    
         
             
              end
         
     | 
| 
       1503 
1527 
     | 
    
         
             
            end
         
     | 
| 
       1504 
1528 
     | 
    
         | 
| 
       1505 
     | 
    
         
            -
            class ZipStreamableFileTest < Test::Unit::TestCase
         
     | 
| 
       1506 
     | 
    
         
            -
              def test_equality
         
     | 
| 
       1507 
     | 
    
         
            -
                zipEntry1 = ZipEntry.new("zf.zip", "entryname1", "comment")
         
     | 
| 
       1508 
     | 
    
         
            -
                zipEntry2 = ZipEntry.new("zf.zip", "entryname2", "comment")
         
     | 
| 
       1509 
     | 
    
         
            -
             
     | 
| 
       1510 
     | 
    
         
            -
                zipStreamableFile1 = ZipStreamableFile.new(zipEntry1, "path")
         
     | 
| 
       1511 
     | 
    
         
            -
                zipStreamableFile2 = ZipStreamableFile.new(zipEntry1, "path")
         
     | 
| 
       1512 
     | 
    
         
            -
                zipStreamableFile3 = ZipStreamableFile.new(zipEntry1, "anotherPath")
         
     | 
| 
       1513 
     | 
    
         
            -
                zipStreamableFile4 = ZipStreamableFile.new(zipEntry2, "path")
         
     | 
| 
       1514 
     | 
    
         
            -
                
         
     | 
| 
       1515 
     | 
    
         
            -
                assert_equal(zipStreamableFile1, zipStreamableFile1)
         
     | 
| 
       1516 
     | 
    
         
            -
                assert_equal(zipStreamableFile1, zipStreamableFile2)
         
     | 
| 
       1517 
     | 
    
         
            -
                assert(zipStreamableFile1 != zipStreamableFile3)
         
     | 
| 
       1518 
     | 
    
         
            -
                assert(zipStreamableFile1 != zipStreamableFile4)
         
     | 
| 
       1519 
     | 
    
         
            -
                assert(zipStreamableFile1 != zipEntry1)
         
     | 
| 
       1520 
     | 
    
         
            -
                assert(zipStreamableFile1 != "hej")
         
     | 
| 
       1521 
     | 
    
         
            -
              end
         
     | 
| 
       1522 
     | 
    
         
            -
            end
         
     | 
| 
       1523 
     | 
    
         
            -
             
     | 
| 
       1524 
1529 
     | 
    
         
             
            class ZipExtraFieldTest < Test::Unit::TestCase
         
     | 
| 
       1525 
1530 
     | 
    
         
             
              def test_new
         
     | 
| 
       1526 
1531 
     | 
    
         
             
                extra_pure    = ZipExtraField.new("")
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,10 +1,10 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
     | 
    
         
            -
            rubygems_version: 0.8. 
     | 
| 
      
 2 
     | 
    
         
            +
            rubygems_version: 0.8.6
         
     | 
| 
       3 
3 
     | 
    
         
             
            specification_version: 1
         
     | 
| 
       4 
4 
     | 
    
         
             
            name: rubyzip
         
     | 
| 
       5 
5 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       6 
     | 
    
         
            -
              version: 0. 
     | 
| 
       7 
     | 
    
         
            -
            date:  
     | 
| 
      
 6 
     | 
    
         
            +
              version: 0.9.1
         
     | 
| 
      
 7 
     | 
    
         
            +
            date: 2006-07-29
         
     | 
| 
       8 
8 
     | 
    
         
             
            summary: rubyzip is a ruby module for reading and writing zip files
         
     | 
| 
       9 
9 
     | 
    
         
             
            require_paths: 
         
     | 
| 
       10 
10 
     | 
    
         
             
              - lib
         
     | 
| 
         @@ -12,7 +12,7 @@ email: thomas(at)sondergaard.cc 
     | 
|
| 
       12 
12 
     | 
    
         
             
            homepage: http://rubyzip.sourceforge.net/
         
     | 
| 
       13 
13 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       14 
14 
     | 
    
         
             
            description: 
         
     | 
| 
       15 
     | 
    
         
            -
            autorequire:  
     | 
| 
      
 15 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
       16 
16 
     | 
    
         
             
            default_executable: 
         
     | 
| 
       17 
17 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       18 
18 
     | 
    
         
             
            has_rdoc: false
         
     | 
| 
         @@ -24,8 +24,6 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement 
     | 
|
| 
       24 
24 
     | 
    
         
             
                    version: 0.0.0
         
     | 
| 
       25 
25 
     | 
    
         
             
              version: 
         
     | 
| 
       26 
26 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       27 
     | 
    
         
            -
            signing_key: 
         
     | 
| 
       28 
     | 
    
         
            -
            cert_chain: 
         
     | 
| 
       29 
27 
     | 
    
         
             
            authors: 
         
     | 
| 
       30 
28 
     | 
    
         
             
              - Thomas Sondergaard
         
     | 
| 
       31 
29 
     | 
    
         
             
            files: 
         
     | 
| 
         @@ -35,21 +33,19 @@ files: 
     | 
|
| 
       35 
33 
     | 
    
         
             
              - ChangeLog
         
     | 
| 
       36 
34 
     | 
    
         
             
              - install.rb
         
     | 
| 
       37 
35 
     | 
    
         
             
              - Rakefile
         
     | 
| 
       38 
     | 
    
         
            -
              - samples/zipdialogui.rb
         
     | 
| 
       39 
36 
     | 
    
         
             
              - samples/example.rb
         
     | 
| 
       40 
37 
     | 
    
         
             
              - samples/example_filesystem.rb
         
     | 
| 
       41 
38 
     | 
    
         
             
              - samples/gtkRubyzip.rb
         
     | 
| 
      
 39 
     | 
    
         
            +
              - samples/qtzip.rb
         
     | 
| 
       42 
40 
     | 
    
         
             
              - samples/write_simple.rb
         
     | 
| 
       43 
41 
     | 
    
         
             
              - samples/zipfind.rb
         
     | 
| 
       44 
     | 
    
         
            -
              -  
     | 
| 
      
 42 
     | 
    
         
            +
              - test/alltests.rb
         
     | 
| 
       45 
43 
     | 
    
         
             
              - test/gentestfiles.rb
         
     | 
| 
       46 
44 
     | 
    
         
             
              - test/ioextrastest.rb
         
     | 
| 
       47 
45 
     | 
    
         
             
              - test/stdrubyexttest.rb
         
     | 
| 
       48 
46 
     | 
    
         
             
              - test/zipfilesystemtest.rb
         
     | 
| 
       49 
47 
     | 
    
         
             
              - test/ziprequiretest.rb
         
     | 
| 
       50 
48 
     | 
    
         
             
              - test/ziptest.rb
         
     | 
| 
       51 
     | 
    
         
            -
              - test/zlibtest.rb
         
     | 
| 
       52 
     | 
    
         
            -
              - test/alltests.rb
         
     | 
| 
       53 
49 
     | 
    
         
             
              - test/data/file1.txt
         
     | 
| 
       54 
50 
     | 
    
         
             
              - test/data/file1.txt.deflatedData
         
     | 
| 
       55 
51 
     | 
    
         
             
              - test/data/file2.txt
         
     | 
| 
         @@ -58,13 +54,40 @@ files: 
     | 
|
| 
       58 
54 
     | 
    
         
             
              - test/data/rubycode2.zip
         
     | 
| 
       59 
55 
     | 
    
         
             
              - test/data/testDirectory.bin
         
     | 
| 
       60 
56 
     | 
    
         
             
              - test/data/zipWithDirs.zip
         
     | 
| 
       61 
     | 
    
         
            -
              -  
     | 
| 
      
 57 
     | 
    
         
            +
              - lib/download_quizzes.rb
         
     | 
| 
      
 58 
     | 
    
         
            +
              - lib/zip/ioextras.rb
         
     | 
| 
       62 
59 
     | 
    
         
             
              - lib/zip/stdrubyext.rb
         
     | 
| 
       63 
60 
     | 
    
         
             
              - lib/zip/tempfile_bugfixed.rb
         
     | 
| 
       64 
61 
     | 
    
         
             
              - lib/zip/zip.rb
         
     | 
| 
       65 
62 
     | 
    
         
             
              - lib/zip/zipfilesystem.rb
         
     | 
| 
       66 
63 
     | 
    
         
             
              - lib/zip/ziprequire.rb
         
     | 
| 
       67 
     | 
    
         
            -
              - lib/ 
     | 
| 
      
 64 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Bill Guindon/solitaire.rb
         
     | 
| 
      
 65 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Carlos/solitaire.rb
         
     | 
| 
      
 66 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Dennis Ranke/solitaire.rb
         
     | 
| 
      
 67 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Florian Gross/solitaire.rb
         
     | 
| 
      
 68 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Glen M. Lewis/solitaire.rb
         
     | 
| 
      
 69 
     | 
    
         
            +
              - lib/quiz1/t/solutions/James Edward Gray II/solitaire.rb
         
     | 
| 
      
 70 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Jamis Buck/bin/main.rb
         
     | 
| 
      
 71 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Jamis Buck/lib/cipher.rb
         
     | 
| 
      
 72 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Jamis Buck/lib/cli.rb
         
     | 
| 
      
 73 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Jamis Buck/test/tc_deck.rb
         
     | 
| 
      
 74 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Jamis Buck/test/tc_key-stream.rb
         
     | 
| 
      
 75 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Jamis Buck/test/tc_keying-algorithms.rb
         
     | 
| 
      
 76 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Jamis Buck/test/tc_solitaire-cipher.rb
         
     | 
| 
      
 77 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Jamis Buck/test/tc_unkeyed-algorithm.rb
         
     | 
| 
      
 78 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Jamis Buck/test/tests.rb
         
     | 
| 
      
 79 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Jim Menard/solitaire_cypher.rb
         
     | 
| 
      
 80 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Jim Menard/test.rb
         
     | 
| 
      
 81 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Moses Hohman/cipher.rb
         
     | 
| 
      
 82 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Moses Hohman/deck.rb
         
     | 
| 
      
 83 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Moses Hohman/solitaire.rb
         
     | 
| 
      
 84 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Moses Hohman/test_cipher.rb
         
     | 
| 
      
 85 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Moses Hohman/test_deck.rb
         
     | 
| 
      
 86 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Moses Hohman/test_util.rb
         
     | 
| 
      
 87 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Moses Hohman/testsuite.rb
         
     | 
| 
      
 88 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Moses Hohman/util.rb
         
     | 
| 
      
 89 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Niklas Frykholm/solitaire.rb
         
     | 
| 
      
 90 
     | 
    
         
            +
              - lib/quiz1/t/solutions/Thomas Leitner/solitaire.rb
         
     | 
| 
       68 
91 
     | 
    
         
             
            test_files: []
         
     | 
| 
       69 
92 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       70 
93 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
    
        data/samples/zipdialogui.rb
    DELETED
    
    | 
         @@ -1,80 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # Form implementation generated from reading ui file 'zipdialogui.ui'
         
     | 
| 
       2 
     | 
    
         
            -
            #
         
     | 
| 
       3 
     | 
    
         
            -
            # Created: Sun Apr 3 16:49:38 2005
         
     | 
| 
       4 
     | 
    
         
            -
            #      by: The QtRuby User Interface Compiler (rbuic)
         
     | 
| 
       5 
     | 
    
         
            -
            #
         
     | 
| 
       6 
     | 
    
         
            -
            # WARNING! All changes made in this file will be lost!
         
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
            require 'Qt'
         
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
            class ZipDialogUI < Qt::Dialog
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
                attr_reader :entry_list_view
         
     | 
| 
       14 
     | 
    
         
            -
                attr_reader :add_button
         
     | 
| 
       15 
     | 
    
         
            -
                attr_reader :extract_button
         
     | 
| 
       16 
     | 
    
         
            -
                attr_reader :close_button
         
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
                def initialize(*k)
         
     | 
| 
       20 
     | 
    
         
            -
                    super(*k)
         
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
                    if name.nil?
         
     | 
| 
       23 
     | 
    
         
            -
                    	setName("ZipDialogUI")
         
     | 
| 
       24 
     | 
    
         
            -
                    end
         
     | 
| 
       25 
     | 
    
         
            -
                    setSizeGripEnabled(true)
         
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
                    @ZipDialogUILayout = Qt::HBoxLayout.new(self, 11, 6, 'ZipDialogUILayout')
         
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
                    @entry_list_view = Qt::ListView.new(self, "entry_list_view")
         
     | 
| 
       30 
     | 
    
         
            -
                    @entry_list_view.addColumn(trUtf8("Entry"))
         
     | 
| 
       31 
     | 
    
         
            -
                    @entry_list_view.addColumn(trUtf8("Size"))
         
     | 
| 
       32 
     | 
    
         
            -
                    @entry_list_view.setMinimumSize( Qt::Size.new(150, 200) )
         
     | 
| 
       33 
     | 
    
         
            -
                    @entry_list_view.setResizePolicy( Qt::ScrollView::Manual )
         
     | 
| 
       34 
     | 
    
         
            -
                    @entry_list_view.setSelectionMode( Qt::ListView::Extended )
         
     | 
| 
       35 
     | 
    
         
            -
                    @entry_list_view.setResizeMode( Qt::ListView::AllColumns )
         
     | 
| 
       36 
     | 
    
         
            -
                    @ZipDialogUILayout.addWidget(@entry_list_view)
         
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
       38 
     | 
    
         
            -
                    @layout2 = Qt::VBoxLayout.new(nil, 0, 6, 'layout2')
         
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
       40 
     | 
    
         
            -
                    @add_button = Qt::PushButton.new(self, "add_button")
         
     | 
| 
       41 
     | 
    
         
            -
                    @add_button.setAutoDefault( true )
         
     | 
| 
       42 
     | 
    
         
            -
                    @layout2.addWidget(@add_button)
         
     | 
| 
       43 
     | 
    
         
            -
             
     | 
| 
       44 
     | 
    
         
            -
                    @extract_button = Qt::PushButton.new(self, "extract_button")
         
     | 
| 
       45 
     | 
    
         
            -
                    @extract_button.setAutoDefault( true )
         
     | 
| 
       46 
     | 
    
         
            -
                    @layout2.addWidget(@extract_button)
         
     | 
| 
       47 
     | 
    
         
            -
                    @Spacer1 = Qt::SpacerItem.new(20, 160, Qt::SizePolicy::Minimum, Qt::SizePolicy::Expanding)
         
     | 
| 
       48 
     | 
    
         
            -
                    @layout2.addItem(@Spacer1)
         
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
       50 
     | 
    
         
            -
                    @close_button = Qt::PushButton.new(self, "close_button")
         
     | 
| 
       51 
     | 
    
         
            -
                    @close_button.setAutoDefault( true )
         
     | 
| 
       52 
     | 
    
         
            -
                    @close_button.setDefault( true )
         
     | 
| 
       53 
     | 
    
         
            -
                    @layout2.addWidget(@close_button)
         
     | 
| 
       54 
     | 
    
         
            -
                    @ZipDialogUILayout.addLayout(@layout2)
         
     | 
| 
       55 
     | 
    
         
            -
                    languageChange()
         
     | 
| 
       56 
     | 
    
         
            -
                    resize( Qt::Size.new(416, 397).expandedTo(minimumSizeHint()) )
         
     | 
| 
       57 
     | 
    
         
            -
                    clearWState( WState_Polished )
         
     | 
| 
       58 
     | 
    
         
            -
             
     | 
| 
       59 
     | 
    
         
            -
                    Qt::Object.connect(@close_button, SIGNAL("clicked()"), self, SLOT("accept()") )
         
     | 
| 
       60 
     | 
    
         
            -
                end
         
     | 
| 
       61 
     | 
    
         
            -
             
     | 
| 
       62 
     | 
    
         
            -
                #
         
     | 
| 
       63 
     | 
    
         
            -
                #  Sets the strings of the subwidgets using the current
         
     | 
| 
       64 
     | 
    
         
            -
                #  language.
         
     | 
| 
       65 
     | 
    
         
            -
                #
         
     | 
| 
       66 
     | 
    
         
            -
                def languageChange()
         
     | 
| 
       67 
     | 
    
         
            -
                    setCaption(trUtf8("Rubyzip"))
         
     | 
| 
       68 
     | 
    
         
            -
                    @entry_list_view.header().setLabel( 0, trUtf8("Entry") )
         
     | 
| 
       69 
     | 
    
         
            -
                    @entry_list_view.header().setLabel( 1, trUtf8("Size") )
         
     | 
| 
       70 
     | 
    
         
            -
                    @add_button.setText( trUtf8("&Add...") )
         
     | 
| 
       71 
     | 
    
         
            -
                    @add_button.setAccel( Qt::KeySequence.new(trUtf8("Alt+A")) )
         
     | 
| 
       72 
     | 
    
         
            -
                    @extract_button.setText( trUtf8("&Extract...") )
         
     | 
| 
       73 
     | 
    
         
            -
                    @extract_button.setAccel( Qt::KeySequence.new(trUtf8("Alt+E")) )
         
     | 
| 
       74 
     | 
    
         
            -
                    @close_button.setText( trUtf8("&Close") )
         
     | 
| 
       75 
     | 
    
         
            -
                    @close_button.setAccel( Qt::KeySequence.new(trUtf8("Alt+C")) )
         
     | 
| 
       76 
     | 
    
         
            -
                end
         
     | 
| 
       77 
     | 
    
         
            -
                protected :languageChange
         
     | 
| 
       78 
     | 
    
         
            -
             
     | 
| 
       79 
     | 
    
         
            -
             
     | 
| 
       80 
     | 
    
         
            -
            end
         
     | 
    
        data/test/data/file2.txt.other
    DELETED
    
    | 
         
            File without changes
         
     | 
    
        data/test/zlibtest.rb
    DELETED
    
    | 
         @@ -1,26 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            #!/usr/bin/env ruby
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
            $VERBOSE = true
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
            $: << "../lib"
         
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
            require 'test/unit'
         
     | 
| 
       8 
     | 
    
         
            -
            require 'zlib'
         
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
            include Zlib
         
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
            class ZLibTest < Test::Unit::TestCase
         
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
              def test_BufError
         
     | 
| 
       15 
     | 
    
         
            -
                inflater = Zlib::Inflate.new(-Zlib::MAX_WBITS)
         
     | 
| 
       16 
     | 
    
         
            -
                s = ""
         
     | 
| 
       17 
     | 
    
         
            -
                File.open("data/file1.txt.deflatedData") {
         
     | 
| 
       18 
     | 
    
         
            -
                  |is|
         
     | 
| 
       19 
     | 
    
         
            -
                  while (!inflater.finished?)
         
     | 
| 
       20 
     | 
    
         
            -
                    s += inflater.inflate(is.read(1))
         
     | 
| 
       21 
     | 
    
         
            -
                  end
         
     | 
| 
       22 
     | 
    
         
            -
                }
         
     | 
| 
       23 
     | 
    
         
            -
                puts s
         
     | 
| 
       24 
     | 
    
         
            -
                assert_equal(File.read("data/file1.txt"), s)
         
     | 
| 
       25 
     | 
    
         
            -
              end
         
     | 
| 
       26 
     | 
    
         
            -
            end
         
     |