[ANN] rubyzip-0.5.0

Discussion in 'Ruby' started by Thomas, Aug 22, 2003.

  1. Thomas

    Thomas Guest

    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")
    }
     
    Thomas, Aug 22, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Britt
    Replies:
    5
    Views:
    305
  2. DaZoner

    rubyzip problem

    DaZoner, Mar 16, 2005, in forum: Ruby
    Replies:
    1
    Views:
    144
    Thomas Sondergaard
    Mar 17, 2005
  3. Robert Evans
    Replies:
    3
    Views:
    246
    Robert Evans
    Sep 30, 2005
  4. José Luis
    Replies:
    2
    Views:
    349
    José Luis
    Apr 3, 2006
  5. subimage
    Replies:
    9
    Views:
    243
    Thomas Sondergaard
    Jul 29, 2006
Loading...

Share This Page