Skip to content

Commit

Permalink
RubyZip 0.9.1, released 2006-07-01
Browse files Browse the repository at this point in the history
  • Loading branch information
nbibler committed Jun 28, 2008
0 parents commit ddeb10b
Show file tree
Hide file tree
Showing 33 changed files with 9,285 additions and 0 deletions.
1,081 changes: 1,081 additions & 0 deletions ChangeLog

Large diffs are not rendered by default.

144 changes: 144 additions & 0 deletions NEWS
@@ -0,0 +1,144 @@
= Version 0.9.1

Added symlink support and support for unix file permissions. Reduced
memory usage during decompression.

New methods ZipFile::[follow_symlinks, restore_times, restore_permissions, restore_ownership].
New methods ZipEntry::unix_perms, ZipInputStream::eof?.
Added documentation and test for new ZipFile::extract.
Added some of the API suggestions from sf.net #1281314.
Applied patch for sf.net bug #1446926.
Applied patch for sf.net bug #1459902.
Rework ZipEntry and delegate classes.

= Version 0.5.12

Fixed problem with writing binary content to a ZipFile in MS Windows.

= Version 0.5.11

Fixed name clash file method copy_stream from fileutils.rb. Fixed
problem with references to constant CHUNK_SIZE.
ZipInputStream/AbstractInputStream read is now buffered like ruby IO's
read method, which means that read and gets etc can be mixed. The
unbuffered read method has been renamed to sysread.

= Version 0.5.10

Fixed method name resolution problem with FileUtils::copy_stream and
IOExtras::copy_stream.

= Version 0.5.9

Fixed serious memory consumption issue

= Version 0.5.8

Fixed install script.

= Version 0.5.7

install.rb no longer assumes it is being run from the toplevel source
dir. Directory structure changed to reflect common ruby library
project structure. Migrated from RubyUnit to Test::Unit format. Now
uses Rake to build source packages and gems and run unit tests.

= Version 0.5.6

Fix for FreeBSD 4.9 which returns Errno::EFBIG instead of
Errno::EINVAL for some invalid seeks. Fixed 'version needed to
extract'-field incorrect in local headers.

= Version 0.5.5

Fix for a problem with writing zip files that concerns only ruby 1.8.1.

= Version 0.5.4

Significantly reduced memory footprint when modifying zip files.

= Version 0.5.3

Added optimization to avoid decompressing and recompressing individual
entries when modifying a zip archive.

= Version 0.5.2

Fixed ZipFile corruption bug in ZipFile class. Added basic unix
extra-field support.

= Version 0.5.1

Fixed ZipFile.get_output_stream bug.

= Version 0.5.0

List of changes:
* Ruby 1.8.0 and ruby-zlib 0.6.0 compatibility
* Changed method names from camelCase to rubys underscore style.
* Installs to zip/ subdir instead of directly to site_ruby
* Added ZipFile.directory and ZipFile.file - each method return an
object that can be used like Dir and File only for the contents of the
zip file.
* Added sample application zipfind which works like Find.find, only
Zip::ZipFind.find traverses into zip archives too.

Bug fixes:
* AbstractInputStream.each_line with non-default separator


= Version 0.5.0a

Source reorganized. Added ziprequire, which can be used to load ruby
modules from a zip file, in a fashion similar to jar files in
Java. Added gtkRubyzip, another sample application. Implemented
ZipInputStream.lineno and ZipInputStream.rewind

Bug fixes:

* Read and write date and time information correctly for zip entries.
* Fixed read() using separate buffer, causing mix of gets/readline/read to
cause problems.

= Version 0.4.2

Performance optimizations. Test suite runs in half the time.

= Version 0.4.1

Windows compatibility fixes.

= Version 0.4.0

Zip::ZipFile is now mutable and provides a more convenient way of
modifying zip archives than Zip::ZipOutputStream. Operations for
adding, extracting, renaming, replacing and removing entries to zip
archives are now available.

Runs without warnings with -w switch.

Install script install.rb added.


= Version 0.3.1

Rudimentary support for writing zip archives.


= Version 0.2.2

Fixed and extended unit test suite. Updated to work with ruby/zlib
0.5. It doesn't work with earlier versions of ruby/zlib.


= Version 0.2.0

Class ZipFile added. Where ZipInputStream is used to read the
individual entries in a zip file, ZipFile reads the central directory
in the zip archive, so you can get to any entry in the zip archive
without having to skipping through all the preceeding entries.


= Version 0.1.0

First working version of ZipInputStream.
72 changes: 72 additions & 0 deletions README
@@ -0,0 +1,72 @@
= rubyzip

rubyzip is a ruby library for reading and writing zip files.

= Install

If you have rubygems you can install rubyzip directly from the gem
repository

gem install rubyzip

Otherwise obtain the source (see below) and run

ruby install.rb

To run the unit tests you need to have test::unit installed

rake test


= Documentation

There is more than one way to access or create a zip archive with
rubyzip. The basic API is modeled after the classes in
java.util.zip from the Java SDK. This means there are classes such
as Zip::ZipInputStream, Zip::ZipOutputStream and
Zip::ZipFile. Zip::ZipInputStream provides a basic interface for
iterating through the entries in a zip archive and reading from the
entries in the same way as from a regular File or IO
object. ZipOutputStream is the corresponding basic output
facility. Zip::ZipFile provides a mean for accessing the archives
central directory and provides means for accessing any entry without
having to iterate through the archive. Unlike Java's
java.util.zip.ZipFile rubyzip's Zip::ZipFile is mutable, which means
it can be used to change zip files as well.

Another way to access a zip archive with rubyzip is to use rubyzip's
Zip::ZipFileSystem API. Using this API files can be read from and
written to the archive in much the same manner as ruby's builtin
classes allows files to be read from and written to the file system.

rubyzip also features the
zip/ziprequire.rb[link:files/lib/zip/ziprequire_rb.html] module which
allows ruby to load ruby modules from zip archives.

For details about the specific behaviour of classes and methods refer
to the test suite. Finally you can generate the rdoc documentation or
visit http://rubyzip.sourceforge.net.

= License

rubyzip is distributed under the same license as ruby. See
http://www.ruby-lang.org/en/LICENSE.txt


= Website and Project Home

http://rubyzip.sourceforge.net

http://sourceforge.net/projects/rubyzip

== Download (tarballs and gems)

http://sourceforge.net/project/showfiles.php?group_id=43107&package_id=35377

= Authors

Thomas Sondergaard (thomas at sondergaard.cc)

Technorama Ltd. (oss-ruby-zip at technorama.net)

extra-field support contributed by Tatsuki Sugiura (sugi at nemui.org)
110 changes: 110 additions & 0 deletions Rakefile
@@ -0,0 +1,110 @@
# Rakefile for RubyGems -*- ruby -*-

require 'rubygems'
require 'rake/clean'
require 'rake/testtask'
require 'rake/packagetask'
require 'rake/gempackagetask'
require 'rake/rdoctask'
require 'rake/contrib/sshpublisher'
require 'net/ftp'

PKG_NAME = 'rubyzip'
PKG_VERSION = File.read('lib/zip/zip.rb').match(/\s+VERSION\s*=\s*'(.*)'/)[1]

PKG_FILES = FileList.new

PKG_FILES.add %w{ README NEWS TODO ChangeLog install.rb Rakefile }
PKG_FILES.add %w{ samples/*.rb }
PKG_FILES.add %w{ test/*.rb }
PKG_FILES.add %w{ test/data/* }
PKG_FILES.exclude "test/data/generated"
PKG_FILES.add %w{ lib/**/*.rb }

def clobberFromCvsIgnore(path)
CLOBBER.add File.readlines(path+'/.cvsignore').map {
|f| File.join(path, f.chomp)
} rescue StandardError
end

clobberFromCvsIgnore '.'
clobberFromCvsIgnore 'samples'
clobberFromCvsIgnore 'test'
clobberFromCvsIgnore 'test/data'

task :default => [:test]

desc "Run unit tests"
task :test do
ruby %{-C test alltests.rb}
end

# Shortcuts for test targets
task :ut => [:test]

spec = Gem::Specification.new do |s|
s.name = PKG_NAME
s.version = PKG_VERSION
s.author = "Thomas Sondergaard"
s.email = "thomas(at)sondergaard.cc"
s.homepage = "http://rubyzip.sourceforge.net/"
s.platform = Gem::Platform::RUBY
s.summary = "rubyzip is a ruby module for reading and writing zip files"
s.files = PKG_FILES.to_a
s.require_path = 'lib'
end

Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end

Rake::RDocTask.new do |rd|
rd.main = "README"
rd.rdoc_files.add %W{ lib/zip/*.rb README NEWS TODO ChangeLog }
rd.options << "--title 'rubyzip documentation' --webcvs http://cvs.sourceforge.net/viewcvs.py/rubyzip/rubyzip/"
# rd.options << "--all"
end

desc "Publish documentation"
task :pdoc => [:rdoc] do
Rake::SshFreshDirPublisher.
new("thomas@rubyzip.sourceforge.net", "/home/groups/r/ru/rubyzip/htdocs", "html").upload
end

desc "Publish package"
task :ppackage => [:package] do
Net::FTP.open("upload.sourceforge.net",
"ftp",
ENV['USER']+"@"+ENV['HOSTNAME']) {
|ftpclient|
ftpclient.passive = true
ftpclient.chdir "incoming"
Dir['pkg/*.{tgz,zip,gem}'].each {
|e|
ftpclient.putbinaryfile(e, File.basename(e))
}
}
end

desc "Generate the ChangeLog file"
task :ChangeLog do
puts "Updating ChangeLog"
system %{cvs2cl}
end

desc "Make a release"
task :release => [:tag_release, :pdoc, :ppackage] do
end

desc "Make a release tag"
task :tag_release do
tag = "release-#{PKG_VERSION.gsub('.','-')}"

puts "Checking for tag '#{tag}'"
if (Regexp.new("^\\s+#{tag}") =~ `cvs log README`)
abort "Tag '#{tag}' already exists"
end
puts "Tagging module with '#{tag}'"
system("cvs tag #{tag}")
end
16 changes: 16 additions & 0 deletions TODO
@@ -0,0 +1,16 @@

* ZipInputStream: Support zip-files with trailing data descriptors
* Adjust rdoc stylesheet to advertise inherited methods if possible
* Suggestion: Add ZipFile/ZipInputStream example that demonstrates extracting all entries.
* Suggestion: ZipFile#extract destination should default to "."
* Suggestion: ZipEntry should have extract(), get_input_stream() methods etc
* SUggestion: ZipInputStream/ZipOutputStream should accept an IO object in addition to a filename.
* (is buffering used anywhere with write?)
* Inflater.sysread should pass the buffer to produce_input.
* Implement ZipFsDir.glob
* ZipFile.checkIntegrity method
* non-MSDOS permission attributes
** See mail from Ned Konz to ruby-talk subj. "Re: SV: [ANN] Archive 0.2"
* Packager version, required unpacker version in zip headers
** See mail from Ned Konz to ruby-talk subj. "Re: SV: [ANN] Archive 0.2"
* implement storing attributes and ownership information
22 changes: 22 additions & 0 deletions install.rb
@@ -0,0 +1,22 @@
#!/usr/bin/env ruby

$VERBOSE = true

require 'rbconfig'
require 'find'
require 'ftools'

include Config

files = %w{ stdrubyext.rb ioextras.rb zip.rb zipfilesystem.rb ziprequire.rb tempfile_bugfixed.rb }

INSTALL_DIR = File.join(CONFIG["sitelibdir"], "zip")
File.makedirs(INSTALL_DIR)

SOURCE_DIR = File.join(File.dirname($0), "lib/zip")

files.each {
|filename|
installPath = File.join(INSTALL_DIR, filename)
File::install(File.join(SOURCE_DIR, filename), installPath, 0644, true)
}

0 comments on commit ddeb10b

Please sign in to comment.