rubyzip 0.9.1 → 2.3.2

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.
Files changed (103) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +354 -0
  3. data/Rakefile +15 -104
  4. data/TODO +0 -1
  5. data/lib/zip/central_directory.rb +212 -0
  6. data/lib/zip/compressor.rb +9 -0
  7. data/lib/zip/constants.rb +115 -0
  8. data/lib/zip/crypto/decrypted_io.rb +40 -0
  9. data/lib/zip/crypto/encryption.rb +11 -0
  10. data/lib/zip/crypto/null_encryption.rb +43 -0
  11. data/lib/zip/crypto/traditional_encryption.rb +99 -0
  12. data/lib/zip/decompressor.rb +31 -0
  13. data/lib/zip/deflater.rb +34 -0
  14. data/lib/zip/dos_time.rb +53 -0
  15. data/lib/zip/entry.rb +719 -0
  16. data/lib/zip/entry_set.rb +88 -0
  17. data/lib/zip/errors.rb +19 -0
  18. data/lib/zip/extra_field/generic.rb +44 -0
  19. data/lib/zip/extra_field/ntfs.rb +94 -0
  20. data/lib/zip/extra_field/old_unix.rb +46 -0
  21. data/lib/zip/extra_field/universal_time.rb +77 -0
  22. data/lib/zip/extra_field/unix.rb +39 -0
  23. data/lib/zip/extra_field/zip64.rb +70 -0
  24. data/lib/zip/extra_field/zip64_placeholder.rb +15 -0
  25. data/lib/zip/extra_field.rb +103 -0
  26. data/lib/zip/file.rb +468 -0
  27. data/lib/zip/filesystem.rb +643 -0
  28. data/lib/zip/inflater.rb +54 -0
  29. data/lib/zip/input_stream.rb +180 -0
  30. data/lib/zip/ioextras/abstract_input_stream.rb +122 -0
  31. data/lib/zip/ioextras/abstract_output_stream.rb +43 -0
  32. data/lib/zip/ioextras.rb +21 -140
  33. data/lib/zip/null_compressor.rb +15 -0
  34. data/lib/zip/null_decompressor.rb +19 -0
  35. data/lib/zip/null_input_stream.rb +10 -0
  36. data/lib/zip/output_stream.rb +198 -0
  37. data/lib/zip/pass_thru_compressor.rb +23 -0
  38. data/lib/zip/pass_thru_decompressor.rb +31 -0
  39. data/lib/zip/streamable_directory.rb +15 -0
  40. data/lib/zip/streamable_stream.rb +52 -0
  41. data/lib/zip/version.rb +3 -0
  42. data/lib/zip.rb +72 -0
  43. data/samples/example.rb +44 -32
  44. data/samples/example_filesystem.rb +16 -19
  45. data/samples/example_recursive.rb +54 -0
  46. data/samples/gtk_ruby_zip.rb +84 -0
  47. data/samples/qtzip.rb +25 -34
  48. data/samples/write_simple.rb +10 -13
  49. data/samples/zipfind.rb +38 -45
  50. metadata +182 -91
  51. data/ChangeLog +0 -1504
  52. data/NEWS +0 -144
  53. data/README +0 -72
  54. data/install.rb +0 -22
  55. data/lib/download_quizzes.rb +0 -119
  56. data/lib/quiz1/t/solutions/Bill Guindon/solitaire.rb +0 -205
  57. data/lib/quiz1/t/solutions/Carlos/solitaire.rb +0 -111
  58. data/lib/quiz1/t/solutions/Dennis Ranke/solitaire.rb +0 -111
  59. data/lib/quiz1/t/solutions/Florian Gross/solitaire.rb +0 -301
  60. data/lib/quiz1/t/solutions/Glen M. Lewis/solitaire.rb +0 -268
  61. data/lib/quiz1/t/solutions/James Edward Gray II/solitaire.rb +0 -132
  62. data/lib/quiz1/t/solutions/Jamis Buck/bin/main.rb +0 -13
  63. data/lib/quiz1/t/solutions/Jamis Buck/lib/cipher.rb +0 -230
  64. data/lib/quiz1/t/solutions/Jamis Buck/lib/cli.rb +0 -24
  65. data/lib/quiz1/t/solutions/Jamis Buck/test/tc_deck.rb +0 -30
  66. data/lib/quiz1/t/solutions/Jamis Buck/test/tc_key-stream.rb +0 -19
  67. data/lib/quiz1/t/solutions/Jamis Buck/test/tc_keying-algorithms.rb +0 -31
  68. data/lib/quiz1/t/solutions/Jamis Buck/test/tc_solitaire-cipher.rb +0 -66
  69. data/lib/quiz1/t/solutions/Jamis Buck/test/tc_unkeyed-algorithm.rb +0 -17
  70. data/lib/quiz1/t/solutions/Jamis Buck/test/tests.rb +0 -2
  71. data/lib/quiz1/t/solutions/Jim Menard/solitaire_cypher.rb +0 -204
  72. data/lib/quiz1/t/solutions/Jim Menard/test.rb +0 -47
  73. data/lib/quiz1/t/solutions/Moses Hohman/cipher.rb +0 -97
  74. data/lib/quiz1/t/solutions/Moses Hohman/deck.rb +0 -140
  75. data/lib/quiz1/t/solutions/Moses Hohman/solitaire.rb +0 -14
  76. data/lib/quiz1/t/solutions/Moses Hohman/test_cipher.rb +0 -68
  77. data/lib/quiz1/t/solutions/Moses Hohman/test_deck.rb +0 -146
  78. data/lib/quiz1/t/solutions/Moses Hohman/test_util.rb +0 -38
  79. data/lib/quiz1/t/solutions/Moses Hohman/testsuite.rb +0 -5
  80. data/lib/quiz1/t/solutions/Moses Hohman/util.rb +0 -27
  81. data/lib/quiz1/t/solutions/Niklas Frykholm/solitaire.rb +0 -151
  82. data/lib/quiz1/t/solutions/Thomas Leitner/solitaire.rb +0 -198
  83. data/lib/zip/stdrubyext.rb +0 -111
  84. data/lib/zip/tempfile_bugfixed.rb +0 -195
  85. data/lib/zip/zip.rb +0 -1847
  86. data/lib/zip/zipfilesystem.rb +0 -609
  87. data/lib/zip/ziprequire.rb +0 -90
  88. data/samples/gtkRubyzip.rb +0 -86
  89. data/test/alltests.rb +0 -9
  90. data/test/data/file1.txt +0 -46
  91. data/test/data/file1.txt.deflatedData +0 -0
  92. data/test/data/file2.txt +0 -1504
  93. data/test/data/notzippedruby.rb +0 -7
  94. data/test/data/rubycode.zip +0 -0
  95. data/test/data/rubycode2.zip +0 -0
  96. data/test/data/testDirectory.bin +0 -0
  97. data/test/data/zipWithDirs.zip +0 -0
  98. data/test/gentestfiles.rb +0 -157
  99. data/test/ioextrastest.rb +0 -208
  100. data/test/stdrubyexttest.rb +0 -52
  101. data/test/zipfilesystemtest.rb +0 -831
  102. data/test/ziprequiretest.rb +0 -43
  103. data/test/ziptest.rb +0 -1599
@@ -1,86 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $: << "../lib"
4
-
5
- $VERBOSE = true
6
-
7
- require 'gtk'
8
- require 'zip/zip'
9
-
10
- class MainApp < Gtk::Window
11
- def initialize
12
- super()
13
- set_usize(400, 256)
14
- set_title("rubyzip")
15
- signal_connect(Gtk::Window::SIGNAL_DESTROY) { Gtk.main_quit }
16
-
17
- box = Gtk::VBox.new(false, 0)
18
- add(box)
19
-
20
- @zipfile = nil
21
- @buttonPanel = ButtonPanel.new
22
- @buttonPanel.openButton.signal_connect(Gtk::Button::SIGNAL_CLICKED) {
23
- show_file_selector
24
- }
25
- @buttonPanel.extractButton.signal_connect(Gtk::Button::SIGNAL_CLICKED) {
26
- puts "Not implemented!"
27
- }
28
- box.pack_start(@buttonPanel, false, false, 0)
29
-
30
- sw = Gtk::ScrolledWindow.new
31
- sw.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC)
32
- box.pack_start(sw, true, true, 0)
33
-
34
- @clist = Gtk::CList.new(["Name", "Size", "Compression"])
35
- @clist.set_selection_mode(Gtk::SELECTION_BROWSE)
36
- @clist.set_column_width(0, 120)
37
- @clist.set_column_width(1, 120)
38
- @clist.signal_connect(Gtk::CList::SIGNAL_SELECT_ROW) {
39
- |w, row, column, event|
40
- @selected_row = row
41
- }
42
- sw.add(@clist)
43
- end
44
-
45
- class ButtonPanel < Gtk::HButtonBox
46
- attr_reader :openButton, :extractButton
47
- def initialize
48
- super
49
- set_layout(Gtk::BUTTONBOX_START)
50
- set_spacing(0)
51
- @openButton = Gtk::Button.new("Open archive")
52
- @extractButton = Gtk::Button.new("Extract entry")
53
- pack_start(@openButton)
54
- pack_start(@extractButton)
55
- end
56
- end
57
-
58
- def show_file_selector
59
- @fileSelector = Gtk::FileSelection.new("Open zip file")
60
- @fileSelector.show
61
- @fileSelector.ok_button.signal_connect(Gtk::Button::SIGNAL_CLICKED) {
62
- open_zip(@fileSelector.filename)
63
- @fileSelector.destroy
64
- }
65
- @fileSelector.cancel_button.signal_connect(Gtk::Button::SIGNAL_CLICKED) {
66
- @fileSelector.destroy
67
- }
68
- end
69
-
70
- def open_zip(filename)
71
- @zipfile = Zip::ZipFile.open(filename)
72
- @clist.clear
73
- @zipfile.each {
74
- |entry|
75
- @clist.append([ entry.name,
76
- entry.size.to_s,
77
- (100.0*entry.compressedSize/entry.size).to_s+"%" ])
78
- }
79
- end
80
- end
81
-
82
- mainApp = MainApp.new()
83
-
84
- mainApp.show_all
85
-
86
- Gtk.main
data/test/alltests.rb DELETED
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $VERBOSE = true
4
-
5
- require 'stdrubyexttest'
6
- require 'ioextrastest'
7
- require 'ziptest'
8
- require 'zipfilesystemtest'
9
- require 'ziprequiretest'
data/test/data/file1.txt DELETED
@@ -1,46 +0,0 @@
1
-
2
- AUTOMAKE_OPTIONS = gnu
3
-
4
- EXTRA_DIST = test.zip
5
-
6
- CXXFLAGS= -g
7
-
8
- noinst_LIBRARIES = libzipios.a
9
-
10
- bin_PROGRAMS = test_zip test_izipfilt test_izipstream
11
- # test_flist
12
-
13
- libzipios_a_SOURCES = backbuffer.h fcol.cpp fcol.h \
14
- fcol_common.h fcolexceptions.cpp fcolexceptions.h \
15
- fileentry.cpp fileentry.h flist.cpp \
16
- flist.h flistentry.cpp flistentry.h \
17
- flistscanner.h ifiltstreambuf.cpp ifiltstreambuf.h \
18
- inflatefilt.cpp inflatefilt.h izipfilt.cpp \
19
- izipfilt.h izipstream.cpp izipstream.h \
20
- zipfile.cpp zipfile.h ziphead.cpp \
21
- ziphead.h flistscanner.ll
22
-
23
- # test_flist_SOURCES = test_flist.cpp
24
-
25
- test_izipfilt_SOURCES = test_izipfilt.cpp
26
-
27
- test_izipstream_SOURCES = test_izipstream.cpp
28
-
29
- test_zip_SOURCES = test_zip.cpp
30
-
31
- # Notice that libzipios.a is not specified as -L. -lzipios
32
- # If it was, automake would not include it as a dependency.
33
-
34
- # test_flist_LDADD = libzipios.a
35
-
36
- test_izipfilt_LDADD = libzipios.a -lz
37
-
38
- test_zip_LDADD = libzipios.a -lz
39
-
40
- test_izipstream_LDADD = libzipios.a -lz
41
-
42
-
43
-
44
- flistscanner.cc : flistscanner.ll
45
- $(LEX) -+ -PFListScanner -o$@ $^
46
-
Binary file