From: Greg Millam Date: 2002-12-14T04:11:20+09:00 Subject: Re: Can an .rbx file send it's own code? On Sat, 14 Dec 2002, Chris Pine wrote: > I was wondering if there's a way to make a web page (generated in Ruby) with > a link which, when clicked, would send itself... not the generated page, but > the actual page-generating Ruby program, the whole .rbx file. -- #!/usr/bin/ruby # putfile.rbx puts "Content-type: text/plain/n/n" filename = cgi['filename'] goodfiles = ['scriptone.rbx','foo.rbx','bar.rbx','baz.rbx'] if goodfiles.index(filename,'r') fd = open(filename) puts fd.readlines fd.close else puts "You do not have permission to read that file" end -- Then in your scripts -- # foo.rbx .. .. puts "Source code to this file" .. -- Hope that helps. - Greg. -- Greg Millam walker at deafcode.com