rubyzip 0.9.1 → 2.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +354 -0
- data/Rakefile +15 -104
- data/TODO +0 -1
- data/lib/zip/central_directory.rb +212 -0
- data/lib/zip/compressor.rb +9 -0
- data/lib/zip/constants.rb +115 -0
- data/lib/zip/crypto/decrypted_io.rb +40 -0
- data/lib/zip/crypto/encryption.rb +11 -0
- data/lib/zip/crypto/null_encryption.rb +43 -0
- data/lib/zip/crypto/traditional_encryption.rb +99 -0
- data/lib/zip/decompressor.rb +31 -0
- data/lib/zip/deflater.rb +34 -0
- data/lib/zip/dos_time.rb +53 -0
- data/lib/zip/entry.rb +719 -0
- data/lib/zip/entry_set.rb +88 -0
- data/lib/zip/errors.rb +19 -0
- data/lib/zip/extra_field/generic.rb +44 -0
- data/lib/zip/extra_field/ntfs.rb +94 -0
- data/lib/zip/extra_field/old_unix.rb +46 -0
- data/lib/zip/extra_field/universal_time.rb +77 -0
- data/lib/zip/extra_field/unix.rb +39 -0
- data/lib/zip/extra_field/zip64.rb +70 -0
- data/lib/zip/extra_field/zip64_placeholder.rb +15 -0
- data/lib/zip/extra_field.rb +103 -0
- data/lib/zip/file.rb +468 -0
- data/lib/zip/filesystem.rb +643 -0
- data/lib/zip/inflater.rb +54 -0
- data/lib/zip/input_stream.rb +180 -0
- data/lib/zip/ioextras/abstract_input_stream.rb +122 -0
- data/lib/zip/ioextras/abstract_output_stream.rb +43 -0
- data/lib/zip/ioextras.rb +21 -140
- data/lib/zip/null_compressor.rb +15 -0
- data/lib/zip/null_decompressor.rb +19 -0
- data/lib/zip/null_input_stream.rb +10 -0
- data/lib/zip/output_stream.rb +198 -0
- data/lib/zip/pass_thru_compressor.rb +23 -0
- data/lib/zip/pass_thru_decompressor.rb +31 -0
- data/lib/zip/streamable_directory.rb +15 -0
- data/lib/zip/streamable_stream.rb +52 -0
- data/lib/zip/version.rb +3 -0
- data/lib/zip.rb +72 -0
- data/samples/example.rb +44 -32
- data/samples/example_filesystem.rb +16 -19
- data/samples/example_recursive.rb +54 -0
- data/samples/gtk_ruby_zip.rb +84 -0
- data/samples/qtzip.rb +25 -34
- data/samples/write_simple.rb +10 -13
- data/samples/zipfind.rb +38 -45
- metadata +182 -91
- data/ChangeLog +0 -1504
- data/NEWS +0 -144
- data/README +0 -72
- data/install.rb +0 -22
- data/lib/download_quizzes.rb +0 -119
- data/lib/quiz1/t/solutions/Bill Guindon/solitaire.rb +0 -205
- data/lib/quiz1/t/solutions/Carlos/solitaire.rb +0 -111
- data/lib/quiz1/t/solutions/Dennis Ranke/solitaire.rb +0 -111
- data/lib/quiz1/t/solutions/Florian Gross/solitaire.rb +0 -301
- data/lib/quiz1/t/solutions/Glen M. Lewis/solitaire.rb +0 -268
- data/lib/quiz1/t/solutions/James Edward Gray II/solitaire.rb +0 -132
- data/lib/quiz1/t/solutions/Jamis Buck/bin/main.rb +0 -13
- data/lib/quiz1/t/solutions/Jamis Buck/lib/cipher.rb +0 -230
- data/lib/quiz1/t/solutions/Jamis Buck/lib/cli.rb +0 -24
- data/lib/quiz1/t/solutions/Jamis Buck/test/tc_deck.rb +0 -30
- data/lib/quiz1/t/solutions/Jamis Buck/test/tc_key-stream.rb +0 -19
- data/lib/quiz1/t/solutions/Jamis Buck/test/tc_keying-algorithms.rb +0 -31
- data/lib/quiz1/t/solutions/Jamis Buck/test/tc_solitaire-cipher.rb +0 -66
- data/lib/quiz1/t/solutions/Jamis Buck/test/tc_unkeyed-algorithm.rb +0 -17
- data/lib/quiz1/t/solutions/Jamis Buck/test/tests.rb +0 -2
- data/lib/quiz1/t/solutions/Jim Menard/solitaire_cypher.rb +0 -204
- data/lib/quiz1/t/solutions/Jim Menard/test.rb +0 -47
- data/lib/quiz1/t/solutions/Moses Hohman/cipher.rb +0 -97
- data/lib/quiz1/t/solutions/Moses Hohman/deck.rb +0 -140
- data/lib/quiz1/t/solutions/Moses Hohman/solitaire.rb +0 -14
- data/lib/quiz1/t/solutions/Moses Hohman/test_cipher.rb +0 -68
- data/lib/quiz1/t/solutions/Moses Hohman/test_deck.rb +0 -146
- data/lib/quiz1/t/solutions/Moses Hohman/test_util.rb +0 -38
- data/lib/quiz1/t/solutions/Moses Hohman/testsuite.rb +0 -5
- data/lib/quiz1/t/solutions/Moses Hohman/util.rb +0 -27
- data/lib/quiz1/t/solutions/Niklas Frykholm/solitaire.rb +0 -151
- data/lib/quiz1/t/solutions/Thomas Leitner/solitaire.rb +0 -198
- data/lib/zip/stdrubyext.rb +0 -111
- data/lib/zip/tempfile_bugfixed.rb +0 -195
- data/lib/zip/zip.rb +0 -1847
- data/lib/zip/zipfilesystem.rb +0 -609
- data/lib/zip/ziprequire.rb +0 -90
- data/samples/gtkRubyzip.rb +0 -86
- data/test/alltests.rb +0 -9
- data/test/data/file1.txt +0 -46
- data/test/data/file1.txt.deflatedData +0 -0
- data/test/data/file2.txt +0 -1504
- data/test/data/notzippedruby.rb +0 -7
- data/test/data/rubycode.zip +0 -0
- data/test/data/rubycode2.zip +0 -0
- data/test/data/testDirectory.bin +0 -0
- data/test/data/zipWithDirs.zip +0 -0
- data/test/gentestfiles.rb +0 -157
- data/test/ioextrastest.rb +0 -208
- data/test/stdrubyexttest.rb +0 -52
- data/test/zipfilesystemtest.rb +0 -831
- data/test/ziprequiretest.rb +0 -43
- data/test/ziptest.rb +0 -1599
data/samples/gtkRubyzip.rb
DELETED
@@ -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
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
|