From: Robert Feldt Date: 2001-12-18T20:46:20+09:00 Subject: [ruby-talk:28864] Re: [IDEA] creating stand-alone versions for easy distribution etc On Tue, 18 Dec 2001, Patrik Sundberg wrote: > 1. create a good tool for analyzing dependencies. must also be able to fall > back on explicitly named dependencies. > Make this as stand-alone as possible since other projects will need it. The recent rdoc discussion springs to mind. > 2. create an archive class for ruby. this would hold just about any file and > have a table of contents to be able to find files. > > 3. create modified versions of require and load which can use a $ARCHIVEPATH > and a $ARCHIVEARRAY for require/load. in $ARCHIVEPATH we list directories to > search for arhivefiles (which are marshalled versions of archive objects) and > in $ARCHIVEARRAY we put already created archive objects (like the one we will > create from the data at the end of a executable). > Check out previous discussion on RubyGems. I posted some code that had a simple Archive class; maybe you can build on it. Was back in october/november or so. Search for Ryan Leavengood and RubyGems. > 4. write a tool which finds dependencies, creates a archive, creates a exe > which will: > - create a ruby interpreter (link staticly with libruby and we get the > version used by the packager?) passing any arguments etc. > - apply the require/load mods > - read the archive from end of file (using argv[0] to find filename?) > - create ruby object from data and stuff it into the $ARCHIVEARRAY > - load the main script using the modified load (i.e from the archive at the > end of the file) > > to me this at a glance seems doable and quite straigt forward :) any > reflections? > It should be very doable and useful. It was what I had in mind for rbwrap but the alpha worked ok for what I needed back then and then I never updated it. Regards, Robert