[ANN] ruby_archive 0.1.0 released

  • Thread starter Jonathan Nielsen
  • Start date
J

Jonathan Nielsen

[Note: parts of this message were removed to make it a legal post.]

After a summer of working on various ways to implement it, I'm happy to
announce that I'm putting the first release of my Ruby Summer of Code
project, ruby_archive 0.1.0, out into the wild.

It's available on rubygems as well as at
http://github.com/byuni/ruby_archive

ruby_archive lets you use files within zip files much like normal files on
your filesystem. This means you can package data files and Ruby libraries
within convenient zip files and still use them easily from your program.
For open, load, require, and most File.*** and Dir.*** operations, you can
access files within archives by targetting at a location like the following:
'(filename)!/(file_inside_archive)'

It also allows you to package your entire program in one file and run it
using the included 'rba_launch' program.

See the readme file at the github site or in the rdoc for full instructions
and details.

It works on ruby-1.8.7, jruby, rubinius, and ruby-head, and probably other
interpreters and versions. Let me know if and when you run into any
problems, I will be continuing work on this project beyond the Ruby Summer
of Code deadline.

A goal of the project was to put this type of functionality up for
consideration to be included in the Ruby interpreter - feedback related to
this is welcome as well.

-Jonathan Nielsen
 
J

James Edward Gray II

After a summer of working on various ways to implement it, I'm happy = to
announce that I'm putting the first release of my Ruby Summer of Code
project, ruby_archive 0.1.0, out into the wild.
=20
It's available on rubygems as well as at
http://github.com/byuni/ruby_archive
=20
ruby_archive lets you use files within zip files much like normal = files on
your filesystem. This means you can package data files and Ruby = libraries
within convenient zip files and still use them easily from your = program.
For open, load, require, and most File.*** and Dir.*** operations, you = can
access files within archives by targetting at a location like the = following:
'(filename)!/(file_inside_archive)'

Holy smoke. This is freaking awesome!

James Edward Gray II=
 
J

Jonathan Nielsen

[Note: parts of this message were removed to make it a legal post.]

Are there any plans to support other compression formats such as gzip and
bzip2, or archive formats like tar?
I would like to support other archive formats at some point, but it may be
down the line somewhat - first I'd like to improve the code in various
places where it is 'less-than-ideal'. But to support other formats we just
need to add more Handler subclasses that implement file operations, so it
certainly is possible.

-Jonathan Nielsen
 
J

Jonathan Nielsen

[Note: parts of this message were removed to make it a legal post.]

how do you resolve pathnames w "!"

best regards -botp
That is a concern that needs further work in future versions, but for now it
will always check if the file with '!' exists on the filesystem before it
trys to use the archive method.

-Jonathan Nielsen
 
D

David Masover

A goal of the project was to put this type of functionality up for
consideration to be included in the Ruby interpreter - feedback related to
this is welcome as well.

If it can work well as a Gem, especially if it doesn't need to know much about
the Ruby interpreter itself -- for example, if it just uses some zip library,
and is otherwise pure-Ruby, even better if it's a pure-Ruby zip library, or
something from the standard libs...

I'd much rather things like this _not_ go in core. This is the whole reason we
have gems -- I think it's pretty cool, but I'm not going to use it in every
Ruby script I write, and when I do need to use it, it's only a 'gem install'
away.
 
B

botp

That is a concern that needs further work in future versions, but for now it
will always check if the file with '!' exists on the filesystem before it
trys to use the archive method.

how about using constant flags as options, like eg,
File::FNM_ASZIP -- basename/actual file is zip itself
File::FNM_INZIP -- same as ! behaviour but no need of !, ie file
is contained in zip

thank you and best regards -botp
 
B

botp

It also allows you to package your entire program in one file and run it
using the included 'rba_launch' program.

even something like a,
require "programs.zip"

would be great.
 
I

Intransition

After a summer of working on various ways to implement it, I'm happy to
announce that I'm putting the first release of my Ruby Summer of Code
project, ruby_archive 0.1.0, out into the wild.

It's available on rubygems as well as athttp://github.com/byuni/ruby_arch= ive

ruby_archive lets you use files within zip files much like normal files o= n
your filesystem. =A0This means you can package data files and Ruby librar= ies
within convenient zip files and still use them easily from your program.
=A0For open, load, require, and most File.*** and Dir.*** operations, you= can
access files within archives by targetting at a location like the followi= ng:
'(filename)!/(file_inside_archive)'

I would like to suggest a more robust approach of subclassing File and
Dir, (e.g. File::Archive or ArchiveFile), rather than overriding File
and Dir methods. For #load and #require:

'(filename).zip/(file_inside_archive)'

would work as well and be clearer.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top