[ANN] pr-zlib 1.0.0 - A Pure Ruby zlib library

Discussion in 'Ruby' started by Daniel Berger, Jun 13, 2009.

  1. Hi all,

    The Pure Team is pleased to announce the release of pr-zlib 1.0.0.

    = What is it?

    The pr-zlib library is actually two separate libraries packaged together.
    The first, rbzlib.rb, is a pure Ruby port of zlib.h (the C library). It's a
    module that you can mixin and use as you see fit. The second, zlib.rb, is a
    pure Ruby version of the Ruby interface to the zlib C library that ships as
    part of the Ruby standard library.

    = How do I get it?

    gem install pr-zlib

    Or, just go the RubyForge project page at
    http://www.rubyforge.org/projects/pure, download the source and run either
    'rake install' or 'rake install_as_zlib' (which will install the library as
    'zlib' instead of 'pr/zlib').

    = How do I use it?

    require 'pr/zlib'
    # The rest is the same as the zlib that ships with the Ruby stdlib.

    = Why? (Also in the README)

    First, building the zlib C library on MS Windows with Visual C++ is very
    difficult. However, certain libraries depend on zlib, most notably rubygems.
    By providing a pure Ruby version we eliminate any compiler or platform
    compatibility issues.

    Second, even some Unix distributions, such as Debian, do not ship with the
    zlib library by default. By creating a pure Ruby version of the zlib library
    we eliminate the need to install a 3rd party C library, and eliminate a
    potential weak link in the dependency chain.

    Third, by creating pure Ruby versions of the library and the interface we
    are more likely to receive patches, feature requests, documentation updates,
    etc, from the Ruby community (I hope) since not everyone who knows Ruby also
    knows C.

    Last, the zlib interface that ships as part of the stdlib is a little on the
    clunky side IMO. By providing a pure Ruby version, authors can create their
    own interface as they see fit.

    = What about Zliby?

    Two things. First, Michael has not released the version of the code that
    supports Zlib::GzipWriter. Second, Zliby merges the code into a single file.
    The pr-zlib splits the code into its two parts - rbzlib.rb and zlib.rb. The
    former is a module that can be used separately. As I mentioned earlier, that
    means users can create their own interface if they prefer.

    = Feeling Generous?

    If you think this is a useful library, and would like to see more time spent
    on others like it, please consider a contribution:

    http://pledgie.com/campaigns/4706 (Daniel's general drive)

    (Heesob on Paypal)

    Enjoy!

    The Pure Team (Daniel Berger and Park Heesob)
     
    Daniel Berger, Jun 13, 2009
    #1
    1. Advertising

  2. Daniel Berger

    trans Guest

    Re: pr-zlib 1.0.0 - A Pure Ruby zlib library

    On Jun 13, 12:02=A0am, "Daniel Berger" <> wrote:
    > Hi all,
    >
    > The Pure Team is pleased to announce the release of pr-zlib 1.0.0.
    >
    > =3D What is it?
    >
    > The pr-zlib library is actually two separate libraries packaged together.
    > The first, rbzlib.rb, is a pure Ruby port of zlib.h (the C library). It's=

    a
    > module that you can mixin and use as you see fit. The second, zlib.rb, is=

    a
    > pure Ruby version of the Ruby interface to the zlib C library that ships =

    as
    > part of the Ruby standard library.
    >
    > =3D How do I get it?
    >
    > gem install pr-zlib
    >
    > Or, just go the RubyForge project page athttp://www.rubyforge.org/project=

    s/pure, download the source and run either
    > 'rake install' or 'rake install_as_zlib' (which will install the library =

    as
    > 'zlib' instead of 'pr/zlib').
    >
    > =3D How do I use it?
    >
    > require 'pr/zlib'
    > # The rest is the same as the zlib that ships with the Ruby stdlib.


    I wonder if this would be more desirable actually in the standard
    library for the reasons you give.

    > =3D Why? (Also in the README)
    >
    > First, building the zlib C library on MS Windows with Visual C++ is very
    > difficult. However, certain libraries depend on zlib, most notably rubyge=

    ms.
    > By providing a pure Ruby version we eliminate any compiler or platform
    > compatibility issues.
    >
    > Second, even some Unix distributions, such as Debian, do not ship with th=

    e
    > zlib library by default. By creating a pure Ruby version of the zlib libr=

    ary
    > we eliminate the need to install a 3rd party C library, and eliminate a
    > potential weak link in the dependency chain.
    >
    > Third, by creating pure Ruby versions of the library and the interface we
    > are more likely to receive patches, feature requests, documentation updat=

    es,
    > etc, from the Ruby community (I hope) since not everyone who knows Ruby a=

    lso
    > knows C.
    >
    > Last, the zlib interface that ships as part of the stdlib is a little on =

    the
    > clunky side IMO. By providing a pure Ruby version, authors can create the=

    ir
    > own interface as they see fit.


    Good show, gents.

    Maybe some benchmarks?

    T.
     
    trans, Jun 13, 2009
    #2
    1. Advertising

  3. Daniel Berger

    Robert Dober Guest

    Re: pr-zlib 1.0.0 - A Pure Ruby zlib library

    On Sat, Jun 13, 2009 at 10:54 AM, trans<> wrote:
    >
    >
    > On Jun 13, 12:02=A0am, "Daniel Berger" <> wrote:
    >
    >> =3D How do I use it?
    >>
    >> require 'pr/zlib'
    >> # The rest is the same as the zlib that ships with the Ruby stdlib.

    >
    > I wonder if this would be more desirable actually in the standard
    > library for the reasons you give.

    +1 and kudos to the pure team :)
    Robert
    >
     
    Robert Dober, Jun 13, 2009
    #3
  4. Daniel Berger

    Roger Pack Guest

    Re: pr-zlib 1.0.0 - A Pure Ruby zlib library


    > I wonder if this would be more desirable actually in the standard
    > library for the reasons you give.


    or perhaps included with rubygems as a backup?
    =r
    --
    Posted via http://www.ruby-forum.com/.
     
    Roger Pack, Jun 14, 2009
    #4
  5. Re: pr-zlib 1.0.0 - A Pure Ruby zlib library

    > -----Original Message-----
    > From: [mailto:]
    > Sent: Saturday, June 13, 2009 9:05 PM
    > To: ruby-talk ML
    > Subject: Re: pr-zlib 1.0.0 - A Pure Ruby zlib library
    >=20
    >=20
    > > I wonder if this would be more desirable actually in the standard
    > > library for the reasons you give.

    >=20
    > or perhaps included with rubygems as a backup?


    http://rubyforge.org/tracker/index.php?func=3Ddetail&aid=3D22220&group_id=
    =3D126&atid=3D578

    Originally I was going to use zliby, but I think what we'll do is try to =
    load pr/zlib if zlib can't be found. So, you'll have to install one or =
    the other first at some point, but at least you'll have a choice.

    Regards,

    Dan
     
    Daniel Berger, Jun 14, 2009
    #5
  6. Daniel Berger

    Roger Pack Guest

    Re: pr-zlib 1.0.0 - A Pure Ruby zlib library

    > Or, just go the RubyForge project page at
    > http://www.rubyforge.org/projects/pure, download the source and run
    > either
    > 'rake install' or 'rake install_as_zlib' (which will install the library
    > as
    > 'zlib' instead of 'pr/zlib').


    Thanks much--just used it to overcome a

    C:\installs\ruby_trunk_installed\bin>gem list
    C:/installs/ruby_trunk_installed/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:1:in
    `require': no such file to load -- zlib (LoadError)

    and it worked and gems installed successfully using it. Sweet.

    -=r
    --
    Posted via http://www.ruby-forum.com/.
     
    Roger Pack, Jun 21, 2009
    #6
    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. Matthew Brett
    Replies:
    4
    Views:
    1,167
    Matthew Brett
    May 9, 2010
  2. hemant
    Replies:
    10
    Views:
    251
    Jason Roelofs
    Dec 5, 2007
  3. Daniel Berger

    Pure Ruby zlib?

    Daniel Berger, Dec 10, 2007, in forum: Ruby
    Replies:
    4
    Views:
    119
    Daniel Berger
    Dec 10, 2007
  4. Daniel Berger

    [BOUNTY] Pure Ruby Zlib::GzipWriter

    Daniel Berger, Dec 15, 2008, in forum: Ruby
    Replies:
    42
    Views:
    618
    Daniel Berger
    Jan 17, 2009
  5. Nicholas Wieland

    Most simple usage of zlib or pr-zlib

    Nicholas Wieland, Mar 9, 2011, in forum: Ruby
    Replies:
    4
    Views:
    342
    Jeremy Bopp
    Mar 10, 2011
Loading...

Share This Page