On Tue, 30 Oct 2001, Ryan Leavengood wrote:

> Well I didn't realize you had made this proposal (or I missed it.)  Yes
> this could certainly be done.  Something like:
> 
You might want to check out
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/~poffice/mail/ruby-talk/22530.

> require 'rubygems'
> RubyGems.run($0)
> __END__
> <binary stuff>
> 
> The problem is that this format would require special handling by the
> RubyGems system and it isn't consistent with the other file formats I've
> created.  I would prefer that this "executable RubyGems" extension have
> minimal impact on the core system.  Normal and executable gems should be
> treated the same.
> 
I agree. One nice thing with making all gems valid Ruby programs in
themselves is that people could actually add custom make and install
procedures etc. while still being valid gems. This way one and the same
gem can be used both

  * As a jar file which need not be unpacked to be by interpreter
  * As a distribution format - just do "ruby --make gem" and it will
    unpack and build extensions etc and then "ruby --install gem" and it
    installs.
  * As an executable Ruby program - Simply "ruby gem" and it will run (if
    its a runnable gem, otherwise just say no.

I'm not sure its wise to do all this with one system but I'm not sure its
bad. All the uses have similar needs and it seems they can all be
accomplished with the same core set of functionality.

I would expect that it would not change your file formats very much if you
simply search until __END__ before "parsing" them. But this is from my
large ignorance... I'm sure the devil is in the details ;-)

Regards,

Robert