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
:ir 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 :ir,::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")
}
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
:ir 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 :ir,::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")
}