[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[BOUNTY] Pure Ruby Zlib::GzipWriter

Daniel Berger

12/15/2008 4:32:00 PM

Hi,

There's a project out there called "zliby" [1] which partially
implements the zlib library. Unfortunately, only the Zlib::GzipReader
class has been implemented so far. I'd like to have a pure Ruby
implementation of the Zlib::GzipWriter class.

I've put in a feature request [2] but I'd like to see it expedited. In
order to expedite this, I'm offering $100 to anyone who can implement
it. In order to qualify for the bounty, your Zlib::GzipWriter class
must meet the following criteria:

* It must be pure Ruby. No extensions. No FFI.
* It must have tests (and pass them)
* It must match the current Zlib::GzipWriter interface
* It must be cross platform
* It must be able to generate a proper gem file from a gemspec (the
acid test)
* It must be contributed back to the zliby project
* It must be done within 60 days of this post

If these conditions are met, you will receive your bounty via PayPal.

What's my motivation? Mainly MS Windows. I run a hand built version of
Ruby, and getting the zlib wrapper to build with MS VC++ is such a
colossal PITA that I'd like to avoid it completely. Beyond that,
however, is that it eliminates a third party dependency (zlib) and
gives me the ability to create gems. At the moment I can only read
them.

Any takers? Any matchers?

Regards,

Dan

[1] http:/www.rubyforge.org/projects/zliby
[2] http://rubyforge.org/tracker/index.php?func=detail&aid=23239&group_id=5769&...

52 Answers

Roger Pack

12/20/2008 11:26:00 PM

0

> I've put in a feature request [2] but I'd like to see it expedited. In
> order to expedite this, I'm offering $100 to anyone who can implement
> it. In order to qualify for the bounty, your Zlib::GzipWriter class
> must meet the following criteria:
That would indeed be convenient.
Would be nice to someday no longer have the dependency of rubygems on
zlib.
http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/a6966f...
Then there'd be one less setup hurdle for ruby.
I'm a watcher for now though :)
-=R

Charles Oliver Nutter

12/21/2008 6:08:00 PM

0

rogerdpack wrote:
>> I've put in a feature request [2] but I'd like to see it expedited. In
>> order to expedite this, I'm offering $100 to anyone who can implement
>> it. In order to qualify for the bounty, your Zlib::GzipWriter class
>> must meet the following criteria:
> That would indeed be convenient.
> Would be nice to someday no longer have the dependency of rubygems on
> zlib.
> http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/a6966f...
> Then there'd be one less setup hurdle for ruby.
> I'm a watcher for now though :)

Of course you could use JRuby, which doesn't have such issues with zlib
and Windows...

- Charlie

Daniel Berger

12/21/2008 8:41:00 PM

0



On Dec 21, 1:08=A0pm, Charles Oliver Nutter <charles.nut...@sun.com>
wrote:
> rogerdpack wrote:
> >> I've put in a feature request [2] but I'd like to see it expedited. In
> >> order to expedite this, I'm offering $100 to anyone who can implement
> >> it. In order to qualify for the bounty, your Zlib::GzipWriter class
> >> must meet the following criteria:
> > That would indeed be convenient.
> > Would be nice to someday no longer have the dependency of rubygems on
> > zlib.
> >http://groups.google.com/group/comp.lang.ruby/browse_thread......
> > Then there'd be one less setup hurdle for ruby.
> > I'm a watcher for now though :)
>
> Of course you could use JRuby, which doesn't have such issues with zlib
> and Windows...

I thought JRuby used FFI. No? If not, it should just be matter of
porting the code. But if so, you still have two third party
dependencies - FFI and zlib.dll.

Regards,

Dan

Charles Oliver Nutter

12/21/2008 9:01:00 PM

0

Daniel Berger wrote:
> I thought JRuby used FFI. No? If not, it should just be matter of
> porting the code. But if so, you still have two third party
> dependencies - FFI and zlib.dll.

The JVM includes zlib and obviously has a very nice version for Windows.
We just wrap the JVM's zlib-based compression classes. But that doesn't
really solve your original problem since you want to run a handbuilt C
Ruby...

- Charlie

The Higgs bozo

12/21/2008 10:17:00 PM

0

Daniel Berger wrote:
>
> What's my motivation? Mainly MS Windows. I run a hand built version of
> Ruby, and getting the zlib wrapper to build with MS VC++ is such a
> colossal PITA that I'd like to avoid it completely. Beyond that,
> however, is that it eliminates a third party dependency (zlib) and
> gives me the ability to create gems. At the moment I can only read
> them.

As a cheap shortcut, could you store a base64-encoded zlib dll in a .rb
file, decode it, then call it with DL or FFI?
--
Posted via http://www.ruby-....

Daniel Berger

12/22/2008 2:55:00 AM

0



On Dec 21, 5:16=A0pm, The Higgs bozo <higgs.b...@gmail.com> wrote:
> Daniel Berger wrote:
>
> > What's my motivation? Mainly MS Windows. I run a hand built version of
> > Ruby, and getting the zlib wrapper to build with MS VC++ is such a
> > colossal PITA that I'd like to avoid it completely. Beyond that,
> > however, is that it eliminates a third party dependency (zlib) and
> > gives me the ability to create gems. At the moment I can only read
> > them.
>
> As a cheap shortcut, could you store a base64-encoded zlib dll in a .rb
> file, decode it, then call it with DL or FFI?

I'm not really sure how to do that, and it's not really what I'm
looking for I'm afraid.

Regards,

Dan

The Higgs bozo

12/22/2008 3:59:00 AM

0

Daniel Berger wrote:
> On Dec 21, 5:16�pm, The Higgs bozo <higgs.b...@gmail.com> wrote:
>> file, decode it, then call it with DL or FFI?
> I'm not really sure how to do that, and it's not really what I'm
> looking for I'm afraid.

You didn't know how, or didn't understand? DL is part of the standard
library. You could carry around the zlib dll right inside an .rb file,
and use DL to call the zlib function(s) you needed.

I understand you were looking for a general-purpose solution, but in the
meantime this does what you need, albeit gymnastically. Namely, zlib on
Windows without the requirement of building a ruby extension.
--
Posted via http://www.ruby-....

Daniel Berger

12/22/2008 7:08:00 AM

0



On Dec 21, 10:59=A0pm, The Higgs bozo <higgs.b...@gmail.com> wrote:
> Daniel Berger wrote:
> > On Dec 21, 5:16 pm, The Higgs bozo <higgs.b...@gmail.com> wrote:
> >> file, decode it, then call it with DL or FFI?
> > I'm not really sure how to do that, and it's not really what I'm
> > looking for I'm afraid.
>
> You didn't know how, or didn't understand? =A0DL is part of the standard
> library. =A0You could carry around the zlib dll right inside an .rb file,
> and use DL to call the zlib function(s) you needed.

Just to clarify for purposes of the bounty, no DL, and no distributed
dll's.

> I understand you were looking for a general-purpose solution, but in the
> meantime this does what you need, albeit gymnastically. =A0Namely, zlib o=
n
> Windows without the requirement of building a ruby extension.

I really do appreciate the suggestion but it's not what I'm looking
for.

Regards,

Dan

Joel VanderWerf

12/22/2008 9:50:00 PM

0

The Higgs bozo wrote:
> library. You could carry around the zlib dll right inside an .rb file,
> and use DL to call the zlib function(s) you needed.

Out of curiosity, how do you suggest doing this? Put the dll in the DATA
section, write to a tmp file, and load? Or is there some magic?

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Roger Pack

12/27/2008 1:06:00 AM

0

> What's my motivation? Mainly MS Windows. I run a hand built version of
> Ruby, and getting the zlib wrapper to build with MS VC++ is such a
> colossal PITA that I'd like to avoid it completely. Beyond that,
> however, is that it eliminates a third party dependency (zlib) and
> gives me the ability to create gems. At the moment I can only read
> them.

One thing I use to help me compile on doze is Lavena's rubyinstaller
[I'm sure you've seen it..].
Anyway I'll match $50 :)
-=r
--
Posted via http://www.ruby-....