erawk-rubyzip 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.
data/NEWS ADDED
@@ -0,0 +1,144 @@
1
+ = Version 0.9.1
2
+
3
+ Added symlink support and support for unix file permissions. Reduced
4
+ memory usage during decompression.
5
+
6
+ New methods ZipFile::[follow_symlinks, restore_times, restore_permissions, restore_ownership].
7
+ New methods ZipEntry::unix_perms, ZipInputStream::eof?.
8
+ Added documentation and test for new ZipFile::extract.
9
+ Added some of the API suggestions from sf.net #1281314.
10
+ Applied patch for sf.net bug #1446926.
11
+ Applied patch for sf.net bug #1459902.
12
+ Rework ZipEntry and delegate classes.
13
+
14
+ = Version 0.5.12
15
+
16
+ Fixed problem with writing binary content to a ZipFile in MS Windows.
17
+
18
+ = Version 0.5.11
19
+
20
+ Fixed name clash file method copy_stream from fileutils.rb. Fixed
21
+ problem with references to constant CHUNK_SIZE.
22
+ ZipInputStream/AbstractInputStream read is now buffered like ruby IO's
23
+ read method, which means that read and gets etc can be mixed. The
24
+ unbuffered read method has been renamed to sysread.
25
+
26
+ = Version 0.5.10
27
+
28
+ Fixed method name resolution problem with FileUtils::copy_stream and
29
+ IOExtras::copy_stream.
30
+
31
+ = Version 0.5.9
32
+
33
+ Fixed serious memory consumption issue
34
+
35
+ = Version 0.5.8
36
+
37
+ Fixed install script.
38
+
39
+ = Version 0.5.7
40
+
41
+ install.rb no longer assumes it is being run from the toplevel source
42
+ dir. Directory structure changed to reflect common ruby library
43
+ project structure. Migrated from RubyUnit to Test::Unit format. Now
44
+ uses Rake to build source packages and gems and run unit tests.
45
+
46
+ = Version 0.5.6
47
+
48
+ Fix for FreeBSD 4.9 which returns Errno::EFBIG instead of
49
+ Errno::EINVAL for some invalid seeks. Fixed 'version needed to
50
+ extract'-field incorrect in local headers.
51
+
52
+ = Version 0.5.5
53
+
54
+ Fix for a problem with writing zip files that concerns only ruby 1.8.1.
55
+
56
+ = Version 0.5.4
57
+
58
+ Significantly reduced memory footprint when modifying zip files.
59
+
60
+ = Version 0.5.3
61
+
62
+ Added optimization to avoid decompressing and recompressing individual
63
+ entries when modifying a zip archive.
64
+
65
+ = Version 0.5.2
66
+
67
+ Fixed ZipFile corruption bug in ZipFile class. Added basic unix
68
+ extra-field support.
69
+
70
+ = Version 0.5.1
71
+
72
+ Fixed ZipFile.get_output_stream bug.
73
+
74
+ = Version 0.5.0
75
+
76
+ List of changes:
77
+ * Ruby 1.8.0 and ruby-zlib 0.6.0 compatibility
78
+ * Changed method names from camelCase to rubys underscore style.
79
+ * Installs to zip/ subdir instead of directly to site_ruby
80
+ * Added ZipFile.directory and ZipFile.file - each method return an
81
+ object that can be used like Dir and File only for the contents of the
82
+ zip file.
83
+ * Added sample application zipfind which works like Find.find, only
84
+ Zip::ZipFind.find traverses into zip archives too.
85
+
86
+ Bug fixes:
87
+ * AbstractInputStream.each_line with non-default separator
88
+
89
+
90
+ = Version 0.5.0a
91
+
92
+ Source reorganized. Added ziprequire, which can be used to load ruby
93
+ modules from a zip file, in a fashion similar to jar files in
94
+ Java. Added gtkRubyzip, another sample application. Implemented
95
+ ZipInputStream.lineno and ZipInputStream.rewind
96
+
97
+ Bug fixes:
98
+
99
+ * Read and write date and time information correctly for zip entries.
100
+ * Fixed read() using separate buffer, causing mix of gets/readline/read to
101
+ cause problems.
102
+
103
+ = Version 0.4.2
104
+
105
+ Performance optimizations. Test suite runs in half the time.
106
+
107
+ = Version 0.4.1
108
+
109
+ Windows compatibility fixes.
110
+
111
+ = Version 0.4.0
112
+
113
+ Zip::ZipFile is now mutable and provides a more convenient way of
114
+ modifying zip archives than Zip::ZipOutputStream. Operations for
115
+ adding, extracting, renaming, replacing and removing entries to zip
116
+ archives are now available.
117
+
118
+ Runs without warnings with -w switch.
119
+
120
+ Install script install.rb added.
121
+
122
+
123
+ = Version 0.3.1
124
+
125
+ Rudimentary support for writing zip archives.
126
+
127
+
128
+ = Version 0.2.2
129
+
130
+ Fixed and extended unit test suite. Updated to work with ruby/zlib
131
+ 0.5. It doesn't work with earlier versions of ruby/zlib.
132
+
133
+
134
+ = Version 0.2.0
135
+
136
+ Class ZipFile added. Where ZipInputStream is used to read the
137
+ individual entries in a zip file, ZipFile reads the central directory
138
+ in the zip archive, so you can get to any entry in the zip archive
139
+ without having to skipping through all the preceeding entries.
140
+
141
+
142
+ = Version 0.1.0
143
+
144
+ First working version of ZipInputStream.
data/README ADDED
@@ -0,0 +1,72 @@
1
+ = rubyzip
2
+
3
+ rubyzip is a ruby library for reading and writing zip files.
4
+
5
+ = Install
6
+
7
+ If you have rubygems you can install rubyzip directly from the gem
8
+ repository
9
+
10
+ gem install rubyzip
11
+
12
+ Otherwise obtain the source (see below) and run
13
+
14
+ ruby install.rb
15
+
16
+ To run the unit tests you need to have test::unit installed
17
+
18
+ rake test
19
+
20
+
21
+ = Documentation
22
+
23
+ There is more than one way to access or create a zip archive with
24
+ rubyzip. The basic API is modeled after the classes in
25
+ java.util.zip from the Java SDK. This means there are classes such
26
+ as Zip::ZipInputStream, Zip::ZipOutputStream and
27
+ Zip::ZipFile. Zip::ZipInputStream provides a basic interface for
28
+ iterating through the entries in a zip archive and reading from the
29
+ entries in the same way as from a regular File or IO
30
+ object. ZipOutputStream is the corresponding basic output
31
+ facility. Zip::ZipFile provides a mean for accessing the archives
32
+ central directory and provides means for accessing any entry without
33
+ having to iterate through the archive. Unlike Java's
34
+ java.util.zip.ZipFile rubyzip's Zip::ZipFile is mutable, which means
35
+ it can be used to change zip files as well.
36
+
37
+ Another way to access a zip archive with rubyzip is to use rubyzip's
38
+ Zip::ZipFileSystem API. Using this API files can be read from and
39
+ written to the archive in much the same manner as ruby's builtin
40
+ classes allows files to be read from and written to the file system.
41
+
42
+ rubyzip also features the
43
+ zip/ziprequire.rb[link:files/lib/zip/ziprequire_rb.html] module which
44
+ allows ruby to load ruby modules from zip archives.
45
+
46
+ For details about the specific behaviour of classes and methods refer
47
+ to the test suite. Finally you can generate the rdoc documentation or
48
+ visit http://rubyzip.sourceforge.net.
49
+
50
+ = License
51
+
52
+ rubyzip is distributed under the same license as ruby. See
53
+ http://www.ruby-lang.org/en/LICENSE.txt
54
+
55
+
56
+ = Website and Project Home
57
+
58
+ http://rubyzip.sourceforge.net
59
+
60
+ http://sourceforge.net/projects/rubyzip
61
+
62
+ == Download (tarballs and gems)
63
+
64
+ http://sourceforge.net/project/showfiles.php?group_id=43107&package_id=35377
65
+
66
+ = Authors
67
+
68
+ Thomas Sondergaard (thomas at sondergaard.cc)
69
+
70
+ Technorama Ltd. (oss-ruby-zip at technorama.net)
71
+
72
+ extra-field support contributed by Tatsuki Sugiura (sugi at nemui.org)
data/README.rdoc ADDED
@@ -0,0 +1,72 @@
1
+ = rubyzip
2
+
3
+ rubyzip is a ruby library for reading and writing zip files.
4
+
5
+ = Install
6
+
7
+ If you have rubygems you can install rubyzip directly from the gem
8
+ repository
9
+
10
+ gem install rubyzip
11
+
12
+ Otherwise obtain the source (see below) and run
13
+
14
+ ruby install.rb
15
+
16
+ To run the unit tests you need to have test::unit installed
17
+
18
+ rake test
19
+
20
+
21
+ = Documentation
22
+
23
+ There is more than one way to access or create a zip archive with
24
+ rubyzip. The basic API is modeled after the classes in
25
+ java.util.zip from the Java SDK. This means there are classes such
26
+ as Zip::ZipInputStream, Zip::ZipOutputStream and
27
+ Zip::ZipFile. Zip::ZipInputStream provides a basic interface for
28
+ iterating through the entries in a zip archive and reading from the
29
+ entries in the same way as from a regular File or IO
30
+ object. ZipOutputStream is the corresponding basic output
31
+ facility. Zip::ZipFile provides a mean for accessing the archives
32
+ central directory and provides means for accessing any entry without
33
+ having to iterate through the archive. Unlike Java's
34
+ java.util.zip.ZipFile rubyzip's Zip::ZipFile is mutable, which means
35
+ it can be used to change zip files as well.
36
+
37
+ Another way to access a zip archive with rubyzip is to use rubyzip's
38
+ Zip::ZipFileSystem API. Using this API files can be read from and
39
+ written to the archive in much the same manner as ruby's builtin
40
+ classes allows files to be read from and written to the file system.
41
+
42
+ rubyzip also features the
43
+ zip/ziprequire.rb[link:files/lib/zip/ziprequire_rb.html] module which
44
+ allows ruby to load ruby modules from zip archives.
45
+
46
+ For details about the specific behaviour of classes and methods refer
47
+ to the test suite. Finally you can generate the rdoc documentation or
48
+ visit http://rubyzip.sourceforge.net.
49
+
50
+ = License
51
+
52
+ rubyzip is distributed under the same license as ruby. See
53
+ http://www.ruby-lang.org/en/LICENSE.txt
54
+
55
+
56
+ = Website and Project Home
57
+
58
+ http://rubyzip.sourceforge.net
59
+
60
+ http://sourceforge.net/projects/rubyzip
61
+
62
+ == Download (tarballs and gems)
63
+
64
+ http://sourceforge.net/project/showfiles.php?group_id=43107&package_id=35377
65
+
66
+ = Authors
67
+
68
+ Thomas Sondergaard (thomas at sondergaard.cc)
69
+
70
+ Technorama Ltd. (oss-ruby-zip at technorama.net)
71
+
72
+ extra-field support contributed by Tatsuki Sugiura (sugi at nemui.org)
data/Rakefile ADDED
@@ -0,0 +1,121 @@
1
+ # Rakefile for RubyGems -*- ruby -*-
2
+
3
+ require 'rubygems'
4
+ require 'rake/clean'
5
+ require 'rake/testtask'
6
+ require 'rake/packagetask'
7
+ require 'rake/gempackagetask'
8
+ require 'rake/rdoctask'
9
+ require 'rake/contrib/sshpublisher'
10
+ require 'net/ftp'
11
+ require 'jeweler'
12
+
13
+ PKG_NAME = 'rubyzip'
14
+ PKG_VERSION = File.read('lib/zip/zip.rb').match(/\s+VERSION\s*=\s*'(.*)'/)[1]
15
+
16
+ PKG_FILES = FileList.new
17
+
18
+ PKG_FILES.add %w{ README NEWS TODO ChangeLog install.rb Rakefile }
19
+ PKG_FILES.add %w{ samples/*.rb }
20
+ PKG_FILES.add %w{ test/*.rb }
21
+ PKG_FILES.add %w{ test/data/* }
22
+ PKG_FILES.exclude "test/data/generated"
23
+ PKG_FILES.add %w{ lib/**/*.rb }
24
+
25
+ def clobberFromCvsIgnore(path)
26
+ CLOBBER.add File.readlines(path+'/.cvsignore').map {
27
+ |f| File.join(path, f.chomp)
28
+ } rescue StandardError
29
+ end
30
+
31
+ clobberFromCvsIgnore '.'
32
+ clobberFromCvsIgnore 'samples'
33
+ clobberFromCvsIgnore 'test'
34
+ clobberFromCvsIgnore 'test/data'
35
+
36
+ task :default => [:test]
37
+
38
+ desc "Run unit tests"
39
+ task :test do
40
+ ruby %{-C test alltests.rb}
41
+ end
42
+
43
+ # Shortcuts for test targets
44
+ task :ut => [:test]
45
+
46
+ spec = Gem::Specification.new do |s|
47
+ s.name = PKG_NAME
48
+ s.version = PKG_VERSION
49
+ s.author = "Thomas Sondergaard"
50
+ s.email = "thomas(at)sondergaard.cc"
51
+ s.homepage = "http://rubyzip.sourceforge.net/"
52
+ s.platform = Gem::Platform::RUBY
53
+ s.summary = "rubyzip is a ruby module for reading and writing zip files"
54
+ s.description = "rubyzip is a ruby module for reading and writing zip files"
55
+ s.files = PKG_FILES.to_a
56
+ s.require_path = 'lib'
57
+ end
58
+
59
+ begin
60
+ require 'jeweler'
61
+ Jeweler::Tasks.new(spec)
62
+ rescue LoadError
63
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
64
+ end
65
+
66
+ Rake::GemPackageTask.new(spec) do |pkg|
67
+ pkg.need_zip = true
68
+ pkg.need_tar = true
69
+ end
70
+
71
+ Rake::RDocTask.new do |rd|
72
+ rd.main = "README"
73
+ rd.rdoc_files.add %W{ lib/zip/*.rb README NEWS TODO ChangeLog }
74
+ rd.options << "--title 'rubyzip documentation' --webcvs http://cvs.sourceforge.net/viewcvs.py/rubyzip/rubyzip/"
75
+ # rd.options << "--all"
76
+ end
77
+
78
+ namespace :rubyzip do
79
+ desc "Publish documentation"
80
+ task :pdoc => [:rdoc] do
81
+ Rake::SshFreshDirPublisher.
82
+ new("thomas@rubyzip.sourceforge.net", "/home/groups/r/ru/rubyzip/htdocs", "html").upload
83
+ end
84
+
85
+ desc "Publish package"
86
+ task :ppackage => [:package] do
87
+ Net::FTP.open("upload.sourceforge.net",
88
+ "ftp",
89
+ ENV['USER']+"@"+ENV['HOSTNAME']) {
90
+ |ftpclient|
91
+ ftpclient.passive = true
92
+ ftpclient.chdir "incoming"
93
+ Dir['pkg/*.{tgz,zip,gem}'].each {
94
+ |e|
95
+ ftpclient.putbinaryfile(e, File.basename(e))
96
+ }
97
+ }
98
+ end
99
+
100
+ desc "Generate the ChangeLog file"
101
+ task :ChangeLog do
102
+ puts "Updating ChangeLog"
103
+ system %{cvs2cl}
104
+ end
105
+
106
+ desc "Make a release"
107
+ task :release => [:tag_release, :pdoc, :ppackage] do
108
+ end
109
+
110
+ desc "Make a release tag"
111
+ task :tag_release do
112
+ tag = "release-#{PKG_VERSION.gsub('.','-')}"
113
+
114
+ puts "Checking for tag '#{tag}'"
115
+ if (Regexp.new("^\\s+#{tag}") =~ `cvs log README`)
116
+ abort "Tag '#{tag}' already exists"
117
+ end
118
+ puts "Tagging module with '#{tag}'"
119
+ system("cvs tag #{tag}")
120
+ end
121
+ end
data/TODO ADDED
@@ -0,0 +1,16 @@
1
+
2
+ * ZipInputStream: Support zip-files with trailing data descriptors
3
+ * Adjust rdoc stylesheet to advertise inherited methods if possible
4
+ * Suggestion: Add ZipFile/ZipInputStream example that demonstrates extracting all entries.
5
+ * Suggestion: ZipFile#extract destination should default to "."
6
+ * Suggestion: ZipEntry should have extract(), get_input_stream() methods etc
7
+ * SUggestion: ZipInputStream/ZipOutputStream should accept an IO object in addition to a filename.
8
+ * (is buffering used anywhere with write?)
9
+ * Inflater.sysread should pass the buffer to produce_input.
10
+ * Implement ZipFsDir.glob
11
+ * ZipFile.checkIntegrity method
12
+ * non-MSDOS permission attributes
13
+ ** See mail from Ned Konz to ruby-talk subj. "Re: SV: [ANN] Archive 0.2"
14
+ * Packager version, required unpacker version in zip headers
15
+ ** See mail from Ned Konz to ruby-talk subj. "Re: SV: [ANN] Archive 0.2"
16
+ * implement storing attributes and ownership information
data/install.rb ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $VERBOSE = true
4
+
5
+ require 'rbconfig'
6
+ require 'find'
7
+ require 'fileutils'
8
+
9
+ include Config
10
+
11
+ files = %w{ stdrubyext.rb ioextras.rb zip.rb zipfilesystem.rb ziprequire.rb tempfile_bugfixed.rb }
12
+
13
+ INSTALL_DIR = File.join(CONFIG["sitelibdir"], "zip")
14
+ FileUtils.makedirs(INSTALL_DIR)
15
+
16
+ SOURCE_DIR = File.join(File.dirname($0), "lib/zip")
17
+
18
+ files.each {
19
+ |filename|
20
+ installPath = File.join(INSTALL_DIR, filename)
21
+ FileUtils::install(File.join(SOURCE_DIR, filename), installPath, 0644, true)
22
+ }