[ANN] rubyzip-0.5.0

T

Thomas

Just wanted to let you know that I have released a new version of
rubyzip that works with the latest versions of ruby and ruby-zlib.

There are also some other goodies like bug fixes and a new interface
for accessing and manipulating zip archives based on an API similar to
::Dir and ::File using ZipFile::dir and ZipFile::file.


In this release I have also changed the method namimg conventions from
camelCase to ruby_style.

Download: http://sourceforge.net/project/showfiles.php?group_id=43107
Home: http://rubyzip.sourceforge.net

Cheers,

Thomas


####### Example of the new ::Dir,::File inspired Zip api

# Instead of invoking methods on Dir and File you
# simply invoke them on zipFileInstance.dir and zipFileInstance.file

require 'zip/zipfilesystem'

Zip::ZipFile.open("myArchive.zip", Zip::ZipFile::CREATE) {
|zipFile|

zipFile.file.open("file.txt", "w") { |os| os.puts "Stuff 1"
}

zipFile.dir.mkdir "someDir"
zipFile.dir.chdir "someDir"

zipFile.file.open("file.txt", "w") { |os| os.puts "Stuff 2" }
zipFile.file.open("file2.txt", "w") { |os| os.puts "Stuff 3" }

puts "file.txt: #{zipFile.file.read('../file.txt')}"
puts "someDir/file.txt: #{zipFile.file.read('file.txt')}"

puts "\nzip contents:"
puts zipFile.entries.join("\n")

puts "\nCurrent dir entries:"
puts zipFile.dir.entries('.').join("\n")
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top