From: Caleb Clausen on 26 May 2010 13:30
On 5/25/10, Tony Arcieri <tony.arcieri(a)medioh.com> wrote:
> If you'd like to include some data inline with your code, you can do it like
> puts DATA
> Look at me, I'm some data!
> The DATA constant will be populated with whatever text remains after __END__
However, you should be aware that this only works for the 'main' file
(which one was mentioned on the ruby command line). Other files which
are pulled in via require or load will not be able to get at trailing
data via __END__/DATA.
First | Prev |
Pages: 1 2
Prev: Status of sftp/ssh connection. Retrieve error-msgs
Next: The order of garbage collection