[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Best Way to Distribute Non-Code Files

Zed A. Shaw

3/25/2005 5:19:00 PM

Hi,

I was just wondering what other folks have done when distributing files
that aren't code with their Ruby applications? I have about 5-6 very
small files that are data which get read into the application.

Any suggestions would be great. Thanks.

Zed A. Shaw




5 Answers

Aredridel

3/25/2005 5:53:00 PM

0

On Sat, 26 Mar 2005 02:19:15 +0900, Zed A. Shaw <zedshaw@zedshaw.com> wrote:
> Hi,
>
> I was just wondering what other folks have done when distributing files
> that aren't code with their Ruby applications? I have about 5-6 very
> small files that are data which get read into the application.
>
> Any suggestions would be great. Thanks.

What sort of data? /usr/share/yourapp sorts? Icons? Config files?


B. K. Oxley (binkley)

3/25/2005 9:03:00 PM

0

Aredridel wrote:
> On Sat, 26 Mar 2005 02:19:15 +0900, Zed A. Shaw <zedshaw@zedshaw.com> wrote:
>>I was just wondering what other folks have done when distributing files
>>that aren't code with their Ruby applications? I have about 5-6 very
>>small files that are data which get read into the application.
>
> What sort of data? /usr/share/yourapp sorts? Icons? Config files?

In general, is there a JAR-like format well-supported by Ruby? Most
folks think of JARs for distributing code, but it is excellent as a
resource and configuration storage format.


Cheers,
--binkley



Aredridel

3/26/2005 12:43:00 AM

0

On Sat, 26 Mar 2005 06:02:43 +0900, B. K. Oxley (binkley)
<binkley@alumni.rice.edu> wrote:
> Aredridel wrote:
> > On Sat, 26 Mar 2005 02:19:15 +0900, Zed A. Shaw <zedshaw@zedshaw.com> wrote:
> >>I was just wondering what other folks have done when distributing files
> >>that aren't code with their Ruby applications? I have about 5-6 very
> >>small files that are data which get read into the application.
> >
> > What sort of data? /usr/share/yourapp sorts? Icons? Config files?
>
> In general, is there a JAR-like format well-supported by Ruby? Most
> folks think of JARs for distributing code, but it is excellent as a
> resource and configuration storage format.

Heh. There's tarballs and their variants (gems, rps and such)

Jars are one thing that always made me feel ill working with Java.
They don't integrate well into a greater system particularly
gracefully.

Ari


Erik Veenstra

3/26/2005 12:05:00 PM

0

> > > I was just wondering what other folks have done when
> > > distributing files that aren't code with their Ruby
> > > applications? I have about 5-6 very small files that are
> > > data which get read into the application.
>
> In general, is there a JAR-like format well-supported by
> Ruby? Most folks think of JARs for distributing code, but it
> is excellent as a resource and configuration storage format.

You might want to have a look at Tar2RubyScript:

http://www.erikveen.dds.nl/tar2rubyscript/...

It's the third entry when searching with Google: ruby jar.

gegroet,
Erik V.

Dido Sevilla

3/26/2005 2:37:00 PM

0

On Sat, 26 Mar 2005 02:19:15 +0900, Zed A. Shaw <zedshaw@zedshaw.com> wrote:
> Hi,
>
> I was just wondering what other folks have done when distributing files
> that aren't code with their Ruby applications? I have about 5-6 very
> small files that are data which get read into the application.

Well, I recently wrote a small program in FXRuby that would have
otherwise loaded GIF icons from a certain path, all of which were
under 4K in size, and I made the entire program totally self-contained
by base64 encoding these GIFs and embedding them as strings inside the
program. I don't know if this trick will work for your application
though. It has the advantage of making it dead easy to distribute the
program, as only the script file was required provided that the user
already has a working version of Ruby and FXRuby available (as the
target was Windows, the one-click installer made this certain).

Frankly, I don't see any problem with embodying non-code data as Ruby
code as I have done, provided there's a good reason to do so.